6 ms·
I wonder how much experience people yelling "OMG you're using C(++) - you have to rewrite everything!" actually have. Some of them can motivate their claims wit
by nallerooth 10y ago
I wonder how much experience people yelling "OMG you're using C(++) - you have to rewrite everything!" actually have. Some of them can motivate their claims with good examples (at least to some extent) while others just show a serious lack of understanding of project scope and/or the reason something is written the way it is.
One of my favorite examples so far: https://www.postgresql.org/message-id/CAASwCXdQUiuUnhycdRvrUmHuzk5PsaGxr54U4t34teQjcjb%3DAQ%40mail.gmail.com https://www.postgresql.org/message-id/CAASwCXdQUiuUnhycdRvrU...
- buserror 10y agoAhah nice example! "I can't code, but if I were, I would like to be productive in something that doesn't require me to make any effort in understanding the problem, please advise" I don't know where all the C hate is all about. I love C, it's a great tool. Can be quite sharp, be careful with your remaining fingers. I spent the better part of last week studying rust and go, and my conclusion was 'meh, I'll have another look in another few years" and kept on trucking.
- nallerooth 10y agoI don't get all the C "hate" either. Sure, C is a source of many "interesting" things - but it's also a natural part of control systems in avionics, space craft and nuclear power plants. I don't want someone who just read that "Rust is a great, safe language" to rewrite those. I really don't.
- fiedzia 10y agoAnd I do. Planes crashed and people died because of buggy software. We have lost Mars climate orbiter due to not using type-safe language. In the cases of software that works fine, we are just relying on ridiculous amount of manual verification, and this is both risky and expensive.
- mikulas_florek 10y agoMars Climate Orbiter was lost because they forgot to convert units between different systems. That's an error that can (and probably would) be done in all type-safe languages I know of.
- fiedzia 10y agoIt could be prevented if you could express units in the type system. Declare numeric_value_in_meters and numeric_value_in_yards as types and problem solved. Sure, it still possible that someone would not do that, but having this option is statistically better than not having.
- mikulas_florek 10y agoYou can do that in C struct Meters { int value; }
- fiedzia 10y agoYes, but nothing will stop you from casting pointer to meters into pointer to yards, while many C features force or encourage this behaviour. You also cannot override operators for combining those units. And the value is still just int.
- mikulas_florek 10y ago> casting pointer to meters into pointer to yards, while many C features force or encourage this behaviour. What C feature forces or encourages casting Meters* to Yards*? > You also cannot override operators for combining those units. The lack of operator overloads has nothing to do with typesafety. There are languages which are considered typesafe and which do not have operator overloading.
- jasode 10y agoNo, it's not statically checked for correctness. Example of successful compilation in C Language which is semantically wrong: http://ideone.com/Hdd4Sh http://ideone.com/Hdd4Sh (No casts required.)
- throwaway9475 10y agoI do. We have compilers that can verify seemingly perfectly (as far as we can tell) that a program won't do something silly like reference memory it doesn't own or try to use memory after freeing it (and not just languages like Rust, but any language that doesn't make you allocate and free memory). The best C programmer out there will still make mistakes because it's simply impossible to ensure that large programs won't do something they shouldn't. It boggles my mind that programmers seem to love better tooling and better abstractions, but when it comes to a certain class of languages, everything stopped improving in the 1970s with the PDP-11 and we just can't get past it.
- 2983923892 10y ago> I don't know where all the C hate is all about. It's about people who don't write software or plug APIs together but still want to have an opinion to show their "excellence". Meanwhile Leroy targets C in CompCert ...
- carussell 10y ago> Ahah nice example! "I can't code, but if I were, I would like to be productive in something that doesn't require me to make any effort in understanding the problem, please advise" Except that's not what the commenter said, and what the commenter did say is, although glib, not inconsistent with the motivation behind Bernstein's entreaty to just create a boringcc already.[1] Also, generally, just don't make up fake quotes to attribute to people. It's poor form. > I spent the better part of last week studying Telling. 1. https://groups.google.com/forum/m/#!msg/boring-crypto/48qa1kWignU/o8GGp2K1DAAJ https://groups.google.com/forum/m/#!msg/boring-crypto/48qa1k...
- buserror 10y agoThis is not making fake quotes, it's called paraphrasing. And "just don't" is impolite, I can just do pretty much as I like, as it is my own interpretation, Mr PC.
- carussell 10y ago"Paraphrasing" is not a convenient word for writing something that tries to masquerade as a direct quote—things that are paraphrased don't try to hide the fact they're being paraphrased. And you've failed to address the parts of my comment that are most relevant to the discussion. Why?
- buserror 10y agoWell, seems we can't seem to agree on a simple thing, I don't want to waste my time attempting to discuss anything more complicated than a word. You went straight for the cool-aid bottle on the previous comment, and you wonder why I'm ignoring the rest? Beside, my reply wasn't related to that particular post in detail it was paraphrasing (<-- hint) a behaviour that is pretty common across many projects, wether they are open or closed source. Sorry to come out as a bit flippant, but I'm slightly overdosed on the 'fake .' argumentation these days.
- nathan_f77 10y agoI am one of those people who doesn't have any relevant experience, but I think it would be amazing if curl and openssl were written with formal verifications, and with complete memory safety. And maybe in a purely functional style. It would be nice if lots of critical software was written to a much higher standard.
- 72deluxe 10y agoWhy purely functional??