7 ms·
C really is still a beautiful language.
by defgeneric 10y ago
C really is still a beautiful language.
- acidbaseextract 10y agoIn the same way that a chainsaw really is still a beautiful tool.
- abraae 10y agoWhat an inspired sentiment. I love C (well I used to last time I used it), and I love chainsaws too.
- nkurz 10y agoNo, C is more like a chef's knife. It will take your finger off if used wrong, it never should be used as a screwdriver, but in trained hands it's a precise tool for the right job. It's C++ that is more like a chainsaw: a noisy, smelly, clattering but effective tool, dangerous without modern protective gear, and an equally poor choice for tightening screws.
- steveklabnik 10y agoHere's a fun blog post about this particular analogy: https://www.schneems.com/2016/08/16/sharp-tools.html https://www.schneems.com/2016/08/16/sharp-tools.html
- nkurz 10y agoWonderful article, thanks! Looks like it hasn't been discussed yet, so I submitted it here: https://news.ycombinator.com/item?id=13092740 https://news.ycombinator.com/item?id=13092740. One of the things that I like about the chef's knife is that if you hold it correctly (http://www.seriouseats.com/2010/05/knife-skills-how-to-hold-a-knife.html http://www.seriouseats.com/2010/05/knife-skills-how-to-hold-...) the deep blade gives you both control and increased safety. People often think the bigger the knife the more dangerous, but often the opposite is true. Chainsaws on the other hand scare me despite their utility, possibly because my grandfather (a very experienced chainsaw user) had a horrendous scar across his neck and face from being stitched back together after an unexpected kickback.
- yoodenvranx 10y agoI like the language itself, I just dread the tooling around it. If there would be a better build system, easier integration of libraries, better strings and an overhauled standard library I would start to use it again.
- quanticle 10y agoIt's interesting that you say that, because my experience is just the opposite. I dread C. I dread all the simple ways that you can screw things up even without going into undefined behavior (which is its own can of worms). The only thing that makes C tolerable for me is that it's had literally a generation of people building tools and guardrails around all the stupid ways C can trip you up. Without modern debuggers, linters and valgrind, C would be nigh-useless as a programming language today. It'd simply be impossible to write a program of any reasonable complexity.
- yoodenvranx 10y agoSorry, I should have been clearerwhich toolings I was talking about. It's not so much tools like debuggers or linters, but more about the build system and the compilation process. There is just do much crust and dangling bits and pieces of the last few decades that the whole process is the complete opposite of streamlined and user friendly. I do most of my programming in Python and for most projects it is enough to create a program.py file, import some stuff and then do 'python program.py'. If your Python program is not overly complex and only uses one of the common libraries then there is almost no visible build system which gets in your way. If i haven't used Python in half a year it takes about 30 seconds to start programming again, but god forbid I haven't looked at make or cmake for half a year...
- MrBuddyCasino 10y agoYes! A simple language that is easy to reason about with a tooling that doesn't resemble duct tape and black magic, better stdlib and actual strings would be nice to have. Some people say Golang is that language, but the tooling is actually not that great and then theres the garbage collector... Edit: forgot to add "sound type system", to me C feels like a hybrid between a properly strongly typed language and something scripty.
- once-in-a-while 10y agoC is beautiful portable assembly (nothing more).
- pjmlp 10y agoNot even that, at least with Assembly you know what you can count on, with C and UB not really.
- torrent-of-ions 10y agoYeah, but to really appreciate it I think one needs to have programmed in assembly. Unlike the author of the original article, of course. C is going to look horrible if you've only ever used python. That's because you don't understand at all about real computers and how to program them.
- throwanem 10y agoI've known a number of EEs who have spent much of their professional time writing assembly and C to run on embedded hardware. Perhaps oddly, despite being ideally placed for it, none of them has ever displayed the sort of "Real Programmers Don't Use Pascal" elitism you do here. I wonder why that is.
- torrent-of-ions 10y agoI did not say anything about "real programmers". This came from your own mind.
- throwanem 10y agoNot using the exact phrase isn't the same as not invoking the concept. Disingenuousness benefits no one, especially when it's obvious.
- torrent-of-ions 10y agoI can't help it if it invokes the concept inside you. I've programmed extensively in assembler and C, and I've programmed extensively in Lisp. I see the benefits of programming a real computer and the benefits of programming an abstract one. My point was merely that if you have not been exposed to the real computer you will not see why C is the way it is.
- K0SM0S 10y agoTo be fair, one probably wouldn't go much beyond malloc lest they at least roughly knew how memory works, heap/stack, etc.
- pjmlp 10y agoUntil you need to track down a pointer misuse on an UNIX variant that doesn't have something like AddressSanitizer available, and the customer is already pissed off it has taken more than one week to track it down and they keep loosing sales every time the system crashes. A personal anecdote that took place sometime between 1999 and 2003.