Page 2 of 2

Re: clean minimalistic Quake C for schools

Posted: Sun Feb 05, 2012 5:49 am
by DolphinsOfCydonia
daemonicky wrote:Quake C si simple. I though about what is bare bones Quake C.

Yesterday I thought that Quake C could be taugh at schools. Most likely secondary education ones. I mean, it is OOP and quite in the spirit of original OOP http://userpage.fu-berlin.de/~ram/pub/p ... kay_oop_en
I think you're confused. QuakeC is not in the spirit of original OOP (nor is it in the spirit of classic C). Not by the definition of Dr. Alan Kay. Where are the classes? Where are the objects? Is there a state messaging system? Encapsulation? I don't think so. There is only one global class that may have its properties expanded upon.

I don't think teaching QuakeC in school is a particularly good idea. It teaches bad programming practises. Ridiculous use of global variables. Far too many weird idiosyncratic features for it to be a worthwhile first language. It may be fine in the hands of a seasoned veteran, but I think that all you're going to teach is how to follow some tutorials.

Re: clean minimalistic Quake C for schools

Posted: Sun Feb 05, 2012 7:25 am
by Baker
DolphinsOfCydonia wrote:nor is it really in the spirit of classic C, really. Not by the definition of Dr. Alan Kay. Where are the classes? Where are the objects? Is there a state messaging system? Encapsulation? I don't think so. There is only one global class that may have its properties expanded upon.
C doesn't have any of that stuff. Perhaps you are thinking some other language with a couple of plus signs after the letter.

Re: clean minimalistic Quake C for schools

Posted: Sun Feb 05, 2012 9:25 am
by DolphinsOfCydonia
:roll: Uh, no. I was not referring to C++. C does allow for emulation of OOP style though. But I wasn't trying to call C a OOP language. Regardless of what a name implys, QuakeC is nothing like real C, with the exception of both being curly braces languages. Again, if John Carmack had decided to give us memory allocation, structures, and pointers/references at the time, things would be vastly different.

Re: clean minimalistic Quake C for schools

Posted: Sun Feb 05, 2012 12:37 pm
by Spike
qc has inheritance, it has virtual functions, how does that prohibit OO coding?
we can make it more like pascal instead, if you would prefer that?
while you'd not focus a degree upon quakec, it might actually be quite useful if it was taught within the first year of a degree - however, it would *need* to be cleaned up a heck of a lot to remove all the globals...
the absolutely great thing about quakec is that a) its fairly simple, no pointers, structures, etc keeps the syntax simple. b) its results are highly visual - you can make a change and directly see the difference that it makes. c) its for a friggin game - makes it far more interesting for idiots who don't want to work.

Frankly, all the caveats will at least teach students that no language is perfect, which will hopefully avoid all the MUST USE CLASSES EVEN FOR A SINGLE LINE OF CODE!!! fanboyisms, because that sort of thing makes code utterly unreadable.

Re: clean minimalistic Quake C for schools

Posted: Sun Feb 05, 2012 10:44 pm
by frag.machine
Spike wrote:qc has inheritance, it has virtual functions, how does that prohibit OO coding?
we can make it more like pascal instead, if you would prefer that?
while you'd not focus a degree upon quakec, it might actually be quite useful if it was taught within the first year of a degree - however, it would *need* to be cleaned up a heck of a lot to remove all the globals...
the absolutely great thing about quakec is that a) its fairly simple, no pointers, structures, etc keeps the syntax simple. b) its results are highly visual - you can make a change and directly see the difference that it makes. c) its for a friggin game - makes it far more interesting for idiots who don't want to work.

Frankly, all the caveats will at least teach students that no language is perfect, which will hopefully avoid all the MUST USE CLASSES EVEN FOR A SINGLE LINE OF CODE!!! fanboyisms, because that sort of thing makes code utterly unreadable.

Huh... I love programming in QuakeC, but I can't see it as OOP. It's a very efficient script language, oriented to work over an array of fixed size entities. Declare a "foo" field to an entity type, and this field will exist in all the others, regardless what relationship (if any) exists between the types. You cannot even use it to teach about a real object oriented model like what's used in C#, Java or any other modern commercial language.

That said, QuakeC surely has a big appeal to students. It has a simplicity that remembers me when I started to learn C programming in DOS. Everything was clear and easy to understand (want to draw in the screen ? Change to a graphic mode doing this, access the VGA video memory at this address, draw a box filling the memory this way, etc). To do the same in Windows you'll need a ton of SDK's and libraries and frameworks.