JAX London Blog

Are Java and Javascript still worth knowing?

Jul 17, 2017

are java and javascript still worth knowing?

Source: Shutterstock

In this interview, Mario Fusco discusses the problems of Node.js and the importance of working with smart programming languages. What about Java and Javascript you may ask "are not worth knowing"?

Some people seem to believe that Node.js might have a chance at overtaking Java in the near future. Can Java really be dethroned? Why/why not?

Why Node.js is attracting so many people is really beyond my understanding. We are in the era of multicore cpu, even my smartphone has 8 cores, and do we really want to run on our servers a single threaded framework? In a typical Node.js application running on a 8-core machine it often happens that one core is always at 100% of its utilization while the other 7 are practically idle. If developers like the event-loop pattern implemented by Node.js there are many other Java framework providing the same thing in a more robust and sane way. The only understandable reason why I think some companies are adopting Node.js is that in this period there are much more Javascript developers and they are also generally cheaper. I saw a similar trend with inverted roles a decade ago. There were many Java programmers who were required to perform web-side development and they didn’t want to use (or learn) Javascript. For this reason we had a few frameworks like GWT allowing to do web development in Java. GWT isn’t that bad but doesn’t scale very well and definitively doesn’t allow to create web site with millions of concurrent users. Node.js is the GWT counterpart on the server-side and indeed suffers from similar problems. My opinion is that we should always use the right tool for the job at hand. Javascript is ok (even if not ideal) for web development, but for what regards the backend I can think of tons of better alternatives.

Alan Perils once said: “A language that doesn’t affect the way you think about programming, is not worth knowing”. Unfortunately, I think that both Java and Javascript can be listed in this category. We learn them more for business reasons than because we enjoy using them.

This year, Stanford’s famous introductory course for programming dropped Java in favor of JavaScript. What does this say about the relevance and popularity of Java?

I saw this and I was surprised, not because they dropped Java, but because they chose Javascript. Java is probably not a good language from a didactic point of view, but for sure Javascript is much worse on this aspect because it tempts (and sometimes requires) any sort of bad hacks instead of making the developer think in a clear way. I believe that a university shouldn’t choose a programming language because it is trendy and widely adopted in industry, but because it teaches you something and improves your reasoning skills. Alan Perils once said: “A language that doesn’t affect the way you think about programming, is not worth knowing”. Unfortunately, I think that both Java and Javascript can be listed in this category. We learn them more for business reasons than because we enjoy using them. In my opinion, a language like Smalltalk for what regards the Object Oriented Programming and one like Haskell to cover the functional aspects, not to mention a modern lisp-esque language like Clojure, would all have been better choices.

Top 20 Java Influencer Mario Fusco
What would you like to see in Java 10?

I’m really excited about everything that is planned in Project Valhalla. Value types will be for sure the most relevant improvement, and generic specialization will allow to avoid tons of unnecessary boxing/unboxing operations that are very time consuming. Probably the usefulness of reified generics will be a bit more limited, but they will help a lot programmers like me who work on the development of frameworks and libraries that in general require an heavier use of reflections. Finally recently I saw an email of Brian Goetz that announced the possibility of introducing pattern matching in Java. This will help to limit the use (and abuse) of the visitor pattern and however any change that could increase the functional programming capabilities of Java is very welcome for me.

Behind the Tracks

Software Architecture & Design
Software innovation & more
Microservices
Architecture structure & more
Agile & Communication
Methodologies & more
DevOps & Continuous Delivery
Delivery Pipelines, Testing & more
Big Data & Machine Learning
Saving, processing & more