6 ms·
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 tod
by zainny 13y 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.
- EpicEng 13y agoPopular 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.
- taspeotis 13y ago> and don't get me started on Objective-C.. itsNotTheLanguagesFaultPerSe:butIfTheFunctions:andTheirParameters:werentNamedLikeThis:itWouldBeBearable
- shaggyfrog 13y agoI find the descriptive nature of method signatures to be quite delightful. Unlike other languages like C++, I don't always have to go looking for the function definition to see the types of the parameters it takes, and what exactly was the order again? Combined with Xcode's autocomplete, it saves a lot of time. I shed a small tear every time I have to call a C API with and endless parade of (NULL, NULL, 0, NULL).
- nitrogen 13y agoIn C99 it's possible to use compound literals to implement something like named parameters. You create a struct with all of your parameters, and only include the ones you want to set in the compound literal. Anything not explicitly specified in the compound literal gets set to 0, so the caveat is that 0 can't be a valid value for your parameters.
- epsylon 13y agoThe book 21st century C talks about that trick: http://books.google.fr/books?id=_EdbrocXX9MC&lpg=PA183&ots=D8EhqfWRSU&pg=PA183#v=onepage&q&f=false http://books.google.fr/books?id=_EdbrocXX9MC&lpg=PA183&ots=D...
- j_s 13y agoSwitch .fr to .com: http://books.google.com/books?id=_EdbrocXX9MC&lpg=PA183&ots=D8EhqfWRSU&pg=PA183#v=onepage&q&f=false http://books.google.com/books?id=_EdbrocXX9MC&lpg=PA183&ots=...
- jasonlotito 13y ago> I don't always have to go looking for the function definition 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.
- ronaldj 13y agoI love named arguments. I wish my programming language of choice had them.
- lmacsen 13y agoNamed arguments are very descriptive and intuitive. And yes, Xcode auto-complete is awesome.
- deleted 13y ago[deleted]
- eonil 13y agoYou should I this code. langFaultFuncParamNameWBB()
- fizx 13y ago"There are only two kinds of languages: the ones people complain about and the ones nobody uses." -- Bjarne Stroustrup
- JanezStupar 13y agoBjarne Stroustrup has no right of saying anything regarding language implementation and validity of users complaints.
- wsc981 13y agoThis (admittedly fake) interview with Bjarne always makes me smile: http://artlung.com/smorgasborg/Invention%5Fof%5FCplusplus.shtml http://artlung.com/smorgasborg/Invention%5Fof%5FCplusplus.sh...
- bloodorange 13y agoCould you substantiate your statement please. 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).
- JanezStupar 13y agoSure. Nowadays the consensus is that C++ introduced more problems into the industry than it solved. Moreover it keeps introducing more and more problems with each new revision. In this light his statement is merely an attack upon his critics e.g. "Haters gonna hate..." while ignoring the possibility that criticism of "his" programming language is well founded. Sure people bitch about every language sometimes. Hell I bitch about languages I use now and then, but I keep using them. While systems programmers are fleeing from C++ back to C(!!!) and to newer languages like Go (for which the core design principle could be described as "Not C++"). To me his statement sound like a chronic alcoholic saying "There are only bad kids and kids you don't have."
- qwerta 13y ago> Android ... essentially force you to use Java You can use many languages which compile down to Java Byte code.
- levosmetalo 13y ago>> Android ... essentially force you to use Java > 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.
- qwerta 13y agoXtend, Haxe and Kotlin works just fine.
- bad_user 13y agoI 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.
- deleted 13y ago[deleted]
- RivieraKid 13y ago> The development experience may not be as great as when using Java Exactly. I'm pretty sure that switching to something like Scala wouldn't improve my productivity.
- bad_user 13y agoWe've got a parable in our country about a lazy bastard, that couldn't do anything out of laziness to the point of dying from hunger. One day a woman offers to help him, to give him shelter and food. To which the lazy man asks in response ... will you soak my bread? (sounds much better in Romanian) Fuck dude. You're a developer. If you want productivity, make shit happen.
- 13y ago
- wting 13y agoJava is a commonly used language, but not very popular according to a Hacker News poll from 2012: https://i.imgur.com/toGKy21.jpg 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.
- geebee 13y agoUnfortunately, most of these polls don't really talk about the context. I don't think I've ever been as unhappy as a developer (in terms of the tools) as when I was required to use Spring, Hibernate, Eclipse, and so forth to do web development. There was absolutely no reason we couldn't be using Rails or Django for our needs - this was a top down management situation, and I'm sure my political frustrations contributed to my unhappiness. 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.
- snambi 13y agowhen it comes to large, complex, distributed, long-living projects, java is the best choice. sure, I can build a quick prototype using python, php, node, ruby, its hard to rely on them when the project becomes large, distributed, complex etc. 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.
- EpicEng 13y agoI'll agree there of course; as an ecosystem it's hard to match due to the availability of libraries and ease of platform swapping. My original comment was targeted purely at the language syntax and semantics. Like I said, there are many reasons to use Java, but I'd rather use something else given the choice
- CmonDev 13y 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!
- EpicEng 13y agoHehe, I'm a systems guy, don't write much code which targets either. I try to stay up to date though.
- pgcsmd 13y agoFWIW: I really like Java. C and Lisp would be the other languages I'm especially fond of.
- pjmlp 13y 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 13y 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.
- pjmlp 13y ago> That's because Oracle has been suing them over it. ... 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.
- buster 13y agohttp://www.wired.com/wiredenterprise/2012/04/schwartz/ http://www.wired.com/wiredenterprise/2012/04/schwartz/
- BlarfWobble 13y agoAndroid 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 13y agoI 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...
- BlarfWobble 13y agoI didn't mention the word Oracle. Kaffe is still a JVM! It runs java applications unchanged. Dalvik is not. It can't run java classes compiled with a regular java compiler
- RivieraKid 13y agoIf 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.
- eranation 13y agoI actually wrote an essay about this few months ago, Android was indeed one of my major points: https://medium.com/i-m-h-o/da3b2c180e9c https://medium.com/i-m-h-o/da3b2c180e9c (Why Java Is Still Relevant)