5 ms·
It seems to me he, first, talks about all the wonderful code he has seen written in C, then complains about C when he runs into terribly written C code but want
by sureaboutthis 9y ago
It seems to me he, first, talks about all the wonderful code he has seen written in C, then complains about C when he runs into terribly written C code but wants to blame it on C. I have a problem with that.
He then concludes that he likes things about Rust but then states Rust is a lot harder to learn but you become a better programmer cause you have to work harder on it. But isn't that what he complains about with C?
- tdbgamer 9y agoUhh did you read the same article I did? 90% of the article was features missing in C: Generics, Slices, Dependency Management, Tests, Useful macros, Pattern matching, etc. Those things have nothing to do with good or bad code and have everything to do with the language.
- sureaboutthis 9y agoDid you read the first section of the same article I did? You seem to have skipped that part.
- tdbgamer 9y agoHe mentioned some bad C experiences he had for a whole 7 sentences and that's your take away from the article? You're totally missing the point dude. The point is that C doesn't protect developers from some of the most basic mistakes and offers very little tooling compared to modern languages. It turns out that maintaining huge software projects in C is actually really hard.
- lmm 9y ago> He then concludes that he likes things about Rust but then states Rust is a lot harder to learn but you become a better programmer cause you have to work harder on it. But isn't that what he complains about with C? The difference is that when you haven't learned/aren't good enough in C, you'll make a codebase that sort-of works for now but is buggy and unmaintainable - code that reads uninitialized values or never free()s or works as an application but could never be turned into a library - whereas in Rust your code won't compile until you get good enough to write it properly.
- sureaboutthis 9y agoThat is a fault of the programmer, not C. Sure, having those things in rust is nice but, my point about the above line is, he's talking out of both sides of his mouth (with all due respect). I don't want to come across as dissing rust. I've only tinkered with it and liked the parts I saw but feel some of his comments are misplaced. EDIT: Obviously no one gets my point after twice explaining, that he's complaining about badly written code by bad programmers as his reason for dissing C, so I'll refrain from commenting anymore.
- Sharlin 9y agoThe point is, there cannot exist the same sort of terrible Rust code as the terrible C code he complains about. Because the compiler won't let you do it. With C you can write code that you don't understand is bad and broken because the compiler happily obliges and the program may even seem to work fine. With Rust you cannot because you're immediately told that the code is problematic (when it comes to memory safety. Of course there are other ways to write bad unmaintainable Rust code.)
- masklinn 9y agoThere kinda can in the sense that you could just make every function `unsafe`, but that's a bit of a giant blinking red flag.
- internetionals 9y agoAnd even then it will warn in many situations. Unsafe does not suddenly make everything okay, it only allows 3 specific things that are otherwise not allowed.
- masklinn 9y agoYes, but through these it does let you break the language by creating invalid values (and thus trigger wide-ranging UBs).