3 ms·
Because c is simple. Rust has many qualities, but it's not a simple language. The problem with complex languages is that they are ill suited for low level stu
by jokoon 5y ago
Because c is simple.
Rust has many qualities, but it's not a simple language.
The problem with complex languages is that they are ill suited for low level stuff.
Sometimes it's better to not have high level language features, because it allows everybody to understand the code without having to know every feature of the language.
Simple is better. There are too many developers who prefer complexity.
- pornel 5y agoSimplicity is not that simple :) Brainfuck is an objectively smaller and simpler language than C, but it's not any better. Certain problems have an inherent irreducible complexity. This complexity has to go somewhere. If the language doesn't tackle it, then users of the language will have to. This is especially clear in the case of memory errors in C. C is too basic to express ownership of memory, valid scopes of pointers, and thread-safety of their usage. This doesn't make these problems disappear, only requires users to handle it manually and get it right without compiler's help. In Rust you have to specify ownership and thread-safety of everything. It is complex, but not because Rust is complex, but because safe low-level memory management and thread safety are difficult problems.
- raxxorrax 5y agoNot that difficult problems most of the time, but in practice the problems are more or less ignored and it often works, in most cases anyway. Not good obviously. Problem I have with Rust is that it uses certain patterns to make it work against the unforgiving borrow checker. I am not convinced that we will stay at this point. Rust disallows some operations where the developer can know the operation to be safe, but the borrow checker does not. So you need to accommodate the language.
- pornel 5y agoYes indeed, in Rust you have to do things the Rust way. But that's not much different than pains of trying to write imperative code in an OOP language, or mutable code in a pure functional language. Rust is closer to ML than the C family of languages, and the differences become apparent if you try to use it like C/C++. It's not a blocker in practice, because you can fudge things with `unsafe` if you know you're smarter than the borrow checker.
- raxxorrax 5y agoTrue, it just reminds me of declaring every Java method with "throws Exception".
- ksec 5y ago>Simple is better. There are too many developers who prefer complexity. This is going to be unpopular opinion because it is more philosophical and completely unscientific. I have been thinking something along that line for quite some time and not just on technology or programming languages. I think it has a correlation with age or how far along your journey in life. Simplicity has to click, it cant be told or learn just by reading. And more often that not, you can only understand simplicity after you try and fail to "fully" embrace complexity.
- shepherdjerred 5y agoThe added features and complexity of Rust may be a worthwhile tradeoff for the memory safety it provides compared to C. You're allowing a lot of mental overhead of "is this safe?" to be offloaded to the compiler, whereas with C you have to be extremely vigilant. Even the most talented programmers frequently make memory-related mistakes in C. If you want a truly simple language you should have a look at Go.
- unionpivo 5y agoC is simple is a myth. Sure it's simple in a sense there are not many keywords or features. And you can learn it over a weekend and start programming in it. But when you factor in undefined behavior, straight up user hostile choices done by common compilers in the name of performance, common patterns/library functions (that are all over books and stackowerflows) to avoid etc. C is not that simple anymore. When you throw in concurrency, programming in C is quite hard. I write this because I used to be an embedded C programmer, but that was over 10 years ago. I can still read code, sometimes even add simple patches (not to kernel ), so you could say I know the language. But it would take me several months of focused training before I would even dare to touch something as linux kernel. Not saying that Rust is simple, just saying C isn't as simple as some people make it.
- kaba0 5y agoYeah, it is sure better to pass around shitty c strings and iterate over them 402 times at each place to know its length because the language is unable to put a proper abstraction over them. Also, all of these are low level languages. There is no real difference between C and C++ in that way. C just lacks expressive power compared to C++.