|
|
|
|
|
by chipdart
639 days ago
|
|
> This is actually a bad example because C style decls are provably, objectively, bad. I found your comment extremely funny. You singled out the language which is not only one of the most popular languages ever designed but also the one whose syntax inspired or was straight out cloned by the bulk of the world's most popular programming languages. Yes, the programming language defined in the 70s isn't perfect and has a couple of kinks that could be improved. As does every single programming language. But when you see a curly-bracket language you see programming language designers yelling to the world that C got way more things right than any other language not derived from C, which is the exact opposite of your unbelievable claim. |
|
Back in the 70s, they didn't know as much about writing parsers as we do now. The field was much younger.
There is a reason that Go's declaration syntax is not based on C's, despite Go being created by one of the co-creators of C.
> which is the exact opposite of your unbelievable claim.
I'm not making claims, I'm stating facts. Parsing C declarations is difficult. Writing C declarations is difficult. Reading non-trivial C declarations is difficult. For examples of this in action read https://en.wikipedia.org/wiki/Most_vexing_parse.
C++'s horrific syntaxial complexity is the ultimate end of C-style decls. C++'s syntax is, again, objectively overly complicated for what it does. The reason it is overly complicated it because of the syntax it inherited from C.
C got some things right, mostly around ease of porting to different architectures. However, 50 years later we know a lot more about how to design programming languages.
C is not perfect, and even when it was created, better designed programming languages existed. However C was cheap and good enough, and because it was easy to port, it spread to lots of platforms.
FWIW I started my career in C/C++ compilers, I have first hand experience with these topics. I love C as a language, but I also acknowledge it is not perfect. The machines it was designed to run on in the 70s were not the height of Computer Engineering and C is not the height of programming language design.