4 ms·
> The main advantage of C was that it allowed you to type stuff super fast comparing with Pascal ( {} instead of Begin .. End etc.) Speaking as a developer who
by khedoros1 10y ago
> The main advantage of C was that it allowed you to type stuff super fast comparing with Pascal ( {} instead of Begin .. End etc.)
Speaking as a developer who works mostly in C and C++, that's a pretty crappy advantage. Based on the answers here[1], it seems like the real benefits were a more permissive type system, better library, separate compilation units, and better ways to directly access hardware.
https://www.quora.com/Why-did-C-succeed-over-Pascal https://www.quora.com/Why-did-C-succeed-over-Pascal
- pjmlp 10y agoAll the advantages of C over Pascal, usually disregard the extensions that almost all Pascal implementations had. All the points you mention from Quora were covered by Object Pascal, Turbo Pascal, Quick Pascal, TMT Pascal, Think Pascal, VMS Pascal, HP Pascal,.... Yes there were lots of dialects, but writing C code back in the day each C compiler outside UNIX had their own view of what compiling K&R C was all about, C wasn't any better in portability across compiler vendors and OSes. If it wasn't for UNIX's adoption, C would have been just yet another systems programming language.
- bitL 10y agoThis 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.