3 ms·
The main advantage of C was that it allowed you to type stuff super fast comparing with Pascal ( {} instead of Begin .. End etc.) and had some very handy shortc
by bitL 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.) and had some very handy shortcuts for often used operations like ()?:, ++, --, += etc. Less verbose language, less need to type syntactic structures. You could basically keep the flow of what is in your mind with the progress on your keyboard and forget about typing it; you were simply assembling stuff in your mind and at a rapid face making it happen on a computer. Something similar you can now probably experience with Go, sometimes Scala.
- pjmlp 10y agoTyping fast usually doesn't lead to working programs that solve what is actually the customer's problem. Software engineering isn't about "keeping the flow", rather about achieving the quality, deliverables and desired outcomes required by the users of the software.
- bitL 10y agoIt's what prepares you best as a young person to pass interviews at companies of your dreams or win ACM ICPC and similar competitions.
- pjmlp 10y agoNone of the companies of my dreams was using C and "ACM ICPC and similar competitions" was done in Prolog.
- bitL 10y ago:)
- jholman 10y agoIs this a typo for Pascal? When I did the ICPC, Prolog was not a permitted language in my region, and IIRC not at worlds either. But Pascal was (which I always found quaint, but perhaps that was my provincialism).
- pjmlp 10y agoNo, we didn't had anything like ICPC in the 90's on my home country, at least it wasn't known to us. But we had "... similar competitions", one of them was national logic programming competitions.
- johan_larson 10y agoI'd say the two more important advantages were a) the bare-metal view C gave you, down to individual bytes, which was important for systems-level programming, and b) the lack of overhead from things like bounds checking and garbage collection, which was useful on the butt-slow machines in the 70s and 80s.
- pjmlp 10y agoLots of languages allowed for a) and b), including the ones I mentioned, C wasn't neither the only one nor the first one.
- vram22 10y agoTurbo Pascal (from early versions) could very much handle individual bytes (and IIRC, had bit manipulation primitives like bitwise and/or/xor/not, shr, shl, etc.), and could even address memory at fixed locations, such as the video memory on the IBM PC (and segment:offset x86 memory at that). Don't know about other Pascal implementations, such as the others pjmlp has mentioned elsewhere in this thread, but would not be surprised if some of them could as well. I agree with pjmlp's statement (again, elsewhere in this thread), that C is probably being compared (to C's advantage) against early standard Pascal (which was a limited, academic language), not the commercial implementations which would have been / were more pragmatic. And I say this as a guy who liked and used both Turbo Pascal and C (C on DOS, Unix and Windows) a lot, for long, earlier, including being team lead for a successful Windows C database middleware product.
- 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.