3 ms·
Add the OpenGL calls and your program will not be shorter than the Clojure program in any way that is interesting.
by swannodette 15y ago
Add the OpenGL calls and your program will not be shorter than the Clojure program in any way that is interesting.
- psykotic 15y agoI am glad we are agreed it would still be shorter. It would also by my standards be simpler and more direct. But I'm not out to convince you or anyone else of that. Make up your own minds. You're defining the term "in any way that is interesting" according to your prejudices and I am defining it according to mine. Let's leave it at that. Zach's program is a lot nicer than what was originally posted. But please take a look at my program and tell me where additional abstractions would noticeably improve semantic and syntactic clarity. I can't find anything. The only thing that suggests itself is the recurring 'for (vector *v = t.v; v < t.v + 4; v++)' idiom. It's annoying to write bare-handed for loops, but I don't lose sleep over it.
- feral 15y agoIts not really fair to ask the C code to include OpenGL calls -- a pretty verbose API -- to compare it against the Clojure code which has default access to the Java Swing library, and GUI widgets. Looking at the game logic in both examples, I'm convinced by psykotic. Both programs are fine, but the Clojure one doesn't seem to add any extra higher level cleanliness or abstraction, over the plain old C code. Not to say that this holds in general, as code bases grow; or to take from the original tutorial in any way; just that I agree with that for a simple game like tetris, you don't see any benefit of the higher level abstractions, as implemented here. Also, you have to give psykotic some credit for putting the time into writing a quick proof of concept to back up the opinion expressed!