Hacker News new | ask | show | jobs
by haalcion3 3532 days ago
Been coding Java for close to 20 years. Can anyone show me what's being done in the language to bring on newcomers, or did that ship sail 10-15 years ago?

Some ideas that would bring people back:

* Wildly new, terse, and clear syntax and a great library of built-in tools that are briefly and intuitively named.

* Easily write and design interfaces that generate both/either back-end or matching integrated front-end code which is off in its own directory and can easily be used by existing JavaScript and HTML.

* Similarly be able to generate the JavaScript front-end code that use those JS client libraries with easily writable/pluggable generators so that it can generate Angular 1.x, 2, ReactJS, Bootstrap, etc. in "best-practice" ways that can be updated frequently as the community changes.

* Simultaneously provide the option to serve very similar pages using straight HTML, degrading even to the point that a text only browser could use the site easily.

* Easily define responsiveness of pages.

* Support multiple 3D, 4D, etc. interfaces with customizable inputs to be forward-compatible without overdoing complexity (i.e. it's really pluggable).

* Similarly support generation of almost any kind of service integration, with easy pluggable authN/R.

* Easily scalable.

* Relational, noSQL, versioning DB (noms) support.

* Make fun books for kids and a site where they can share what they've written, write games, build things, etc.

* Make it integrate with every browser, even some older versions, operating systems.

* Make it compile low-level vs. byte code so it's fast as shit.

5 comments

> Can anyone show me what's being done in the language to bring on newcomers

I don't think Java needs any help in that department given how crazy popular it is.

And Android has made it even more popular than it ever was these past eight years.

Java has a few issues but the learning curve is not one of them.

> Wildly new, terse, and clear syntax

Kotlin

> great library of built-in tools that are briefly and intuitively named.

I dunno, guess this depends on what you need. The Java class library has so much in it, but I guess it's not overly intuitive due to the age of a lot of the packages. Personally, I don't think I'd have a hard time getting my .Net-loving colleagues accustomed to everything as is.

Java EE is another matter entirely, I gave up on it after the Java EE 8 clusterfuck that's going on and have just decided to use Spring for everything.

> Easily write and design interfaces that generate both/either back-end or matching integrated front-end code which is off in its own directory and can easily be used by existing JavaScript and HTML.

What are you looking for here? Automagic API's? spring-data-rest says hello. I still find it's better to write my own, but if you need something for a quick prototype there you go.

> Easily scalable.

How are you wanting to scale? Where is your bottleneck? This isn't on the language to solve, it's how you design your application. I can throw up 2,000 instances of an application, but whether the database behind it can handle 100K/tx/sec is another story entirely.

> Relational, noSQL, versioning DB (noms) support.

We've had JDBC, JPA, jOOQ, QueryDSL, etc, forever for the relational story. There's plenty of support out there for various NoSQL databases (Spring even has spring-data-cassandra which I am looking at using right now for an ES/CQRS design).

> Make it integrate with every browser, even some older versions, operating systems.

Why? Java in the browser is dead. If you want to write client-side stuff just use JavaFX and package using WebStart or an installer that bundles your JRE and dependencies.

> Make it compile low-level vs. byte code so it's fast as shit.

Java is already "fast as shit". The warmup time for HotSpot and initializing the JVM is probably the big complaint everyone has, but unless you are writing small command line tools it is a complete non-issue.

With that said, Java 9 will support limited AOT compilation of modules to reduce the time to get basic compiled versions of your classes - HotSpot will still profile the compiled modules, and if finds it is required it will deoptimize, re-profile through bytecode interpretation and reoptimize - just like it does with normal .class files (which are still required to run).

Thanks for the bullets. This is a good list but some of the points like "Easily scalable" and "DB support" are not cheaply available in any runtime and require careful attention to detail as well as domain-specific thinking. IMHO, the JVM already does a lot of heavy-lifting in this regard.
It comes down to this: are those developing the language thinking about how to add features just to try to hone and hold on to the enterprise developers that still use it, or are they thinking about what would make it more fun, productive, and practical?

Java's going to be around a long time. Those that stick with it will be fine. COBOL programmers made a lot of money in 1999, and some people still use Fortran.

But, Java's original big mantra was "write once, run anywhere." Such idealism then. Cool things have been done in the past few years, but can't we do more?

I work for Pivotal so I'm biased. But I'd take a long look at Sprint Boot in terms of "fun , productive , practical" Java: https://projects.spring.io/spring-boot/

In particular: - curated and tested open source library dependencies to the point that you can generate a single JAR for anything you might want to build on the server: http://start.spring.io/

- Annotations and APIs to make REST service development a breeze

- native support to build apps that use SQL, NoSQL and other Data systems without plumbing: http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/refe...

- SSH shell/CLI into your JVM to manage your JVM

- Actuator to provide production metrics for your system

- declarative security that allows you to build Oauth2 enabled apps in maybe 20 lines of code/annotations

- great symbiosis with modern JavaScript for responsive sites, eg https://spring.io/blog/2015/01/12/spring-and-angular-js-a-se...

- Cloud connectors to make it easy to run your app on Heroku, Kubernetes, Mesos or Cloud Foundry, or to leverage NetflixOSS components, or to build stream processing applications (Spring cloud stream / data flow)

It is being downloaded and used at a very high rate (a couple million a month).

Spring Boot is awesome, thank you guys for your massive contribution. All of my co-workers are .Net guys and keep trying to say that Java is dead now that .Net Core is out, but I still haven't found a server-side solution better than Spring yet :)
Hey thanks ... .NET core is awesome too, they should check out http://www.steeltoe.io/ for our attempt to bring Spring love their way :p
Cool, but much less useful than the full suite of Spring projects (which is why I love Spring in the first place, it's basically batteries included but everything remains modular so I can pick and choose what I want). .Net Core is a great stepping stone, but between deployment headaches (I can just run yum install java-1.8.0-openjdk to get a JVM and run a spring-boot app, .Net Core forces me to bundle the runtime right now) and the lack of a cohesive integrated suite of components keeps my heart with Spring (even if I'm forced to use .Net at work more often than not).
>Make it compile low-level vs. byte code so it's fast as shit.

AOT compilation is not automatically faster than JIT compilation. Java already is fast as shit. If you're worried about that first 100 milliseconds, works is being done on AOT compilation.

AOT isn't for the first 100ms, it's to avoid the 10K invocations required on a method for HotSpot to determine a hot code path and optimize the method - that can take a lot longer than 100ms and why when you see the JVM used in the financial sector, for example, they go through a lot of effort to "warm" the JVM.

Of course without runtime profiling the AOT built code may not be optimized for the hot path correctly, HotSpot will still deoptimize in this case and begin profiling again - so it's not going to be suitable for everything until they allow you to capture profiling details and feed it into the AOT compiler.

Most of that seems overly specific and wouldn't be appropriate for the core of a general purpose language. There's a whole world of software outside of web applications. Leave that stuff to separate libraries and frameworks.