Java Virtual Machine A Meme?

Is Java's reputed portability overrated? Is Java's 'Write-Once-Run-Anywhere' not trivially better than C's 'Write-Once-Compile-Anywhere'?

Other urls found in this thread:

en.wikipedia.org/wiki/Java_Native_Interface#Pitfalls
m.youtube.com/watch?v=QM1iUe6IofM
twitter.com/SFWRedditGifs

>Corporate apps that only work with one very specific outdated version of Java

They tried and they fucked it up. .NET Framework just werkz in comparison.

>Few users with any comp sci knowledge
C'mon Sup Forums!

>t. undergrad

Java has HORRIBLE portability. It's a fucking nightmare getting it to run on different systems or even different OS's.

>Is Java's reputed portability overrated?
Yes. Even if you can get your Java shit to run on the target environment, chances are it

1. won't work due to platform-specific I/O calls
2. even if it works, it will feel like out-of-place shit due to bad platform integration

It's an enterprise lie that they shovel feed dumb and impressionable young people to recruit them into their cults.

>What is JNI?

>Java has HORRIBLE portability

Java's VM is hard to port, but once its up its libraries are universally portable across vm implementations, unlike C libs

>Java's 'Write-Once-Run-Anywhere' not trivially better than C's 'Write-Once-Compile-Anywhere'

unless you're using an esoteric non-commodity computer or embedded system Java's portability far exceeds C

Java is generally a crap platform but it runs more reliably on more PCs than any other major language no matter how many pajeet memes Sup Forums can come up with

JVM is the one and ONLY reason this piece of absolute SHIT of a language has any popularity whatsoever. Goddamn I hate Java, it's the biggest pain in the dick to write code for.

en.wikipedia.org/wiki/Java_Native_Interface#Pitfalls
>An application that relies on JNI loses the platform portability Java offers (a partial workaround is to write a separate implementation of JNI code for each platform and have Java detect the operating system and load the correct one at runtime).

Which is a solution to your exact problem of low level, platform specific calls.

>Java is generally a crap platform but it runs more reliably on more PCs
Well I don't know about you, but in practice everything runs on my system except Java.

I'm serious. If you write your shit in C, C++, Python, Ruby, Perl, Haskell, Tcl, JavaScript, Rust, Go, Prolog, PHP, .NET, Mercury, Lua, R, FORTRAN, OCaml, Nim, Julia, Idris, Smalltalk, Forth or Erlang, I would be capable of running it on my system.

If you use Java, I wouldn't. But to be fair, that's only partly because of how annoying it is to get OpenJDK packaged properly, but rather, it's mostly because there's not a single Java-using program that justifies the effort.

I put in the effort of getting a JVM to run when there exists a piece of software that's not absolute dogshit which requires it. Not having a JVM is actually a very good shield against crapware.

Are you aware that this is a thread about Java portability issues? Maybe I need to spell out my argument more clearly for you. The problem with the JVM portability hoax is that you either

1. Gain portability but give up the ability to have platform-specific I/O calls and low level integration (my second point)

-or-

2. Gain platform-specific I/O calls and low-level integration but lose portability (my first point)

you can write jni modules to implement the platform specific functionality you need

What part of JNI addresses this exact issue do have trouble comprehending?
If you want to use a language providing portability across vastly different platforms then of course you are giving up low level calls but JNI addresses it should you still need them in your implementation.

Are you arguing for the sake of arguing or from experience? I write software for embedded devices in Java so I'm exposed to this issue very well.

>Java's portability far exceeds C

As most Java runtimes are written in C/C++, I find that difficult to believe.

>I have experience with neither

What does that have to do with anything?
Programs that you write in Java are far more portable than what you'd realistically write in C.

It works, you autists.

If you had a real job in the industry, you'd knew that Java is the corporate default option for a reason.

Let's even say that java is portable (is not). In an enterprise environment you have some big servers with specific operating systems, not a mix of a lot of different OS, so portability is worthless. Instead when a ton of servers are involved, the big cost is electricity, that's why Amazon is moving away from scripting languages for managing their services. They waste cpu resources that means energy waste = money waste.

if you only use the standard libraries, stl and boost and avoid any system apis I bet a c++ program would be more portable than a java one especially with the new features from c++11, 14 and 17

>C's 'Write-Once-Compile-Anywhere'
Hahahahaha. Never happens in reality.

>Write-Once-Compile-Anywhere
Write-Once-Trying-To-Cover-All-Edge-Cases-Compile-Anywhere-Then-Go-Back-And-Repeatedly-Fix-Platform-Specific-Bugs
ftfy

>Write-Once-Run-Anywhere

Doesn't run on iOS
Doesn't run on Windows Phone
Doesn't run on PS4
Doesn't run on Xbox One
Doesn't run on WiiU

Well, I've run Java on old IBM AS400 systems, small embedded systems with RISC processors, and dozens flavors of linux and even OSX.

There's quite literally never been a problem doing so.

What the hell is Sup Forums talking about?

Dont use Java or any OOP language
Use C or python.

Why you shouldnt use java?
Because it makes you think a lot about designing them classes and interfaces and pondering the relationships between them before you even start writing code and even while writing code.
Listen to this talk :
m.youtube.com/watch?v=QM1iUe6IofM

so you want to write code without considering its design and architecture first?

Golang is about 95% platform independent.

It also gets you laid.

golang has abhorrent syntax

also why the fuck does the import statements use quotes?

Yes. Most production code is written that way because it increases job security.

It also has abhorrent semantics, a terrible type system, zero abstraction and a fucking garbage collector in a language meant to be low level

Go is the dumbest piece of shit language I've ever had the misfortune of coming into contact with. It's literally less useful than PHP

>Because it makes you think a lot about designing them classes and interfaces and pondering the relationships between them

People did something like that before Java even existed.

Write Once, Run Away

Sup Forums never knows what its talking about

>'Write-Once-Run-Anywhere'
More like have your coffee monkeys write it once, and realize the constraints the language and its shitty yet somehow overengineered libraries put on the code has resulted in some of the ugliest shit ever.

Then spend a few weeks refactoring it, building the right abstractions around the wrong ones, only to realize that there's now so much custom code that achieving decent test coverage is going to take months.

And don't start fucking deluding yourself --- you probably need as many tests for Java as for any hipster dynamic language because its type system has a gigantic hole called the null reference. And you have several times the code to test AND the library docs are auto-generated shit from around the year 2000.

Then, after months, you finally have a working application you can deliver. And you realize you're going to pay 3x the money for the virtual servers because of the massive library stack's memory requirements. The customer probably doesn't want to hear of this after all the delays, but someone has to tell them.

>More like have your coffee monkeys write it once
Well, too bad if you already fail so hard on the first step

So what's your language?

Thanks for your insightful advice NEET

kek

def overrated.

at the end of the day the most sensible thing is to bundle the runtime with the application to avoid having the used forced to install a jvm as well.

to be honest just use electron for desktop apps.

> Goddamn I hate Java, it's the biggest pain in the dick to write code for.

If you have pain writing Java, odds are you're a real, actual retard.

It's the best VM out there. It supports large amount of operating systems and platforms and is very efficient these days. Even if you hate Java you can still use JVM with Scala, Kotlin, Clojure etc.

A waste of time. Modern JVMs will be able to JIT compile more effecient native code than 95% of C/C++ programmers on Sup Forums. Not to mention that every JNI call will have large overhead due to JVM having to jump through some hoops to provide the API needed by JNI code.

You're going to have very limited programs if you stick to those rules. Not to mention that few versions ago you coudn't do basic stuff like multithreading in C++ without platform-specific APIs.

but python is oop

psst

Agreed that its generally better to just stick to Java code and optimise for performance but the argument was to use JNI to facilitate low level, platform specific calls and its a perfectly viable solution to that problem.

Java sucks, I'll elaborate soon
But C is not really more portable than shess scripting. It is possible to write portable C and it would be desirable, or even C code that depends on a few well known libraries.
But for some reason it's often filled with #ifdef's all over. C is not portable beyond the simplest programs (which is what ought to be done in C anyway).

Now, Java is allegedly a "High Level Language", right? and somehow it very much resembles C++. It runs atop a virtual machine, and yet it provides almost no abstraction whatsoever. Writing Java, you have to specify all sorts of useless details.

There are many languages that don't emulate such a low level language on such a high level environment, which is a waste.
Besides, it's a really shitty language.

There are now a zillion languages that have all the potential portability of Java and more without so many stupid idiosyncracies and low-level details

>unless you're using an esoteric non-commodity computer or embedded system Java's portability far exceeds C

Go can run on any platform. I write small programs and compile them for arm and run them on my phone all the time.


It's doesn't have the horrible syntax of java, and it's much more powerful and expressive, and actually fun to write!

>hur durr im an idiot

Oop is the reason our computers become more powerful, shitty programmers cant deliver good code. Because unused ram is wasted ram rite?

>Oop is the reason our computers become more powerful
Do people actually believe this?

Every class doubles clock speed. The only reason Java doesn't allow multiple inheritance is because the computer would literally operate so fast, it would open a portal to a new dimension.

JVM = Java Virtual Meme

OOP is the reason you can't load a web page anymore without 16 GiB of RAM

wew, my lad

Would it be possible to have a Java container at some point?

Yes. But I would argue that Java's main strong point is that it's OO. But that has its pluses and minuses. DESU I like C over any sort of OOP, but to each his own.

Java is only popular because it's easy to learn so any kind of code monkey work in it

>but the JVM sucks!
>use containers and vm-like software for docker, vagrant, all requiring gigabytes of images