top | item 6524767

(no title)

zainny | 12 years ago

I'm surprised nobody has mentioned Android yet. When you add in the Android factor, Java is probably still one of the most widely used programming languages today.

It's funny the article straight away brings up the verbosity argument as well. You want to talk about verbosity - take a look at Objective-C and Cocoa (again, hugely popular today!)!

Personally, I quite like Java.

discuss

order

EpicEng|12 years ago

Popular in terms of use, yes, but liked? I don't know, I doubt it. Android and iOS essentially force you to use Java or Objective-C respectively. I don't hate Java, but I don't like it either. It lacks quality of life features that other, similar languages have had for years. I can't stand writing code in it if I don't have to (and don't get me started on Objective-C...)

From what I hear from others and read on a weekly basis, few people enjoy writing Java code. It may not be dying in terms of numbers, but given an option to use something else those numbers would likely drop very quickly.

fizx|12 years ago

"There are only two kinds of languages: the ones people complain about and the ones nobody uses." -- Bjarne Stroustrup

taspeotis|12 years ago

> and don't get me started on Objective-C..

    itsNotTheLanguagesFaultPerSe:butIfTheFunctions:andTheirParameters:werentNamedLikeThis:itWouldBeBearable

bad_user|12 years ago

I have been using Scala for both server-side and Android projects. Android doesn't have such a capable VM and Scala is a little wasteful in terms of short-term objects, but using Scala while being mindful about performance implications of the code you write is still better than Java. In fact on Android you can use pretty much any language under the sun, including languages that don't run on top of the JVM. The development experience may not be as great as when using Java, sometimes you suffer from interoperability issues and so on, but for personal projects it's OK.

iOS doesn't force you to use Objective-C either. For example many top games or apps have been built in C#, by means of Unity or MonoTouch. The problem with iOS is Apple's developer agreement, as they first didn't allow apps written in anything else than Obj-C, after which they changed that to not allowing apps doing JIT compilation, but now they only enforce this rule when banning apps that download and execute code on the fly. For this reason, when embedding a WebView inside an app, Javascript will not have the same performance as Safari's Javascript engine, which is kind of stupid. So many devs prefer native compilation to avoid any problems. There's nothing wrong with iOS as a platform, what's wrong is with Apple's restrictive policies.

wting|12 years ago

Java is a commonly used language, but not very popular according to a Hacker News poll from 2012:

https://i.imgur.com/toGKy21.jpg

In fact, it's likability percentage is worse than PHP!

I think the issue may stem from the fact that given a choice, few people use Java in their own projects but have no choice at work.

qwerta|12 years ago

> Android ... essentially force you to use Java

You can use many languages which compile down to Java Byte code.

pgcsmd|12 years ago

FWIW: I really like Java. C and Lisp would be the other languages I'm especially fond of.

CmonDev|12 years ago

"Android and iOS essentially force you to use Java or Objective-C respectively"

But the combination of iOS and Android gently pushes you in the Mono/F#/C# direction. Come to the light side!

RivieraKid|12 years ago

If Java wasn't the most used language out there, Android almost certainly made it so.

I quite like Java too, besides C#, I don't think there's any good alternative for bigger projects.

My dream would be Ceylon replacing Java some day. After looking into many newer languages aiming at a similar market as Java (Scala, Clojure, Dart, Kotlin), I believe that Ceylon is the best-designed statically typed programming language out there.

They've made incredibly good and pragmatic trade-offs between features, readability, verbosity, expressivness, speed, toolablity, familiarity, etc.

BlarfWobble|12 years ago

Android doesn't really count as java, as it doesn't use the JVM.

But even if you do choose to count it, it's only a very small part of the java ecosystem. Applets are dead, and java desktop applications unpopular, but without you necessarily seeing it, enormous amounts of server side software are made with java. If it hadn't been Java, it would have been some other language, but the fact is that there is such an enormous ecosystem of high quality libraries, tools, infrastructure and experienced programmers, architects and devops built around Java and the JVM that I don't see anything toppling it from the #1 position any time soon.

C#, being a better designed and more rapidly evolved language, might have displaced it if Windows rather than Linux had become more popular as a server OS, but it didn't, and now it won't, so that is moot.

CodeGlitch|12 years ago

I don't agree that something isn't Java if it doesn't run on Oracle's JVM. I can write Java that runs on Kaffe, etc.

Personally I really like Java - coming from a C++ developer (11 years in the games industry). I wouldn't mind working with it everyday...

pjmlp|12 years ago

> I'm surprised nobody has mentioned Android yet. When you add in the Android factor, Java is probably still one of the most widely used programming languages today.

Except that Oracle was right into suing Google, after all.

Google hasn't improved the language level beyond Java 6 grammar.

So nowadays one is forced to write in Java 6 when targeting Android, which is really a pain, specially when writing libraries.

This will only get worse when Java 8 gets released. No lambdas or other Java 8 goodies for Android developers.

Plus, they haven't bothered to improved GC and JIT on Dalvik past the Android 2.3 release.

They seem to care only about pushing libraries for Google APIs nowadays.

kllrnohj|12 years ago

> Google hasn't improved the language level beyond Java 6 grammar.

That's because Oracle has been suing them over it. Dalvik hasn't changed in years thanks to that lawsuit. Google was steadily improving Dalvik right up until that lawsuit happened, then it came to a screeching halt. That's not a coincidence.

And really, what Java 7 language level features were there that makes it problematic that Android still runs Java 6? The good stuff was dropped from 7 and pushed to 8. 7 is boring.

yareally|12 years ago

Actually, you can use the following on Android from Java 7 and 8:

- Case/Switch Strings

- Auto closing files handlers (via adding a few classes/interfaces). Also known as "try with resources"

- Integer literals

- Multiple exceptions in a catch block

- Lambdas via RetroLambda[2], which compiles Java 8 bytecode into 7 or 6

Used them all in several projects with 20-100k+ downloads with no user reported errors related to their usage. New Android projects though, I rather just use Scala, but older things I don't want to convert, I use the above to make Java easier to manage.

[1] https://github.com/yareally/Java7-on-Android (small guide I set up to explain how to add all the features above)

[2] https://github.com/orfjackal/retrolambda

Zigurd|12 years ago

You have cause and effect backward. Oracle created a hostile environment for developing Java as an Android language.

Secondly, Android's base classes and AIDL are a significant advance in Java.