3 ms·
That is also not how you would write it in idiomatic C++. The "before" example is C, or bad C++. You are allowed to write bad C++, as you are allowed to write
by ncmncm 7y ago
That is also not how you would write it in idiomatic C++.
The "before" example is C, or bad C++. You are allowed to write bad C++, as you are allowed to write bad Rust. But if you are to compare langues honestly, you should be comparing good code in one language to good code in the other.
The alternative is tendentious but typical, and nothing to be proud of.
- thrower123 7y agoI wouldn't expect an intern to write idiomatic modern C++. That looked to me to about what I would expect from a university student that had passing familiarity with C++ from their coursework; there is still an unbelievable amount of "C-with-classes" in active use and pedogogy kicking around.
- pjmlp 7y agoGiven how we used to teach C++ to university first year students back in 1994 - 2000, it still confuses me that there are so bad teachers keeping "C-with-classes" in active use. Basically, even without the STL, the students would get our department C++ library with the usual stuff (strings, arrays, vectors, bounds checking enabled), and the teaching would be similar to the way that Kate Gregory preaches how to teach modern C++.
- echelon 7y agoI found the article quite reasonable. The author explained that Rust tought them RAII and how they should have been writing C/++. Rust seems anecdotally better at onboarding new engineers than C/++. We're going to start seeing more articles like this.