Java is the hero you need but don't deserve

...

Other urls found in this thread:

gnu.org/philosophy/open-source-misses-the-point.html
forum.qt.io/topic/5390/usb-communication-using-qt
info.qt.io/download-qt-for-application-development
github.com/Fazecast/jSerialComm
github.com/nyholku/purejavacomm
twitter.com/SFWRedditImages

Finally, today, you too, user, can experience the memory-leaking object-oriented nightmare that is Java. Prepare to have your mind boggled why a simple program would consume 2 GBs of RAM
Maybe when the average computer RAM becomes a terabyte or two Java would become good.

On the upside, it does taste good.

The first rule of optimization is "don't do it."
The entire first person shooter shown in this video is only 96 kilobytes.
But that would make your 4TB harddrive sad :(

*I shouldn't say the "entire first person shooter." That's wrong. It depends on a lot of libraries. But all the assets for it (textures, gameplay, sound, music, etc) are generated out of a 98kb executable

Java was good in its time and in theory it functions somewhat decently, but its application is just abhorrent, I remember in the class they were teaching us on how to use java they showed us week 2 how to cause memory leaks with the fucking thing and how to prevent it.

The only reason people should have to learn java is if they have to do maintenance on something that is dying. Which if you dig around is basically what people who learn java wind up doing.

That was made by demoscene guys. Not your average programming or programmers.

It was written in C++ though, as you know due to the virtual machine overhead in Java controlling the memory isn't as easy. It's really only good when memory isn't a concern, and in the OP, when you said it comes close to C in performance (as MANY language nowadays do easily) it's usually using a lot more memory. Other than Java being a big security hole, it also memory leaks like crazy, which means that your program which now runs fast, within a couple more minutes once it inflates to fill all of its allowed RAM will begin stuttering like crazy with the garbage collector cycles.


programmed in assembly where "it really counts"

Yeah, but since everything compiles to bytecode that runs on the JVM, they can keep fixing and optimizing the JVM, which is exactly what they're doing. It's slow going but they'll surely get there eventually if they just stick with it. Everything else about it is so gud that it's a wet dream, and so I'm investing in it. It also has awesome job security.

Intellij IDEA is the best Java IDE on the market.

...

Well actually a lot of the largest websites on the Internet run on Java, and a lot of them even switched to Java after running a maymay language. Twitter started with Ruby on Rails, they started having severe problems scaling up with it, so they switched to Scala on JVM.

JVM might never die but even in your own post you show that they used Scala, not Java.

It's all pretty much the same shit to the JVM. You can blend them freely.

Did you consider writing it in Rust?

...

...

Java is shit.
/thread

True it could be optimized a lot more, however sadly there are inherent limits to running within a virtual machine (though that is improving since even tiny ARM cortex M uCs can now get Java) and I doubt the RAM issues will fade away and become nothing more than a tale (like terrible music compression did) in less than 10 years. But if you're entering the professional Java market you must keep in mind you're competing with Pajeet, and Rajesh who are happy to work for half your wage. Your work could also be outsourced soon.
Just about every advantage you said could be accomplished by Python (qt5 uis are qt3.14 tbh) except speed, and it also of course isn't the lightest on memory, but it's more flexible and forgiving.

Python: You create a gun module, a gun class, a foot module and a foot class. After realising you can't point the gun at the foot, you pass a reference to the gun to a foot object. After the foot is blown up, the gun object remains alive for eternity, ready to shoot all future feet that may happen to appear.Java: You find that Microsoft and Sun have released imcompatible class libraries both implementing Gun objects. You then find that although there are plenty of feet objects implemented in the past in many other languages, you cannot get access to one. But seeing as Java is so cool, you dont care and go around shooting anything else you can find.

Java also makes mprotect and W^X crash your programs every two seconds because it decided to do something retarded with memory. This makes it nearly unusable on a secure OS.

so does java compile, no one really fucking explains shit

I really, really want to like Python but the fact is that I just hate all dynamically typed languages and think they are the worst idea to ever be conceived in language design.

It compiles to bytecode that runs on an abstract computer called a JVM. Your x86 or Android phone or whatever emulates the JVM and runs the application bytecode like you can emulate a Super Nintendo or Playstation and run roms on your PC.

That's why you have to do the "Download Java" thing that everyone hates. You're downloading the Java "emulator" aka "virtual machine" although I'm sure there's some distinction between emulators and virtual machines that I'm forgetting and someone will tell me that my analogy is shit.

so what compiles the bytecode the JDE? i had this friend of mine who thought the JVM compiles things

The javac tool. It goes .java (compiles to) .class (stored in) .jar. Javac is part of the JDK but I forget if it's also included in the JRE.

the JVM has a just-in-time compiler which targets the native architecture

On a miniscule fraction of the µarchs where there's a JIT.

You're not alone. C typing is perfect.

I totally agree with you. If you want an UI and cross-platform, Java is the best thing out there... until you try Lazarus or Delphi IDE

lmao they said that since day one which was at least 2000 years ago

Why not, you know, use the superior choice: C++?

Java is aight if you wanna cross-platform easily. And all the libs you need works on both. And speed is not a huge issue...

The usual look & feel is all fruity for me tho in Win10 :[ ,,, what is a GUI L&F that looks like win95? all the "popular" ones look like Win7/8 / Mac Lite
-except for Napkin, which set off my gaywad hipster alarm before the google images of it even finished loading


what sort of wizardry is this?

lol let's all laugh at the retard

oops
i was assuming GUI... because OP mentioned--
,,,
CLI programming does not count, for anything

You assumed correctly and cross-platform GUI programming in C++ is a nightmare.

...

Peeling off and eating your toe nails is easy too. :^D

are you fifteen years old? of course you should learn a number of languages and decide for yourself which one's best for a given project.
also, Java and .NET are both shit, lol at defending either for reasons other than "I am paid to work on projects that use them"

i'd argue that even if you are paid to work on them you should not defend those shit languages.

Hi /g/

Hi /neotech/

Contrived benchmarks are not "applications".

I wonder how pajeet shit on street while coding simultaneously, I guess that's how Java pOOP works in current year. Oh wait..OP is one of them, sad.

...

Wasn't there a GCC extension called gcj (or something like that) which compiled java code to native machine binary without the need for the JVM?

People should quit shitting on OOP. Java is not real OOP anyway. If Java is OOP why does it have primitives? Real OOP is smalltalk which is different than Java. Everything would be an object and objects communicate by passing messages.

nah, on /g/ the best languages are rust and lua, because that's what all the new game company startups are using
in a year it'll be some other new shit that will also disappear in a couple years and never be heard from again. just like those companies^^^
(xcept I think it was JAVA!!! for a while, because "CROSS-PLATFORM!!!" but at the speed of a cracked-out sloth. that trend didn't last long tho)

for making games from scratch, you learn C++/C#,,,,, because the Microsoft DirectX examples are all in that way (one or the other), and using Windows + Visual Studio + DirectX is the easiest way to play with all that stuff
but then again,
starting out modding is a lot more realistic. Making even a small 3D game is a *lot* of coding and modeling.

Fair enough.
dynamic typing is nice for scripting though

It'll never be really fixed just continually improved, it's a lot better now than it was before.

There's a special place in hell for the likes of you.

what is qt? never heard of it
---go to website
---"free trial" download
---$295 a month

im not exactly a poorfag, but that's.... not happening
if they close Visual Studio again, I'd probably just go buy a $500 Microshaft VS one-shot license just for my own hobby use

Notch made 2 billion+ from Minecraft, a game made in Java. Notch > Carmack in terms of money.

???????????? It's free as in freedom, user.
a-user the sh-showers are that way
n-never mind a-user I think I'll just use t-this l-luger here.
a-user you're a new tier of b-baka

but does it respect my freedoms?

...

Worth reading: gnu.org/philosophy/open-source-misses-the-point.html

...

C# is much better than Java, though. If C# wasn't Microsoft bullshit, I'd probably use it much more frequently.

...

Great! I will keep that in mind next time I have to do embedded programming, instead of writing everything in C and running the code directly on the hardware I will put a linux distro on it and write it in Java!

You also have Clojure and Scala on the JVM = more options, more libs

How many blows to the head did you receive between finding the free version of VS and being too retarded to find the free version of Qt?

I only went to the download page there, it just shows the paid version

my usual language for a long time was visual basic. it's easiest and fastest for me to use
the microsoft libraries and online help are comprehensive and organized, and visual studio IS the best IDE for Windows, hands down.

lately I was trying to port a VB serial-over-USB program to java, and it aint workin... because the only maintained java serial port library (RXTX) is 32-bit only, and windows is giving me the 32/64 bit error. the usual fixes don't work, and the only forked 64-bit port of RXTX was last updated in 2012, it appears.
the program is already done in VB, mind you.
re-doing it in java would only be worthwhile if it could run on both windows and linux.

and qt doesn't appear to do that either?--
forum.qt.io/topic/5390/usb-communication-using-qt
(plus note that most people asking about such topics are on Linux, not Windows)

looks like it might still be windows/vb.
oh well.

for some of us $500 isn't all that much. especially only every 2-3 years or whatever.

info.qt.io/download-qt-for-application-development
??
I haven't used Windows for anything other than vidya, and I've never used or programmed in VS extensively, but I'm 99% sure there'll be a better alternative if you search for it.
h‎-how about this GPL 3 one? github.com/Fazecast/jSerialComm
This BSD licensed one g‎-got its last commit Feb this year github.com/nyholku/purejavacomm
i‎-i‎-i‎-i‎-i‎-i‎-i‎-i‎-i‎-i‎-i‎-it's called GNU/Linux
j‎-j‎-j‎-just b‎-buy an ona-hole and a dragon dildo, user. m‎-m‎-maybe they'll give you better taste in s‎-software and in i‎-images as well...

HELP ME Holla Forums HOW DO I BECOME A JAVA PRO IN 48 HOURS OR LESS

HELP HELP IM SERIOUS PLEASE I NEED TO POO IN THE LOO REALLY BAD

This. For cross-platform applications everything else is a nightmare.

No. JavaVM is cross-platform.

so basically if you program in a way that keeps memory leaks in mind and prevents them, your good to go

yeah, same problem as amazon.

The service is objectively better, but if you use it you will be fucked in the ass later when they have the monopoly.

The JVM compiles the Java Bytecode to architecture specific bytecode so he is kinda right

I'd argue that optimization can be added after-the-fact, by changing the original. Demoscene coding on the other hand relies on generating the data at runtime, similiar to a svg. You can't "optimize" a png to a vector graphic format, you have to redo it from the ground up, which isn't optimization.

eh, only system librarys you'd expect to be installed like directx.

Java source code is compiled to JVM byte code, usually by javac, the java compiler. Note that other languages like Scala or Clojure also compile to JVM bytecode. The JVM bytecode is then shipped as java "binarys", .jar files. When you run a jar file the JVM on your system takes the JVM bytecode and compiles it to machine code for your architecture, be that x86, ARM, PowerPC or a completely different architecture. Said Machine code is then executed.

Thats actually a pretty common thing to do, for example cisco phones(not smartphones, standalone phones) use java, although with Cisco's proprietary unix instead of linux. Intel ME runs some java on top of minix.

What if you make it proportional to μarch market share?

Java is only reasonable speed in microbenchmarks as all its bloat fits in the icache and there's little structure. It goes to shit in real programs.

...

It's 96KB released. Unpacked its like 300MB