News for hackers. Stuff that matters.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by EpicEng on Thursday October 10, 2013 @12:45AM (#6525692)
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.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by fizx on Thursday October 10, 2013 @02:00AM (#6525909)
"There are only two kinds of languages: the ones people complain about and the ones nobody uses." -- Bjarne Stroustrup
Re:If Java Is Dying, It Sure Looks Awfully Healthy by JanezStupar on Thursday October 10, 2013 @05:49AM (#6526594)
Bjarne Stroustrup has no right of saying anything regarding language implementation and validity of users complaints.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by wsc981 on Thursday October 10, 2013 @06:06AM (#6526632)
This (admittedly fake) interview with Bjarne always makes me smile: http://artlung.com/smorgasborg/Invention%5Fof%5FCplusplus.sh...
Re:If Java Is Dying, It Sure Looks Awfully Healthy by Tloewald on Thursday October 10, 2013 @06:38AM (#6526697)
It's a shame it focuses on OO as the main problem with C++.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by CmonDev on Thursday October 10, 2013 @09:58AM (#6527687)
I think it's targeted at non-GUI developers. I'd like to see a purely functional GUI framework.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by bloodorange on Thursday October 10, 2013 @06:15AM (#6526648)
Could 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).

Re:If Java Is Dying, It Sure Looks Awfully Healthy by JanezStupar on Thursday October 10, 2013 @07:03AM (#6526757)
Sure.

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."

Re:If Java Is Dying, It Sure Looks Awfully Healthy by pjmlp on Thursday October 10, 2013 @07:36AM (#6526852)
> While systems programmers are fleeing from C++ back to C ...

Really?

GCC is now developed in C++.

Clang is developed in C++.

Mac OS X I/O Kit makes use of a C++'s subset.

Windows drivers can be done in C++ since Windows Driver Kit 8, while most new native APIs since Vista are COM based. With Microsoft only supporting enough C99 to comply with C++11/14, while helping porting FOSS C projects to Windows.

OS/400, BeOS and Symbian make use of C++ on the kernel.

Many new NoSQL databases are done in C++.

I see the C usage actually decreasing.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by Someone on Thursday October 10, 2013 @07:52AM (#6526905)
"While systems programmers are fleeing from C++ back to C(!!!)"

Example? I know of new developments in systems programming written in C++ (LLVM, clang, WebKit, FireFox (or did that start in C?)), I know of some that moved from C to C++ (gcc, maybe FireFox), I know of new developments in C (Linux, git), but I not aware of any system going from C++ to C. They may exist, but I would need more than a few examples to be convinced of the existence of a general trend.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by hershel on Thursday October 10, 2013 @08:22AM (#6527025)
Example: microcontrollers and embedded systems.

Some time ago there was a shift towards c++,but a large percent are returning back to c.

That's what i recall from surveys from UBM, the company that runs eetimes.com .

Re:If Java Is Dying, It Sure Looks Awfully Healthy by Someone on Thursday October 10, 2013 @11:15AM (#6528166)
Looking at http://images.content.ubmtechelectronics.com/Web/UBMTechElec..., I can see where that argument comes from. Looking solely at the C++ data across the years, slides 20 and 21 can be seen as indicators that C++ peaked in 2011. If that's the case, however, C peaked in 2012.

Also, for C, there seem to be fewer 'next' projects than 'current' projects, while for C++ those numbers are about equal.

Extrapolating like mad on almost no data, one could argue that C is on the way out in favour of Python, Java, and C#.

.Net is on the decline, though, so there either must be tremendous growth in the use of Mono in embedded software, or that data must be taken with a grain of salt. My money is on the latter, but surprise me.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by EpicEng on Thursday October 10, 2013 @01:59PM (#6529145)
I'm a systems guy and I love C for its simplicity. There certain problem domains which C++ is better suited for, but everything being equal, I'll chose C every time for its simplicity (don't give me the whole "shoot your foot off" argument. I know, but this is not much of an issue for experienced and competent C devs)
Re:If Java Is Dying, It Sure Looks Awfully Healthy by frankzinger on Thursday October 10, 2013 @07:01AM (#6526754)
He didn't say anything about the validity of complaints.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by JanezStupar on Thursday October 10, 2013 @07:13AM (#6526775)
In so many words he is saying:

"People complain about my language, because they use it. If it wasn't good (enough) they would not have used it."

Thus the complaints are relegated from feedback to proof that the choices made were right thus invalidating complaints.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by frankzinger on Thursday October 10, 2013 @09:49AM (#6527615)
So by not changing X they are automatically and implicitly disagreeing with any complaints referring to X? You're reaching.

EDIT: In case my point wasn't apparent, the language is under active development by an open, international standardisation committee, of which Stroustrup is an active and prominent member. They are well aware of the complaints, but the problem is that every change involves a tradeoff, and sometimes that tradeoff is just not worth it.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by taspeotis on Thursday October 10, 2013 @01:03AM (#6525738)
> and don't get me started on Objective-C..

    itsNotTheLanguagesFaultPerSe:butIfTheFunctions:andTheirParameters:werentNamedLikeThis:itWouldBeBearable
Re:If Java Is Dying, It Sure Looks Awfully Healthy by shaggyfrog on Thursday October 10, 2013 @01:15AM (#6525768)
I 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).

Re:If Java Is Dying, It Sure Looks Awfully Healthy by nitrogen on Thursday October 10, 2013 @02:10AM (#6525947)
In 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.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by epsylon on Thursday October 10, 2013 @05:30AM (#6526523)
The book 21st century C talks about that trick:

http://books.google.fr/books?id=_EdbrocXX9MC&lpg=PA183&ots=D...

Re:If Java Is Dying, It Sure Looks Awfully Healthy by j_s on Thursday October 10, 2013 @11:41AM (#6528290)
Re:If Java Is Dying, It Sure Looks Awfully Healthy by jasonlotito on Thursday October 10, 2013 @08:40AM (#6527103)
> 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.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by ronaldj on Thursday October 10, 2013 @01:48AM (#6525870)
I love named arguments. I wish my programming language of choice had them.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by eonil on Thursday October 10, 2013 @04:39AM (#6526377)
You should I this code.

    langFaultFuncParamNameWBB()
Re:If Java Is Dying, It Sure Looks Awfully Healthy by bad_user on Thursday October 10, 2013 @05:19AM (#6526485)
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.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by RivieraKid on Thursday October 10, 2013 @06:16AM (#6526650)
> 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.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by bad_user on Thursday October 10, 2013 @08:20AM (#6527016)
We'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.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by RivieraKid on Thursday October 10, 2013 @06:55PM (#6530533)
wtf?
Re:If Java Is Dying, It Sure Looks Awfully Healthy by James_Duval on Friday October 11, 2013 @07:43AM (#6532468)
I think that they are saying that Scala is the proverbial bread being offered to you, and your concerns about productivity are akin to insisting that your bread be soaked so that it's easy to eat.

If that is what they're saying, I disagree with them.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by wting on Thursday October 10, 2013 @08:17AM (#6527007)
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.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by geebee on Thursday October 10, 2013 @01:06PM (#6528800)
Unfortunately, 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.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by snambi on Thursday October 10, 2013 @01:10PM (#6528829)
when 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.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by EpicEng on Thursday October 10, 2013 @01:56PM (#6529127)
I'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
Re:If Java Is Dying, It Sure Looks Awfully Healthy by qwerta on Thursday October 10, 2013 @05:07AM (#6526456)
> Android ... essentially force you to use Java

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

Re:If Java Is Dying, It Sure Looks Awfully Healthy by levosmetalo on Thursday October 10, 2013 @08:36AM (#6527085)
>> 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.

Re:If Java Is Dying, It Sure Looks Awfully Healthy by qwerta on Thursday October 10, 2013 @09:46AM (#6527599)
Xtend, Haxe and Kotlin works just fine.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by pgcsmd on Friday October 11, 2013 @04:24AM (#6531965)
FWIW: I really like Java. C and Lisp would be the other languages I'm especially fond of.
Re:If Java Is Dying, It Sure Looks Awfully Healthy by CmonDev on Thursday October 10, 2013 @09:44AM (#6527591)
"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!

Re:If Java Is Dying, It Sure Looks Awfully Healthy by EpicEng on Thursday October 10, 2013 @01:52PM (#6529093)
Hehe, I'm a systems guy, don't write much code which targets either. I try to stay up to date though.