|
|
|
|
|
by prewett
3846 days ago
|
|
STL strings are also next to useless. startsWith(), endsWith(), split(), case-insensitive find, stringify a number, numericify a string, easily construct a formated string, properly handles unicode (wstring does not), all require extra code. QString has a function for each of those. And the STL data structures are sometimes kind of unwieldy: if (dict.find(key) != dict.end()) { ... }
is lame compared to the easily understood: if (dict.contains(key)) { ... }
Not to mention all the stupid inconsistencies: // std::vector has no sort function, haha!
std::sort(std_vector.begin(), std_vector.end());
// std::sort doesn't work on std::list, haha!
std_list.sort();
And my favorite annoyance, the fact that std::vector::size() returns unsigned int, despite the fact that for practical purposes you aren't going to get anywhere near even 2 billion elements without running out of memory (or other performance problems), so I'm stuck writing for (unsigned int idx = 0; idx < v.size(); ++idx) {...}
or omitting the "unsigned" and getting lots of compiler warnings. I get why they would have done it; I would have done it too. Until I used Qt, then I like how everything is simply int. I suppose if you are doing physics simulations or something you might need something different, but it's the rare GUI program that needs unsigned int for size. |
|