Ask HN: Is there any excuse not to know Java?

10 points by tokenadult ↗ HN
I have complete buy-in to the idea that Lisp is an elegant computer language, and general buy-in to the idea that knowing a lot of languages from a lot of paradigms is good for perspective and for problem-solving. As Alan Perlis said, "A language that doesn't affect the way you think about programming, is not worth knowing." Any programmer can gain new ways of thinking by learning a new language.

But asking more for students whom I advise than for myself, is it at all expedient for a young person entering the job market today to be unfamiliar with Java? Java has its own set of trade-offs, but doesn't it continue to be employed in many applications in many industries?

22 comments

[ 4.2 ms ] story [ 78.2 ms ] thread
It only makes sense to know Java specifically if you have some use for it. The limited Java I know is only because I do some work with JVM languages and it becomes a hindrance to not know any. Otherwise, I could have gotten by just fine without knowing it at all.

I think it might be better generalized as knowing some object-oriented C-like language (C++, Java, C#).

You're asking (or implying) a lot of different questions here.

Is is expedient for a young person entering the job market to be familiar with Java (I'm changing this to a positive formation becasue negatives are confusing)? Of course. The TIOBE index answers this is two seconds. Java has over 18% market share, the most of any language.

Is there any excuse not to know Java? Of course. You don't care about the 18% of the market that uses Java. I think I could be happy knowing just Python most of the time.

To answer some more implicit questions:

Will learning Java affect the way you think about programming? Java is a great place to learn about unit testing, DI, and design patterns. The value of these is of course up for debate, but knowledge is power, and Java gives you a great chance to get this knowledge. Ultimately, I think it's better if you move on to more expressive languages, but Java is a good platform to learn some stuff on.

Should you know a lot of languages? Yes. While you may not need Java specifically, not knowing any C-like object-oriented language is not only career suicide, it's detrimental to your development as a programmer.

I can't think of any valid excuse. Quite a few very good open source projects are in java and it will be highly beneficial if you know Java to use the code for your own purposes. Also I believe Java is one of the heavily used language in the industry currently if not THE most used. And it is also a well designed object oriented language (so I find no harm in learning it). It is also a good entry into the Java platform/ecosystem.
There is no reason for not knowing something. That being said, knowing Java at this point might be advantageous in many respects because of the mature state of third party libraries available to support all aspects (development, testing, deployment) of any kind of work you are into.

If you are a good programmer without a job, it will definitely help you as there are plenty of Java jobs available in the market now.

I have personally come across a couple of startups, started by smart engineers from MIT/Stanford, which suffered because they found excuses not to do their work in Java and do it in Ruby/PHP. One of them ended up rewriting everything in Java (which made their initial 6 months of development a throwaway) and sadly, another one got stalled. Am not implying that its better than other languages as each language has its own pros and cons. However, you will not know if it can serve your specific purpose better because you don't know what you don't know.

Well, there is opportunity cost. Could the time and effort spent on Java be better spent elsewhere?

It may be because I'm still feeling the glow Java had when I learnt it in the late 1990's, but I really like a lot of things about it. It's a very simple, safe and easy to use language, it's C++ without the broken glass, it's C with automatic memory allocation, bounds checking and a nicer package/interface system. API's are separated and enforced. It used to be bemoaned as slow ("knock knock" "who's there" "................java"), and now it's seen as fast. That's pretty cool (it's partly because it's relatively faster than python... but it also has been made actually faster).

Many early adopters left it for python/ruby a few years ago when the small language that Java was became uglier with extensions, esp generics and annotations. Perhaps an important reason people left is because it became successful, and it became associated with unpleasant mindless corporate programming.

If you care at all about what qualities a language needs to have in order to be wildly adopted, Java has something to teach. Some people say it was just Sun's marketing... but Sun marketed it as a web language (applets), and it never took off there.

Well, there is opportunity cost

That's the succinct version of my first thought: "Because one was too busy making something instead of learning languages for their own sake."

The opportunity cost of learning Java (or any programming language/paradigm for that matter) is very low compared to cost of failure (in the instance i've quoted). Your thoughts on what's good in Java is well put. I don't know if generics/annotations made the language uglier but I can definitely vouch that it has made my life a lot more easier to write programs faster. Has it made my programs faster? - maybe or maybe not :)
Java having lots of jobs isnt a good metric, because theres lots of jobs also means theres lots of people applying, in fact I would say a good reason to not use Java would be to simply weed away (some) people applying
From an excuse point of view, its definitely a metric for a 'good' programmer 'without' a job.

I would highly recommend against selecting a technology because you want to weed out applicants who are misfits. A better option would be to have a strong hiring process.

PHP might not be the best choice for every job, but do Java developers really have more resources? Google says...

java+libraries: 13,600,000 results

php+libraries: 32,200,000 results

Why should someone have to know Java?

I know Java because it was the language of choice for my undergraduate software engineering lab (6.170), but I specifically do not take Java work because I've found other languages I enjoy more. One of the joys of being a professional engineer is the freedom to choose your tools.

I'd say .NET is more valuable than Java if you're looking for an 'industry' job.

But at the very least you should have some familiarity with C.

I thought this little corner of the web was about startups, not how to get industry jobs.

If you want to be big and lethargic. If you want to write twice as much code to get the job done then go ahead and use java or C#.

Its a misconception to think startups don't use Java or C#. I did a search on startuply (YC funded site for startup jobs) for some of the programming languages I know to get an idea of how many openings exist in startups and the results are below. Guess which language has most openings in startups ..

Python: 167 C#: 87 Ruby: 187 Java: 601 PHP: 318 Erlang: 14 Clojure: 3 LISP: 7 Perl: 100

The wording of this question (as summarized in the headline) suggests professional negligence on my part for not having spent a year, five, or ten learning Java. I'd like to respectfully disagree.

Ruby is my primary programming language, but I've also built apps and scripts in Python, C, C++, Objective-C, PHP, and Scala.

I'm a firm believer that exposure to a wide variety of programming languages is a great way to experience new constructs, paradigms, and approaches to computer programming, which is why I've spent the past few years branching out. During this process, I've worked with a few languages built atop the JVM (Scala and JRuby), and thus learned a bit of Java, basic language structure / primitives, and some underpinnings of the JVM. I believe that making an effort to understand and employ these various platforms has helped me to become a better programmer.

It sounds as if you're coming from the perspective of an academic advisor. This surprises me, as your question is primarily career-focused. Had Java been forced on me in University, I would have left disappointed by my education and mentally prepared for five years as a junior developer in a cube farm working on obscure, broken internal HR software. Instead, exposure to this variety of languages, architectures, and concomitant development methodologies has taught me a lot about programming / software engineering, and opened my eyes to careers I might not have imagined otherwise.

Circling back to the original question, I can tell you that I live a happy, productive, fulfilling life as a software developer at a great company doing what I love without "knowing Java."

It sounds as if you're coming from the perspective of an academic advisor.

Yes, and I appreciate your response and the diversity of responses here. The only programming language I formally studied, a good long while ago, was BASIC, and I'm still wrapping my mind around what personal productivity problems I could solve by programming (as contrasted with being a power user of other programmers' software products). I do have occasion to talk to young people about career planning and academic goals through my math-coaching nonprofit organization, my new occupation, and through a statewide parent organization about education of able learners. My involvement with people in the next generation is what prompted the question.

Would it be fair to sum up the joint agreement of everyone here that one should always be eager to learn that which might bring about greater personal happiness and career development, without being squeezed into a mold by arbitrary requirements of an educational program?

There's knowing Java as in having a grasp on the language syntax itself and some parts of it's standard libraries (and of course OOP, as I think most would agree it's a sine qua non for a programmer nowadays), and then there's knowing Java as in JEE and the miriad of associated apis, frameworks and tools. While I (as an employer) am not interested in the later, I would pretty much expect any decent programmer to be familiar with Java at least on some basic level.
That is a strong statement, and not true for everyone, so I would vote for it not being necessary to know Java.

Until about 3 years ago, I used Common Lisp and Java each roughly 40% in my work (I still think that if you search for "Java consultant" I am the number 1 Google hit :-)

However, after I started using Ruby, I have transitioned to using Ruby for most of my work.

Ruby is great because it provides most of the advantages of Lisp except for the fantastic run time performance (natively compiled Common Lisp is fast!). However, for many (at least web) applications, bottlenecks tend to be stuff like session handling across multiple servers, database access, dealing with network partitioning and server failure, etc.

One problem with Lisp is the lack of a super rich ecology of libraries. Lots of great stuff is available for Lisp, but still weak compared to Ruby, Java, Python, etc. I'm rewriting a customers app right now because we learned what we needed to learn with a small Common Lisp prototype, and are now doing a hopefully final Ruby + Rails rich UI web portal (it is so much easier to write a rich web UI in Rails that in Lisp-based alternatives).

I would advise concentrating on one language and platform, and only spend perhaps 5 to 10 hours a week (an evening and some weekend time) learning new languages and frameworks.

BTW, feel free to substitute Python for Ruby, in my advice to your students - pick a primary language based on which you enjoy using the most. Also, Java as your primary language is fine also, if that suits you.

'I know Ruby'

That's a good excuse.

You are so right about the 'can gain new ways of thinking by learning a new language.'

I took an APL course once. I SWEAR I could feel myself growing new brain wiring...

I "know" Java because I had to do many undergrad projects in it, but I don't advertise the fact that I know Java at all because I actively do not want to work with it. It is a language designed for incompetent replaceable programmers, and I find working with it sort of insulting in a way, and just not enjoyable in general.

Depends on your (or your student's) approach to employment, really. If you want any programming job at any cost, of course you should know Java. There are lots of Java jobs, though the flip-side to that is that the market for Java programmers is extremely flooded.

On the other hand, if you're more worried about actually finding "interesting" work, pitching yourself as a Java programmer might help more than hurt. I would personally rather stack boxes or something along those lines than work on some kind of enterprise payroll nightmare in Java. Some would not. As always, it depends.

That said, Java is pretty simplistic if you're familiar with any even vaguely similar language (which you certainly should be, since the overwhelming majority of code out there is written in them). There's really very little to "learn" anyway...