I would add to that open source libraries which are (1) of high quality and (2) easy to pull in, e.g. Maven. The C++ ecosystem has no package manager, and people write header only libraries blowing up compilation times. With Maven, I can add Guava, Ehcahe, AWS SDK, etc. and their transitive department in about 60 seconds in a simple, consistent way.
I think the whole eco-system (including dependency management with maven) is definitely worth acknowledging the value of.
Fast build times. Removal of problematic/abused features like automatic type conversion and operator overloading. Never having to hunt down a segfault. Good reflection facilities. Well-structured exceptions (despite the 'checked' misfeature). Compiler error messages are almost always intelligible and obvious - when you see them, which is rare, because the IDE just underlines bad code. Add opensource libraries to do almost anything with just a line of xml.
You can work around checked exceptions by not using them, and Lombok eliminates most of the really annoying boilerplate (including checked exceptions with @SneakyThrows). The generics implementation isn't perfect but at least it doesn't require hours of parsing header files on every single build.
I don't miss C++ at all.
Other than Android Studio and Gradle, Java build times are actually quite fast. Just yesterday I gave up on compiling Cocos2d-x, after around one hour.
In Java I get to use the full language, not fighting with others about enabling RTTI and exceptions, or making proper use of C++ best practices instead of "C with C++ compiler".
Also unless one is stuck with one OS and one C++ compiler, writing portable C++ code across multiple OSes and compilers is either #ifdefs everywhere or constraining ourselves to the subset of common features.
Right now most commercial compilers for embedded systems are still on C++98.
I recently saw presentations from BMW and Sony, where they mention moving into C++11. Who knows when they will allow C++14 on their codebase, maybe when C++20 gets released, most likely.
If the code needs to be AOT compiled to native code, many third party JDKs do offer support for it, although they are mostly commercial.
Also, the use of header files were already outdated in the 80's, versus what languages like Modula-2 and Object Pascal supported. We will need to wait for C++20 to have proper modules, hopefully.
And best of all, no UB or compiler specific semantics, or change of language semantics between ISO revisions (auto vs decltype).
I still look forward to see value types and the new FFI in Java 10.
Really? I feel like Java and the JVM are great for developing web apps with complex requirements, especially if they need to scale. Very few decent web development choices perform as well as the JVM does.
I mean, part of the reason that "enterprises" have "shitty enterprise Java" is because "enterprises" will create "shitty enterprise anything," and the Java implementation often performs better than the alternatives.
This is actually a negative. Java can be great if you have half-way decent people who make good choices with regards to libraries and frameworks and application servers and whatnot, but the choices that come from "nobody ever gets fired for" thinking are by far the worst ones.
Example: IBM WebSphere. "Nobody ever got fired for choosing IBM," but they absolutely should be if they choose this giant shitpile. Anyone who has chosen this shit should be thrown into a wood chipper, unless they specifically chose it waste the maximum amount of time possible. Or, if it was invented to set Soviet computing back 30 years like the IBM 360, except that joke doesn't work anymore because the Cold War ended before Java was even a thing.
https://software.intel.com/en-us/articles/the-ultimate-quest...
I estimate that 70% of those errors just cannot happen in Java.
1 - Language agnostic
2 - Agnostic - Java doesn't have memcmp but the same issue returning (-1, or < 0) could happen
3 - Agnostic (with the exception that java would throw for out of bounds)
4 - Agnostic
5 - Agnostic - Its a windows complication (you can write C++ without DllMain even in windows)
6 - C++
7 - C++
8 - C++
9 - C++
10 - C++
11 - C++
12 - Agnostic
13 - Agnostic
14 - Agnostic
15 - C++
16 - Agnostic
17 - Agnostic (java has similar optimizations)
18 - Agnostic (inefficient code happens in any language)
19 - C++
20 - C++ (maybe java would throw instead?)
... This is longer than I thought.
9 of the first 20 are C++ only.
6. Languages with pointer arithmetic, especially that the cast that losses information is explicit.
8. It not at all obvious that silently ignoring the case failure is correct fix for this, or if there is any issue here at all. Generally common to languages with some kind of destructor and exceptions, though harmful in varying degrees.
11. Other languages generally make it impossible to write, or define order of operations.
I think the most interesting observation you can make is how much of those problems are caused by some form of implicit conversion between types (also stopped after 20):
4. int -> bool
9. char -> *char
13. int -> bool
14. bool -> size_t
15. different enums
16. bool -> int
This generally agrees with bug log that I keep. Implicit conversions being one
of the most common source of problems in C/C++. When possible I just treat all
implicit conversions as errors using compiler flags and make all casts
explicit. Unfortunately this is something you can only do when working on new
projects, and hard to enforce in templates.As far as I remember C# came out in 2000.
https://blogs.msdn.microsoft.com/dotnet/2017/02/13/happy-15t...
When I went back to C++ from Java (for a while), I just pretended it was Java, restricting myself to a rough subset of Java design idioms.
C++ (circa 2000) had too much latitude, too many sharp edges. Java's constrained design vocabulary allows you to focus more on the problem, less on the implementation. I blazed. My code was super maintainable.
I have no idea what C++ is like today.
I eschew meta programming. Huge distraction. Very difficult to grok other people's code. Java's progressive incorporation of declarative, dynamic features is regrettable.