4 ms·
You really don't understand, but that's okay. C is a wonderful language, and that's the end of it really. You just try to think C as a language that SHOULD HAVE
by youarethejoke 4y ago
You really don't understand, but that's okay. C is a wonderful language, and that's the end of it really. You just try to think C as a language that SHOULD HAVE all the stupid bells and whistles you find convenient. Many of us more advanced coders have found that those stupid bells and whistles are, in fact, inconvenient. Casting to void is a powerful technique and the limits are literally endless. C is semantically rich, way beyond your dull imagination.
- WastingMyTime89 4y agoThe argument is not about what can and can’t be done in C. C is Turing complete and low level. You can do anything in C. The debate is not even about if it’s good idea (I don’t think it is but that’s separate). The question is about C semantics. Given the reply I get it’s pretty obvious that some here don’t understand what language semantics are. It’s about the amount of concepts you can express in the language. Haskell - a language I personally despise - is semantically very rich. So is modern C++ for what it’s worth. C simply isn’t. It’s even deceiving sometimes because it has the apparence of having some semantic elements (arrays for exemple) which are not there in reality and are really only syntactic sugar on top of other semantic constructions(pointers).
- eska 4y agoYou’re whitewashing history if you think Pascal was superior to C. There was no conspiracy among compiler developers as you imply. Also you complain about semantic richness of C, but then only point to semantically rich languages you despise. A curious reader would wonder: why care about semantically rich languages then? An observant reader would wonder: so aren’t there times where semantic richness is not useful?
- WastingMyTime89 4y agoWhat conspiracies are you talking about? C won because its compiler was widely available for free. That’s pretty much a fact. Pascal was indeed a superior language but limited by the proliferation of extensions, paid compilers and its compiler performance. I’m not even complaining about the semantic richness of C. I’m just stating the fact that it doesn’t really have semantic richness. Then again don’t get me wrong. I do think C is a terrible language and I say that having worked on a C static analyser. It’s full of avoidable undefined behaviours and silly sharp edges. Thankfully, nice languages with rich semantic exist. I was just pointing some I don’t like to separate the issue of semantic richness from likability. I enjoyed working in Ada a lot. Ocaml is awesome. I have never used Rust but from what I have seen that seems nice. Semantic richness is useful because it helps programmers express what they want to do in way which are clearer and therefore more likely to be correct.
- timbit42 4y agoPascal, at least the original specification, does have a few flaws. It was intended to run as P-code in a VM so you wouldn't expect it to be as good as running directly on the hardware. The successor to Pascal, which fixed it's problems, was Modula-2, which is vastly superior to C. Unfortunately by the time it came out and started becoming available, it was too late for it to compete fairly with C. Ada is comparable to Modula-2, especially before Ada added OOP, but Ada was too late to compete with C as well. It's taken 30 years but finally we are starting to see safe languages, eg. Rust, compete with C and C++. I don't know whether Rust will be the language that overtakes C and C++, but if not, I believe a successor to it will and C and C++ will become like COBOL, that no ones uses to write any new code.
- Tozen 4y agoPascal was and is continually evolving. A strong argument can be made that Object Pascal was the "successor" of Pascal, and that happened in 1985/86. After Apple and Wirth developed Object Pascal, Borland added the OOP extensions to their version soon afterwards. Turbo Pascal had quite a long run, and some are still using it. The Delphi dialect of Object Pascal came out in the early 1990s and Free Pascal came out in the late 1990s. Many of the so-called issues with Pascal were resolved way back in the mid to late 1980s. In regards to Pascal's competition with C, this arguably evolves around AT&T and Unix. It's AT&T and their huge government, industry, and business influence that pushed C over the top.
- timbit42 4y agoModula-2 has many new features that make it better than Pascal. It is not merely a Pascal with some issues fixed. One small thing I like about Modula-2 is an improvement in the syntax where BEGIN is not required after conditionals and loops.
- kazinator 4y agoThe first thing you need to learn about semantics is that it's a singular: "what semantics is", not "what semantics are". The nice thing about C is that if you're opinionated about what you want your ideal language to look like, you can use C in that pursuit. You can write your run-time in C and parts of the implementation. C is good for interfacing with operating system platforms. You can fully bootstrap yourself off C entirely, or stick with C for the run-time and perhaps other parts. If your language isn't very good at expressing low-level manipulations, you can keep C in there as an option for writing those kinds of modules. Some languages have used C as a target language for compilation. C can be an enabler in the pursuit of other languages.
- timbit42 4y agoC is a garbage language. It has a lot of undefined behaviour. It isn't safe. It isn't even strongly typed. It's only marginally better than a macro assembler. C programmers consider that a virtue but programmers who want to write safe, robust code, know C is garbage.