3 ms·
Usually I'm more in the camp of "let's preserve everything we can as cultural heritage, yes even those awful Nazi propaganda material" and I'm confident that so
by psychoslave 2y ago
Usually I'm more in the camp of "let's preserve everything we can as cultural heritage, yes even those awful Nazi propaganda material" and I'm confident that some distant archeologist (or current close neighbor) will be glad we did.
But as time pass, I'm more and more convinced that wiping-out every peace of C that was ever produced would be one of the greatest possible gesture for the future of humanity.
I also have a theory that universe exits so we can have some opportunities to taste chocolate. Surely in that perspective, even C can be an unfortunate but acceptable byproduct.
- adonovan 2y agoRemember that C's contemporary languages were either inefficient (e.g. ALGOL 68, PL/1, Lisp), functionally obsolete (e.g. FORTRAN didn't have recursion or heap allocation), or even lower level (Assembly, B). C eliminated the need for need for assembly in programs that were low level (like OS kernels) or high performance (math, graphics, signal processing), and that was surely a huge improvement in type safety and expressiveness.
- psychoslave 2y agoWell, Basic and Pascal was already something I guess, and Modula arrived in the same "era" as C. So at a general level the weight of C is to my mind not so much due to how it was shining out of the crowd of its alternative options for general programming. Instead my perception is that it's mostly due to a conjunction of where it was born (Bell Labs), its initial focus on construction of low level layer parts (kernel/OS), and how software stacks tends to leak. That doesn't void completely what C achieved at a technical level, of course. But it certainly ponder differently how much its spread can be weighted on its technical benefits.
- anticensor 2y agoYou missed one important category: too verbose (COBOL, Pascal).
- chasil 2y agoBut how interesting would your life become if SQLite ceased to function anywhere around you? Should this misfortune befall you, please don't get on an airplane (with me).
- psychoslave 2y agoAn alternative world without the quirks of C is obviously not necessarily one without any database relying on an other programming language (carrying its own quirks of course :D)
- H8crilA 2y agoToo many people still don't understand C's greatest failure: the undefined behavior. Most people assume that if you write past an array then the result may be a program crash; but actually undefined behavior includes other wonderful options such as stealing all your money, encrypting all your files and extorting you for some bitcoin, or even partially destroying a nuclear isotopes processing facility. Undefined really means undefined, theoretically some demons may start flying out of your nose and it would be completely up to spec. If you think that this is justified by "performance gains" or some other nonsense then I really don't know what to tell you!
- inopinatus 2y agoNo, it doesn't. It means the C standard imposes no requirements. It does not mean the compiler becomes unconstrained by statutory law or physics, and if your compiler is actually malware then it is not politely waiting for undefined behaviour before injecting a payload. The notorious nasal demons may not be in conflict with the C standard, but they are not going to actually happen, because they only exist in the imagination. The example is given to illustrate by absurdity that the scope of consequential defects is greater than "your program may crash", that's all. If you do wish to produce a similar effect then I suggest consuming a bowl of Buldak instant noodles whilst inducing a sneeze during compilation. Warning: your sinuses will not thank you. And cover your keyboard. The biggest hazard with undefined behaviour is that the compiler is not required to issue warnings or errors when encountered.
- rramadass 2y agoThanks for straightening out people's absurd ideas about UB. It is instructive to read what Ritchie himself thought of various UBs "specified" by the ANSI committee - https://news.ycombinator.com/item?id=20171616 https://news.ycombinator.com/item?id=20171616
- saagarjha 2y agoTypically this view is proposed because a malicious attacker can actually make your program do all sorts of stuff you probably did not expect, including adding "functionality" that you did not include in your program.
- uecker 2y agoI don't get that C hate. That terse syntax can be misused to produce unreadable code in C, does not change that I usually find it more readable than more verbose syntax.
- rramadass 2y agoIt is not "C hate" in as much as folks flexing self-aggrandizement. These type of constructs are just intellectual curiosities and not really related to actual usage.
- psychoslave 2y agoProbably hate is a bit too strong of a word here, at least to describe what I personally feel about this programming language, or any programming language really. And more importantly, it looks like I failed to put properly the humorous cursor at the level I was intended to express it in this comment. Sorry about that. I'm not sure what you mean with "terse syntax" here. To my mind what this article cover is more about convoluted constructions permitted by the languages. The C-user community tends to have a more abundant use of terse identifiers, which I personally find detrimental to the readability with no sound benefit; but this has nothing to do with syntax. An other thing that the article point to in that case is how much overloaded are the reserved tokens like parentheses and the asterisk, and syntax here too is marginally involved at best. That is, we could use `schtroumpf` and `schtroumpfly` instead of `(` and `)` and `schtroumpfing` instead of `*` without changing anything to the nub of the ergonomics issues this implies. What you can infer from looking at a line of code regarding how the compiler will interpret it is not a question of terseness, it's a matter of how much context sensitive the language is and how much the community follows idioms with assiduity which allows cognitively cheaper correct inferences most of the time. All programming languages have their pitfalls, it just happens that C comes with many original surprising ones, with paths of least cognitive resistance easily matching big trouble ahead. In a nutshell, C has terrible ergonomics, which makes no wonder it might be despised by some who have to reluctantly use it. But of course C will receive more harsh/gentle critics proportionally to the attention weight it has in the industry.
- uecker 2y ago