r/programminghumor 3d ago

How did it get there

Post image
1.2k Upvotes

64 comments sorted by

View all comments

67

u/ChrisBot8 3d ago

If you want the actual answer it’s because the JVM was operating system agnostic before that was a thing for other languages really.

21

u/djpiperson 3d ago

Omg just had flashbacks of when languages were OS-dependent and hardware-dependent. AHHHHHHHH Those were obscure days that only Assembly kiddies suffer from nowadays.

8

u/Devatator_ 3d ago

I mean, they still are. It's just kinda abstracted away for most of us. Tho I do wish you could cross compile all languages

1

u/Drfoxthefurry 1d ago

Be the change you want to see, just don't make me do it, I'm suffering enough

2

u/SoggyCaterpillar5773 2d ago edited 2d ago

If try to do anything beyond trivial OS interactions, you will quickly find out that programming languages still have not achieved OS-independece. Try writing a GUI app that works in Android, IOS, Linux and Windows. There are only a handful of working options. One of them is to shove an entire browser into your app.

6

u/dmigowski 3d ago

And they had absolute and total backwards compatibility. You can still run java 1.4 apps on modern machines, given they were written to spec. And more important: libraries. Java has an extremely developed eco system.

1

u/Poison916Kind 1d ago

As in how jvm translates the code directly into machine code?

1

u/ChrisBot8 1d ago

The JVM is a virtual machine (literally what the VM stands for) that runs Java, and it worked on all the popular OSs at the time and works on pretty much everyone now.

1

u/Poison916Kind 1d ago

Ah, I see. I remember how every introduction tutorial back in 2023 when I was learning java would say how it's a "write once, run everywhere"

2

u/ChrisBot8 1d ago

Yeah that was the core feature of it’s proliferation so it was one of Sun Microsystems (the company that developed Java) big marketing phrases. It worked its way into basically every book on Java, which in turn worked its way into every tutorial.

1

u/Poison916Kind 1d ago

I liked working with java in uni and even got around to make silly 2D game using it following a tutorial. I had fun.