by zainny · 13y ago · 0 comments
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.
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.
I find that he is in a good position to do so because C++ evolved based on feedback from people using it and he was responsible for the first version(s).
itsNotTheLanguagesFaultPerSe:butIfTheFunctions:andTheirParameters:werentNamedLikeThis:itWouldBeBearableI shed a small tear every time I have to call a C API with and endless parade of (NULL, NULL, 0, NULL).
That's because you get it inline for you with Xcode's autocomplete. IDEs do this for other languages, and the effect is the same.
langFaultFuncParamNameWBB()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.
Exactly. I'm pretty sure that switching to something like Scala wouldn't improve my productivity.
Fuck dude. You're a developer. If you want productivity, make shit happen.
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.
However, a recent coursera course on Data Structures and Algorithms used Java, and I really didn't mind it at all. I'd even say I found it reasonably pleasant to use Java.
IMHO its the only language that allows to create great server side programes, awesome desktop GUI applications, mobile applications or embedded applications. All in one language.
You can use many languages which compile down to Java Byte code.
> You can use many languages which compile down to Java Byte code.
And then you end up with subpar performance and application size :(
I had high hopes for Mirah for Anrdoid development few years ago, but it unfortunately fade away. It was basically Ruby like language that compiled down to pure java bytecode without a need for any runtime. That would fit Android perfectly.
But the combination of iOS and Android gently pushes you in the Mono/F#/C# direction. Come to the light side!
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.
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.
Personally I really like Java - coming from a C++ developer (11 years in the games industry). I wouldn't mind working with it everyday...
Dalvik is not. It can't run java classes compiled with a regular java compiler
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.
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.
Sun just did not sue them, because they lacked the money. James Gosling confirmed this.
> 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
- Strings in switch
- Try with resources
- Multiple exceptions in catch
- Simplified IO
- Diamond type inference
- invoke dynamic optimizations
Any Java library targeted for Java 7, even without the new language features, is also not usable in Android projects, because Dex cannot understand the new Java 7 bytecodes.
Google is a corporation like any other.
Diamond type inference is cute, but hardly important. You could do the same thing with a save macro in your IDE.
Try with resources is about the only thing in that list that would be actually useful in Android.
> Any Java library targeted for Java 7, even without the new language features, is also not usable in Android projects, because Dex cannot understand the new Java 7 bytecodes.
So target Java 6 if you're making a library. Which is what people do anyway, because not everyone has immediately jumped to 7.
And none of them will run on J2ME which Sun/Oracle never upgraded past 1.3 for Pete's sake. If not upgrading Java was worthy of a lawsuit, we should be class action'ing the hell out of Oracle for the crime against humanity that was J2ME.
BlackBerry was also 1.3 right up until the end.
Android right now is only using a version of Java that's ~1 year out of date. That's still a shitload better still than Sun ever managed to do on mobile.
> Google is a corporation like any other.
Cows go moo.
Saying irrelevant facts is fun! You're on to something here I think.
- 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)
Thanks for the tips, though.