clean minimalistic Quake C for schools

Discuss programming in the QuakeC language.
DolphinsOfCydonia
Posts: 21
Joined: Tue Nov 08, 2011 4:01 am

Re: clean minimalistic Quake C for schools

Post 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.
Last edited by DolphinsOfCydonia on Sun Feb 05, 2012 9:38 am, edited 3 times in total.
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: clean minimalistic Quake C for schools

Post 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.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
DolphinsOfCydonia
Posts: 21
Joined: Tue Nov 08, 2011 4:01 am

Re: clean minimalistic Quake C for schools

Post 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.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: clean minimalistic Quake C for schools

Post 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.
frag.machine
Posts: 2126
Joined: Sat Nov 25, 2006 1:49 pm

Re: clean minimalistic Quake C for schools

Post 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.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
Post Reply