Hacker News new | ask | show | jobs
by knollimar 15 days ago
Using a big library like OpenGL and then playing code golf seems at ends. Cool writeup but these always confuse me
4 comments

The point of the "500 lines" book is to make programs small enough to be understood: https://aosabook.org/en/500L/introduction.html

It's not about golfing as much functionality as possible into those lines, at the cost of rendering it incomprehensible.

There isn't much attempt at code golf really, and OpenGL is a standard graphics API. Plus project is a 3D modeller, not renderer.
so printf("%i", 42) is fine and dandy golfing, but glTriangle(x, y, z) is too much? The next thing you're gonna tell me is that a true golfer manually invokes syscalls.
OpenGL has a tiny API surface compared to the other 3D APIs. Of course, that means it has a painfully complicated state machine hiding under the hood...