News for hackers. Stuff that matters.
Re:Go best practices, six years in by incepted on Sunday May 01, 2016 @11:44PM (#11609091)
> 4. Who really cares about cross-platform code if all I do is on Linux?

Most developers write their code on Windows and MacOS and then deploy on Linux. I'd say this "Write once run anywhere" thing was and still is a pretty big deal.

> 5. Why does this program require 4GB of ram?

Oh no! I need to buy a $5 piece of hardware to run this Java code? What kind of nonsense is that?

> 6. Must I really download and install the JVM all the time, and what is it good for anyway?

Once or twice a year, if you really want to. You update your browser much more often.

Re:Go best practices, six years in by throwaway_exer on Monday May 02, 2016 @01:04AM (#11609285)
> Oh no! I need to buy a $5 piece of hardware to run this Java code? What kind of nonsense is that?

4 GB per program absolutely destroys VM consolidation. I love the look on managers' faces when they ask for a 1 GB VM and I ask them, "Is this for a Java program?" :)

Re:Go best practices, six years in by nixusg on Monday May 02, 2016 @01:44AM (#11609396)
Just adding some ram is also not so easy in an embedded system.
Re:Go best practices, six years in by Hydraulix989 on Monday May 02, 2016 @02:39AM (#11609537)
But the Java JRE update installer wizard for Windows touts the fact that Java is "in" thousands of embedded systems -- parking meters, toasters, etc.
Re:Go best practices, six years in by threeseed on Monday May 02, 2016 @06:31AM (#11610363)
There are dozens of Java VMs some of which are optimised for embedded systems:

https://en.wikipedia.org/wiki/List_of_Java_virtual_machines

Re:Go best practices, six years in by dig1 on Monday May 02, 2016 @04:34AM (#11609984)
Imagine, Java is run on your phone's SIM card. Enough?

On other hand, on truly constrained embedded systems where real time is essential, no GC-based language has any business, no matter how GC is good. Even C++ is sometimes avoided.

Re:Go best practices, six years in by pjmlp on Monday May 02, 2016 @07:10AM (#11610481)
You mean like missile radar control systems?

http://www.pr.com/press-release/136232

Or do you prefer Aegis battleship Weapons System ?

http://dl.acm.org/citation.cfm?id=2402699

These are my favorite examples for Java being used in life critical situations.

Re:Go best practices, six years in by geodel on Monday May 02, 2016 @09:44AM (#11611230)
Well 2 thing stand out for me from links you mentioned:

> The applications use a combination of Thales proprietary middleware written in C combined with Java code enabled by the Java™ Native Interface (JNI).

> AONIX has additionally delivered professional services to help PERC Ultra users at Thales optimize their applications and improve execution performance including, a customer-specific training course handled the needs of coding in Java™ with hard real time constraints.

Seems like with helping of C and Consulting on 'How to do Java right' they made it work.

> End-to-end distributed thread timing constraints measured from stimulus to response are typically under 100 ms.

Since it is slightly faster than typical (per char) typing speed on keyboard. It appears nice but terribly impressive real time Java use case.

Re:Go best practices, six years in by pjmlp on Monday May 02, 2016 @10:26AM (#11611609)
For me it is impressive, because if the system doesn't work, the wrong guys die.
Re:Go best practices, six years in by frankzinger on Monday May 02, 2016 @09:51AM (#11611291)
> Imagine, Java is run on your phone's SIM card. Enough?

Not Java, not even close. JavaCard is an extremely stripped-down version of Java. I've used it and it feels like C.

From https://en.wikipedia.org/wiki/Java_Card#Java_Card_vs._Java:

> However, many Java language features are not supported by Java Card (in particular types char, double, float and long; the transient qualifier; enums; arrays of more than one dimension; finalization; object cloning; threads). Further, some common features of Java are not provided at runtime by many actual smart cards (in particular type int, which is the default type of a Java expression; and garbage collection of objects).

[EDIT] But I am not arguing with the overarching argument that Java proper can run efficiently on very constrained devices. It all depends on the implementation.

Re:Go best practices, six years in by m_mueller on Sunday May 01, 2016 @11:49PM (#11609104)
> What kind of nonsense is that?

.. and then someone gets the idea that your application should now run natively on Android phones, since they all run Java anyway, right?

Re:Go best practices, six years in by incepted on Sunday May 01, 2016 @11:51PM (#11609112)
Yes, they all run Java.

What's your point?

Re:Go best practices, six years in by frankzinger on Monday May 02, 2016 @12:03AM (#11609139)
I'm guessing his point is that "4 GB" is a big problem on a phone.
Re:Go best practices, six years in by incepted on Monday May 02, 2016 @12:07AM (#11609150)
Yes it is, but his number was an exaggeration in the first place.

There are hundreds of millions of phones running Java today, what does that tell you?

Re:Go best practices, six years in by m_mueller on Monday May 02, 2016 @01:28AM (#11609346)
The point is that memory still matters, not that Java is inherently a problem. You're shifting the goalpost here - earlier your claim was that 4GB is not a big deal since we can just buy more memory, now it's that 4GB is a ridiculous number anyway.

It's not if you meet one of these typical "don't do any premature optimisations (even in the design phase of my data structures), because some important CS person said so"-designs. There's all too many programmers who think they should never have to care about hardware anymore.

Re:Go best practices, six years in by viraptor on Monday May 02, 2016 @01:30AM (#11609349)
> Once or twice a year, if you really want to.

I really hope you actually mean 7+ times a year. https://en.wikipedia.org/wiki/Java_version_history#Java_8_up... - most versions contained security updates.

Re:Go best practices, six years in by incepted on Monday May 02, 2016 @02:51AM (#11609571)
None of these updates are mandatory. You don't have to upgrade anything if you don't want to.
Re:Go best practices, six years in by viraptor on Monday May 02, 2016 @03:06AM (#11609624)
If you looked at the issues and verified they're either not applicable in your case or don't affect your application, you already spent a lot of time on it. If you do install, you should verify your app still works. If not, you already spent time on analysis. The actual installation time is next to nothing compared to everything else around the "new jre came out" event.

What I'm saying is - you should care 7+ times a year. Doesn't matter if you only update twice.

Re:Go best practices, six years in by goodplay on Monday May 02, 2016 @12:15AM (#11609166)
> Oh no! I need to buy a $5 piece of hardware to run this Java code? What kind of nonsense is that?

Funny. That's Microsoft line of thought with Vista.