4 ms·
This was my personal experience, where learning C allowed me to make a 3D engine with Gouraud shading in a few days, where the same in Pascal would have taken a
by bitL 10y ago
This was my personal experience, where learning C allowed me to make a 3D engine with Gouraud shading in a few days, where the same in Pascal would have taken a lot longer, mainly because of necessary syntactic sugar. C just allowed to go super fast and didn't restrict experimenting as much as Pascal did (which is still a pretty permissive language), and even adding inline assembly code to render fast felt natural, unlike in Turbo Pascal. And this speed carried over to competitions.
- pjmlp 10y ago> inline assembly code to render fast felt natural, unlike in Turbo Pascal. Turbo C: asm { .... } Turbo Pascal: asm ... end; What was unnatural about it?
- bitL 10y agoYou could do some tricks with GCC like not specifying arguments in your MOV instructions and let GCC use the optimal registers it calculates during compiling. Practical consequence was that instead of doing some default MOV AX, [something] then MOV BX, [something], then e.g. MUL BX, you could have avoided the first two operations as GCC would chain them together properly without the need to fill in values; so by inlining such code you'd get very very close to hand-written assembly language without additional overhead, speeding up your 3D engine significantly.
- pjmlp 10y agoOn those days I seldom found a compiler that was able to generate better Assembly than a human coder at junior level would be capable of. So we just wrote the inline Assembly 100% ourselves, regardless of the compiler.