[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Java Virtual Machine A Meme?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 58
Thread images: 2

File: JVM_on_top_of_OS-Crunchify-Tips.jpg (22KB, 510x303px) Image search: [Google]
JVM_on_top_of_OS-Crunchify-Tips.jpg
22KB, 510x303px
Is Java's reputed portability overrated? Is Java's 'Write-Once-Run-Anywhere' not trivially better than C's 'Write-Once-Compile-Anywhere'?
>>
>>58039617
>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 /g/!
>>
>>58039617
>t. undergrad

Java has HORRIBLE portability. It's a fucking nightmare getting it to run on different systems or even different OS's.
>>
>>58039617
>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.
>>
>>58040010
>What is JNI?
>>
>>58039997

>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 /g/ can come up with
>>
>>58039617
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.
>>
>>58040031
https://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).
>>
>>58040062
Which is a solution to your exact problem of low level, platform specific calls.
>>
>>58040042
>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.
>>
>>58040078
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)
>>
>>58040109
you can write jni modules to implement the platform specific functionality you need
>>
>>58040109
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.
>>
>>58040042
>Java's portability far exceeds C

As most Java runtimes are written in C/C++, I find that difficult to believe.
>>
>>58040228
>I have experience with neither
>>
>>58040228
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.
>>
>>58039617
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.
>>
>>58040258
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
>>
>>58039617
>C's 'Write-Once-Compile-Anywhere'
Hahahahaha. Never happens in reality.
>>
>>58039617
>Write-Once-Compile-Anywhere
Write-Once-Trying-To-Cover-All-Edge-Cases-Compile-Anywhere-Then-Go-Back-And-Repeatedly-Fix-Platform-Specific-Bugs
ftfy
>>
>>58039617

>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 /g/ 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 :
https://m.youtube.com/watch?v=QM1iUe6IofM
>>
>>58042002
so you want to write code without considering its design and architecture first?
>>
Golang is about 95% platform independent.

It also gets you laid.
>>
>>58042230
golang has abhorrent syntax

also why the fuck does the import statements use quotes?
>>
>>58042097
Yes. Most production code is written that way because it increases job security.
>>
>>58042230
>>58042308
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
>>
>>58042002
>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
>>
>>58041849
/g/ never knows what its talking about
>>
>>58039617
>'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.
>>
>>58044640
>More like have your coffee monkeys write it once
Well, too bad if you already fail so hard on the first step
>>
>>58044640
So what's your language?
>>
>>58042002
Thanks for your insightful advice NEET
>>
>>58043094
kek
>>
>>58039617

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

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

>>58040031
A waste of time. Modern JVMs will be able to JIT compile more effecient native code than 95% of C/C++ programmers on /g/. 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.

>>58040420
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.
>>
>>58042002
but python is oop
>>
>>58045742
psst
>>
>>58045619
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
>>
File: maxresdefault.jpg (66KB, 1280x720px) Image search: [Google]
maxresdefault.jpg
66KB, 1280x720px
>>58040042
>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!
>>
>>58040228
>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?
>>
>>58047360
>Oop is the reason our computers become more powerful
Do people actually believe this?
>>
>>58047944
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.
>>
>>58039617
JVM = Java Virtual Meme
>>
>>58047360
OOP is the reason you can't load a web page anymore without 16 GiB of RAM
>>
>>58047995
wew, my lad
>>
>>58039617
Would it be possible to have a Java container at some point?
>>
>>58039617
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
Thread posts: 58
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.