Miles1981 wrote:It's getting there. You already have smart pointers int he standard, no need for new ones, threads are getting there (I hope C++14 will have more of these). ArrayList, I don't understand the issue with vector?Zaphod (giancarlo) wrote:The stupidest thing on the planet, Google did it again and again in EACH library created. How many different debug printf around? They are even if conflict between themselves when you link different Google libraries at once.
There will be several hundreds smart pointers implementations around. Or black trees.
In java you have your standard bone, and it is highly optimized, and there is no wheel to create each time. It just works.
That hashset or the arraylist implementation ARE good and they have been ALWAYS good. You go on c++ and you never know what to do because the standard came late, you should adapt your old code again and again, syntax of things changed so many times and everything is a big mess.
Syntax is constant, it doesn't change.
I will say something "strong" here, so don't take it personally, it is not my intention to offend you in any case: but I think you should try both languages for a while, maybe doing the same things in both of them in order to understand what I mean.
You "hope" c++14 will have. Java had waaaaay more complex things available and "standard". When you need a thread in java you have a single way for doing it. You don't invent the wheel again and again and again. If you need an hashmap, there is a single way, and it was a single way for doing it even 10 years ago.
The main issue I find in c++ is that most of things were unified just few years ago: when I started doing things in 2005 for acustica there was a crappy compiler on mac osx (xcode 3) and several crappy compiler on windows (I tried both borland, codegear, and microsoft) with a strange definition of "std" in all of them. Boost was still not an option, since was not supported properly in Borland. This complete lack of "standards" forced all programmers to "invent" the same wheel several times. I understand lately a standard is growing up in the c++ land, but it is a bit too late.
I repeat: each time I use code coming from google, facebook, me, microsoft, apple -> I find the same exact things rebuilt and rebuilt again and again and again using different sub-standards.
HOW MANY DIFFERENT STRING CLASS IMPLEMENTATIONS? Damn... strings.... the most SIMPLE thing you can think about. In 2005 even those damn stupid strings were not a standard. Borland had AnsiString. Microsoft used cstring. I don't remember the name for Apple, but I remember I wrote a compatibility layer for them. Oracle was translating his string class to std::string. Now, this f**king string class should be the most OBVIOUS thing I can think: go figure smart pointers!
Open source code coming from Doom3/id software or Oracle: the same things again, again , again!!!!
Maybe because a proper std was introduced in Microsoft compiler too late, and on the other side Apple modified this funny clang compiler too many times, leading to a complete lack of standard TODAY. Google itself is rewriting and rewriting the same things, and if you look at their code it is a COMPLETE MESS. It is a list of #define, unix things are loaded if it is not microsoft and viceversa hundreds and hundreds of times.
Now I understand this is perfectly normal for someone not used to java, but in java you have complex things available, standard and GOOD. Their hashSet implementation is GOOD, it was GOOD, and there is no reason for REWRITING it. Even its syntax is "coherent", and in line with all other patterns you find in the language. When you write java code everything is OBVIOUS, straight, SIMPLE. The day you need a concurrent hashset there is a different class but your code will still run perfectly without modifying anything else for the exception of the declaration. Maybe the most revolutionary improvement was the introduction of observers for this class... but you learn it once and you use it millions of times.....