5 ms·
These are the sort of reasons I’ll never be able to use C or C++ in any real capacity. Sure I can read it and to a much lesser write it, but there’s way to man
by the_only_law 5y ago
These are the sort of reasons I’ll never be able to use C or C++ in any real capacity.
Sure I can read it and to a much lesser write it, but there’s way to many crazy things dependent on the compiler/platform that I never run into and only ever see in passing contexts like this. I think I’d trust my self to learn Haskell before I ever trust myself to write production C.
- rramadass 5y ago>I think I’d trust my self to learn Haskell before I ever trust myself to write production C. Hyperbole much? This is just one of "those" things which you only learn when you need it. In actual usage, myself and most people i know have never used "inline" in C. Macros are the time honoured way of doing such things. There is no mystery to it but just a choice and convention (compared to C++).
- the_only_law 5y ago> Hyperbole much? Nope, I fully believe this. > This is just one of "those" things which you only learn when you need it. And how will you know when you need it when you don’t know it?
- pjmlp 5y agoAfter spending hours trying to figure out why something doesn't work and by chance landing on the above post when searching for inline and C.
- rramadass 5y agoYour argument really does not have a leg to stand on. The concept of "inlining" a function is Programming 101. The mechanism of how to achieve it is what is specific to a language/runtime. You check the syntax/semantics/documentation and figure it out aka problem-solving. Not a big deal and no need to make unwarranted claims/charges against the language as a whole.
- Dylan16807 5y agoThis is not something you can just look up and get a good explanation.
- 1ris 5y ago>and figure it out aka problem-solving. The existence the linked thread suggests this very hard and even capable (and very involved) programmers potentially need mentorship for this.
- bregma 5y agoC, unlike many modern programming languages, requires that you understand how a computer works. It's just not an appropriate language for most programmers, including many of the more vocal who comment here on HN. If you're writing an app, or scripting together some apps, you don't need C. If you're programming a computer, you need a tool that depends on the computer to do its job, and that means you're going to have to tolerate crazy things dependent on the platform. This is what they call a domain problem. Very few app developers are involved in the domain of programming computers. Of course, that does not leave them feeling unqualified to comment on tools and techniques of those who are, because they use computers every day.
- tialaramex 5y agoThe PDP-11 was last century. Modern computers aren't much at all like the imaginary machine the C programming language is defined against. The compiler's job is to wrestle what you wrote, for that imaginary machine, into machine code that will run on the real computer somebody actually owns which is quite different. This is a difficult task and it gets harder all the time. Programmers who believe they're writing "bare metal" programs in C are delusional and are particularly likely to get a very rude awakening when they try to write concurrent software. What the machine really does is too hard for you to sensibly reason about at scale, so C provides SC for DRF and says if you do anything else (and you will) too bad your program's meaning is undefined and you lose.
- pjmlp 5y agoMany languages offer similar capabilities without many of the issues C has plagued into the industry. In fact there used to exist computers where C compilers did not even exist for them.
- the_only_law 5y agoI have a feeling there’s a world of software outside of your lazy reduction to “apps” vs “computers” which is a pretty nonsensical reduction in the first place. It’s funny how much hate the Rust community gets when C programmers are just as bad at coming out of the word work to try and insult people when someone takes even the most minor shot at the language they’re so attached to (which was frankly, more or less a shot aimed at myself)