8 ms·
I do think you’ve identified a significant rift between those that prefer C and those who do not. I think you’re being downvoted for the value judgement you’re
by steveklabnik 3y ago
I do think you’ve identified a significant rift between those that prefer C and those who do not. I think you’re being downvoted for the value judgement you’re injecting, though.
> gets out of your hair and lets you ge on with programming
This is the divergence, I think. For me, the method in which c “gets out of my hair” means that more burden is placed on me, the developer. Which means I have to work more slowly, cautiously, and remember things that a good type system could have been checking for me. And the lack of features means I spend time working around that lack rather than getting real work done.
I suspect these preferences are irreconcilable.
- quelsolaar 3y ago> I do think you’ve identified a significant rift between those that prefer C and those who do not. I agree. I think the article is very right in identifying that C developers look at programming differently. I think that is a good thing. Even as a Die-Hard C programmer, I celebrate that people use other languages and especially that people are developing new languages like Rust, Odin, Zig and so on. I don't think it wrong for someone to reject C, if its not right for them. Do what works for you. I do think that given Cs massive success, people should perhaps be a bit more interested to figure out why, instead of just dismissing it so fast.
- comfypotato 3y agoYour comments on this thread up to this point sound like a religious fanatic. I greatly enjoyed reading. Goes to show why it’s called “The C Religion”.
- quelsolaar 3y agoI think, most designers of languages want abstractions, convenience, and clevernes. So for people who don't want that we have to cling on to C since there aren't other options ;-)
- rewmie 3y ago> I think, most designers of languages want abstractions, convenience, and clevernes. You get that in C as well in the form of libraries and frameworks. Today you saw a post in HN on how to do object oriented programming with C. Some time ago people shared C frameworks to enforce memory safety. There are generic data structures libraries for C as well. I think your jab on how C programmers don't want abstractions, convenience, or cleverness is a weak strawman. It's obviously not it. What I think C programmers value is expressiveness and speed, and avoid bloat and overall inefficiencies, and C detractors don't want to address that because it forces them to face the real world tradeoffs which expose the shortcomings of their personal choices. There's a pervasive fear of missing out on the latest and greatest, and an irrational need to jump onto bandwagons, and C is extreme opposite of it. And yet it still outperforms anything that came after.
- melagonster 3y agowriting C like doing extreme sport, respect but I don't want to try it soon. thanks all developers of interpreter, because they wrote it with C, so I don't need to write C.
- rramadass 3y agoYou have the wrong idea and doing yourself a disservice by not learning C. It is not as difficult as people make it out to be.
- vba616 3y agoI learned C in the 1980s. At that time, for practical purposes, it seemed it was the same as Pascal, only with less verbose syntax - { } instead of begin/end. But then I discovered Usenet and the - I don't know exactly how to describe it - the cult of undefined behavior, and the people who care only about standards and not reality. A basic, straightforward language like what people say C is, is certainly useful. I don't know Rust, and I don't have any plans to learn it. As I think we all are aware, C originated before computers were standardized on 8 bit bytes, ASCII, Unicode, and 32/64 bit words. So, I mean, no matter how much people say it's appealing because it's simple and reflects the nature of the hardware, it really doesn't. Is it not true that the Linux kernel is compiled with GNU extensions and not standard C?
- rewmie 3y ago> But then I discovered Usenet and the - I don't know exactly how to describe it - the cult of undefined behavior, and the people who care only about standards and not reality. I don't understand what you tried to say. The standard specifies how the language actually works, and therefore what developers can reliably do with it. How exactly do you see this as a break from reality?
- vba616 3y agoIf you stopped at that sentence, then the rest of my comment might clarify. It's hard for me to elaborate further without any idea of your background. How long have you been programming in C? Have you encountered TAOCP and MIX/MMIX? Do you write strictly standards compliant C? Did you use to read or post on comp.lang.c? For reference, here is a list of things that are/were off topic: https://benpfaff.org/writings/clc/off-topic.html https://benpfaff.org/writings/clc/off-topic.html Dennis Ritchie posted on clc in 1999 and was told he was off topic. It has passed into history as a "joke". "DECtapes are highly platform specific, and are not covered by ANSI C, which is the subject of this newsgroup (comp.lang.c). Try a DEC-related newsgroup. If you want us to comment on your source code, please post it in the body of your email. What was your C question?" https://groups.google.com/g/alt.folklore.computers/c/wbzzoySmeMk https://groups.google.com/g/alt.folklore.computers/c/wbzzoyS... Face saving aside, that was normal treatment for newbies other than Dennis Ritchie, so if it was a joke, who/what exactly was being made fun of?
- hudon 3y agoHow is the C type system slowing you down? I thought the complaints around C productivity were around memory management and low-level APIs (both of which can be mitigated using libraries: you can “abstract away” these problems and stay in C).
- Hirrolot 3y agoThe need to express polymorphism manually in C, the need to remember to check errors returned by functions (instead of the monadic style of computation), the need to define closure's environment structures (those that are passed via something like `void *arg`), etc. All these things are pretty tedious. And all these things are what other languages are doing under the hood. The difference is that C gives you a choice of _how_ to do (more) things; other languages do not.
- JohnFen 3y ago> The need to express polymorphism manually in C Or, don't do polymorphism in C. It's not a mandatory technique. I love C, but I'd argue that if you're doing advanced OOP, you should use a more appropriate language.
- steveklabnik 3y agoLike Walter Bright, I would love to have some sort of “span” or “slice” primitive. I would love language level tagged unions rather than writing them out each time. Pattern matching isn’t exactly a type system feature, but relies on it to work, and would make those more useful. The lack of destructors means a lot of manual handling of errors. The lack of generics makes it difficult to write generic data structures without losing type safety. There’s no real const. There are ways to do all of these things, but they’re more manual, more error prone, and get in the way of doing the actual work you’re trying to do.
- ho_schi 3y agoThat describes the basic feature set of C++ very well. People complain about C++ that it can do much more. Yea. But there is no need to use template meta-programming, multiple inheritance and other special features. Actually I think programmers shouldn’t use them in productive code. Recently some projects switched the compiler to ‘g++’ and use the basic subset of C++. Makes sense? Maybe Herb Sutters “C++2” will evolve, main features are safety and simplicity. I’m fine with both C and C++. They do a good job. Address-Sanitizer is a game changer! But I want more.
- JohnFen 3y ago> more burden is placed on me, the developer. Which means I have to work more slowly, cautiously, and remember things that a good type system could have been checking for me. Very interesting. You cite these as drawbacks, and I consider them all to be advantages. Which just proves the point! > I suspect these preferences are irreconcilable. I think you're right. Fortunately, they are only preferences and so aren't incredibly meaningful. I prefer C, but most of my professional work isn't in C. And I don't always choose C for any given project. Every language has its own advantages and disadvantages, so I select the language for a project keeping in mind which one mesh best with the project at hand.
- antonvs 3y ago> You cite these as drawbacks, and I consider them all to be advantages. Why would they be advantages? Working more slowly and cautiously might be advantageous in some cases, but being forced to do so because otherwise your program might die a horrible death seems hard to justify as advantageous. Unless you're treating it as a sort of extreme sport, like rock climbing without a rope.
- tourmalinetaco 3y agoBecause working slowly and rewriting code typically leads to better code. By taking it slowly you grow more familiar with what you want, it gives you more time to think, and its generally more enjoyable. This culture of “fast coding” is a major reason software ends up so flawed. People are so enamored with quantity they completely forget quality along the way. And that means everyone suffers.
- antonvs 3y agoYou didn’t actually address the point I raised about why C is hard to justify for that reason. Besides, a strong type system also forces you to think about the design of your code, and demonstrably leads to more reliable results, on an industry-wide basis.
- 3y ago
- assimpleaspossi 3y ago>I have to work more slowly, cautiously, and remember things I think that should be a good thing.
- steveklabnik 3y agoHumans build tools to help us achieve things. No good comes from making me manually remember things a machine could easily check for me. I doubt you crafted the HTTP call to post this comment by hand, even if you could. I could. I don't want to. That's why tools exist.
- MereInterest 3y agoIt depends on what I’m being slow and cautious about. Imagine a programming language that is identical to C, but every prime-numbered line is ignored. In such a language, I would be cautious to add or remove lines, slowly and cautiously remembering which line numbers to avoid. It wouldn’t provide any benefit, as I’d be paying attention to line numbers instead of paying attention to null checks, or integer overflow. In the same way, C imposes an extra burden compared to other languages. If I declare a std::vector in C++, or a Vec in Rust, it will be deallocated when the scope is exited. But in C, every malloc() requires a call to free(). It requires extra effort for no benefit.
- steveklabnik 3y agoThis is a far better way of putting what I tried to say, thank you.
- andrewmcwatters 3y agoThere is absolutely a benefit, but it doesn't sound like one to you: it explicitly requires you to know that you're actually doing something with memory, which rapidly deteriorates as a concept for developers once they no longer have to be cognizant of the fact that they are indeed actually using it. I prefer a world where people actually think about the resources they're using.
- 3y ago
- taylorius 3y agoI think it's work either way. You either spend brain-time on memorizing the intricacies of a lot of prebuilt tools, and how / when one might apply them (modern c++) - or you dispense with the many tools, and spend your brain time on memorizing relatively few, but with more effort and detail required on their application. (C). I prefer the latter, but as you say - it's probably linked to personality to some extent, and quite "baked in".
- JohnFen 3y ago> You either spend brain-time on memorizing the intricacies of a lot of prebuilt tools I suppose another piece of evidence about how this is a personality thing is that I hate having to learn specialty tools. They're limiting in that typically, they only exist on certain platforms, and they often specific to certain languages, so knowing those tools often doesn't help me generally. (Libraries and the equivalent count as tools here, too.) So I make it a point to not grow a dependency on them even when I use them. I very much prefer to focus on skills that I can leverage widely.
- taylorius 3y agoSounds a sensible policy to me!