I was just reading this thread and wondered if it's easier to become a Java expert than a C++ one? Is it because it's very easy to write wrong code in C++ while in Java you have less flexibility (memory management for example) which prevents you from writing code horrors? Or is it because C++ is just inherently harder to learn and master? Have you came across a study that distinguishes and characterizes C++ vs Java vs C# etc coders?
With few exceptions, anytime I hear someone say they are an "expert" at a language I generally take them with a grain of salt. No matter what language, the best programmers know that they always have something to learn - whether from a seasoned veteran or from a kid right out of college.
What does it take? Like anything, years of practice and countless mistakes.
And even then, your expertise will be in a handful of areas where you solved particular problem domains again and again; i.e., islands of expertise. Middleware and/or frameworks? Threading & concurrency? Maybe Swing/GUI Java applications? Or web applications...
Java has grown to such an extent that nobody can be an expert in ALL that is Java--look at how many packages have been added between 1.4 to 1.6 and this should be obvious. Though you have guys that come awfully close (Johsua Bloch comes to mind...).
Edit: If this is in regards to recruiters and HR...shrug off all of the buzzwords, minimum years, and "expert in" and just get a phone interview with the team looking to hire. You need to find out from the technical guy what exactly he's looking for because nearly all recruiters and recruitment agencies are COMPLETELY CLUELESS.
One thing to consider is the amount of open source code there is available to study and learn from.
There is also quite a bit of open source C++ code, but usually Java is more succinct and focused, not having to deal with platform differences and various different libraries.
I feel Java is much easier to learn because that is how I recommend improving and learning. Read code. Read the JDK, read the source of well known and respected libraries and frameworks. Dig in and see how it functions.
The best way is to program a lot in Java. If it's not the language you use the most at work, then it should be the language you use the most on your personal projects if you want to become an expert at it (this applies to any language).
Some reading materials that will help you:
- Sun's Java Tutorials
- Head First Java
- Thinking in Java
- Effective Java
- Java Concurrency in Practice
- The Java Language Specification
As for ease of learning, I personally had a much easier time learning Java than C++. Java definitely benefited from the hindsight of its developers. They were able to mostly keep the things that were good about C++ and get rid of some of the things that made C++ more difficult to learn. They managed to make it harder, but by no means impossible, to shoot yourself in the foot in Java than in C++, and the potential damage is also often less when you do.
Have you came across a study that distinguish and characterize C++ vs Java vs C# etc coders?
I don't know of any such study, and I will not even begin to speculate. :)
Consider what you want to do.
If you want to work with programs for Macs learn Objective-C. if you want to work with programs for Windows learn C# or C++. If you want to work with web server backends learn Java.
If you want to become an expert, you need to practice a lot and learn even more stuff. I can recommend reading "How to become a hacker" http://catb.org/esr/faqs/hacker-howto.html#why_this (the whole document) as it will give you a lot of ideas and hints to what ELSE you should do.
Learning only one language is like painting only with acryllic paint.
Have you came across a study that distinguish and characterize C++ vs Java vs C# etc coders?
only this one. sorry.
Or is it because C++ is just inherently harder to learn and master?
I'd say this is the main reason. C++ is a much more complex language with lots of features that can be hard to understand, especially in how they interact.
Of course, the language itself is not everything - Java has a much larger standard API and de facto standard frameworks, which an "expert" would be expected to know.
being an "expert" in a language doesn't mean that much, for instance say you are an expert in C++ but have programmed all your career in Linux, would you hire such a guy to do a Win32 program or would you take somebody who is not necessarily an expert but has experience with Win32 and its quirks?
I think in the industry there are slightly different meanings for Java and C++ experts. Usually, Java expertise implies expertise with some set of APIs(such as J2EE), or a set of frameworks, or with a specific application server. It seems a smaller set of companies that use it are only using core Java, so often they measure expertise based on how many APIs you can claim to know. Often companies using C++ are using it for speed reasons and are writing much more of their code from scratch so they may be more interested in core language expertise.
That being said, I think Java as a language is much more straightforward, but its huge set of libraries and frameworks is very complex. C++ is difficult because you are basically learning three languages: procedural, object-oriented, and template meta-programming.
In my opinion, the problem with C and C++ that they were invented in the 60's1. Java came later and learned a lot from the mistakes, bad practices and questionable solutions often seen in C/C++. After 2001 when C# came along, I would say we observed a kind of co-evolution of these two languages. They learned from each other as well as they learned from C/C++ and for the first time in history, from the users themselves!2
In my case, to answer your question, I had to decide to either learn C++ or Delphi 12 years ago. I found it complicated and tedious to use C++ at that time. Since then, I moved to Java couple of years ago while tracking the greatnesses of C#. So general, it takes only time to become expert on one or another language. I would evaluate myself as an experienced programmer, as for the meaning of word 'expert' is very well defined on tdwtf, which I hope will never be applicable to me. IMHO.
I think the best way to compare coders of various languages is to do it yourself, as I think every argument about the subject is subjective.
1 correct me if I'm wrong about the dates.
2 maybe not the first time, but reading articles of emerged and emerging features of these languages makes me feel so.
For the comparison I found these references a while ago:
Comparación de características de loslenguajes de programación Java y C#, Mayo, 2003
although it is in spanish and I just looked at the code samples.
Comparing Object-Oriented Features of Delphi, C++, C# and Java
for a yet another, more diverse comparison on the subject.
And there is also an 'advertisement' from MS trying to convince you to switch to C# (or to C++ as it is available in VS along):
C# for Java Developers (Allen Jones & Adam Freeman, Microsoft Press, 2002)
Or if you want an 'independent' study:
From Java to C#: A Developer's Guide (Heng Ngee Mok, Addison Wesley, 2003)
One could say it takes 10 years to be an expert in language. As such I say it is just as easy to be an expert in Java or C++.
Being an expert requires different skills. Java has available to it a confusing array of hundreds of commonly used open source projects. Being an expert in Java means having a good understanding of many of these extras. e.g. Java EE, Spring, Hibernate and many more.
Most of this applies to many other languages:
As always you need much experience to be an java-expert. And if you think you gained enough experience, learn more.
Java has a rich and powerful API, it makes sense to have knowledge of it, if you want to become an expert.
You should learn to code clean and maintainable, to be a good programmer.
Learn also concepts in different languages, that java don't have (for example closures). You can learn much about a technology/programming-language if you know about things it doesn't can.
Learn about the concepts of the VM, the hotspot-compiler and the generational garbage collector java uses.
And if you reached a level of knowledge, that you think you cannot learn more - you're no expert. There is always more to know, and real experts know about that.