4 ms·
It's extremely hard to take something away once you've given it. Once it's out there, someone's using it and not everyone can afford to rewrite/re-test/re-deplo
by PopsiclePete 11y ago
It's extremely hard to take something away once you've given it. Once it's out there, someone's using it and not everyone can afford to rewrite/re-test/re-deploy just because you changed how iostreams work.
The C++ std. lib. is one of the worst abominations of over-engineered disasters that I have ever seen in my life - how people even deal with stdout/stdin without tearing their hair out is beyond me. I just go back to printf and friends.
The fact that they had to have no fewer than 6 (or is it 8 now?) string types before they got Unicode right... it's truly a sad state of affairs.
How can anyone look at that and not feel embarrassment to have been part of those design decisions...
- jblow 11y agoActually, it is easy, if you had the foresight to put in versioning. Which they didn't.
- imglorp 11y agoWhat would legacy-free C++ look like? Abandon all the old attempts and have One Approved Method.
- cpeterso 11y agoAt that point, why use legacy-free C++ instead of a language like Rust?
- gpderetta 11y agoThere is one, it is called std::string. It works fine as a container of utf8 code units. What other string type do you have in mind? Well,there is also wstring, but you should just pretend it doesn't exist.
- PopsiclePete 11y agoI don't think std::string is fine. Yes, it stores bytes, and yes, UTF-8 is byte-oriented, but besides being a storage of bytes, std::string has nothing that is unicode code-point aware. You need external libraries like ICU for that.
- gpderetta 11y agoOh, std::string is very far from being perfect for sure and the almost non-existent Unicode support in the standard library is consistent with its general lack of features. As it the case in C++, you have to resort to 3rd party library for anything beyond the very basic. ICU is very good though. There is also boost.Locale which is more "modern" and utf8 oriented although less featurefull. I was merely pointing out that saying that C++ has 8 string types is flatly wrong.
- hacker_9 11y ago> It's extremely hard to take something away once you've given it I would agree, but I look at c# and every time they introduce a new feature the revamp the standard library just fine.. so C++ really has no excuse. C# went from ArrayList -> List<T> -> IEnumerable<T>, and when async/await was introduced they upgraded the methods that used plain old threads before or just introduced new '{name}Async' methods. C++ is so bogged down in legacy at this point that I would never use it given the alternatives of Rust/D.
- coliveira 11y ago.NET is a closed platform that is controlled by Microsoft. When MS upgrades the API, developers working there rejoice because now they can charge a lot of money to upgrade the same systems. This is completely different from the mindset of people using C++. There is no company controlling the language, and code is written in C++ because of it is well known to be a language that maintains backward compatibility.