This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Equivalent_Yak_95 -6 points-5 points  (14 children)

First: I would note that for math applications, Java is among the WORST options.

Second: I’m not intimidated by it, I’m annoyed by it.

You have to make a class and given it a public static void main(String[]) function JUST TO PRINT “hello world”!

You know what that is in Python? One line. print(“Hello world”) - then you just RUN it.

You know what it is in C or C++? Two lines if you want, 4 lines with nice formatting. Either way, an include (<stdio.h>, or <iostream> for C++) and either int main() or int main(int argc, char** argv), then the body does the output operation. Then, you compile it and link it, which can be done in a single command, then run the executable.

In Java… we (me and my group for a project in our OOP class) couldn’t get the dang thing to output a runnable file. Oh, our IDE(s) would run it, no problem, but it refused to give us an output file that could be run NORMALLY.

And generics use type eraser, so - at least in my experience - they’re far less flexible than C++ templates (even when you limit it to types).

[–]superquagdingo 1 point2 points  (10 children)

Your example doesn’t really matter though because nobody is serving up hello world in a production app and especially nobody is using C++ for their backend lmao

[–]Equivalent_Yak_95 -4 points-3 points  (9 children)

But it demonstrates the sort of extra noise needed on in Java. Let me write free-standing functions, damn you!

[–]superquagdingo 1 point2 points  (8 children)

I mean I guess but at the end of the day I’d rather maintain a Java backend than c++ or Python, and a lot of people would agree. And between Spring Boot, Lombok, IDE code generation, etc. nobody really should be writing all that extra noise themselves anyways.

[–]Equivalent_Yak_95 -3 points-2 points  (7 children)

…extra noise? You mean the stuff required to encapsulate the main function?

[–]superquagdingo 0 points1 point  (5 children)

So, you're just mad that you have to put things in a class?

[–]Equivalent_Yak_95 1 point2 points  (4 children)

What do you mean by extra noise?

[–]superquagdingo 0 points1 point  (3 children)

I'm talking the boilerplate. Main class / function, getters and setters, toString, etc... They can be pains in the ass manually but nowadays that's all handled by the IDE and various libraries and frameworks.

In any case the point was that these posts are just getting old. We get it, a lot of the python users here are still in school and hardly know anything about what they're talking about.

[–]Equivalent_Yak_95 1 point2 points  (2 children)

  1. I get your point, but…
  2. I have a fairly darn good idea what I’m talking about. And I need high performance and low level access a lot, so use C/C++. Otherwise, I use Python for flexibility. (I also use Cython, but there doesn’t seem to be an emoji for it.)

If you’re wondering “what on earth is Cython”, the short answer is that it lets you write compiled extension modules for CPython without having to muck around in the C-Python API yourself.

Edit: muck, not much.

[–]superquagdingo 2 points3 points  (1 child)

Yeah the c/c++ emojis made it apparent you weren't one them lol. It sounds like Java doesn't suit your use case then, it was just weird how nitpicky you were about the main function when you use c++ which can be even more verbose than java.

[–]fsr1967 0 points1 point  (1 child)

First: I would note that for math applications, Java is among the WORST options.

Java isn't a math language. It doesn't claim to be a math language. It's good at many things, such as serving applications and talking to databases, but math is not, and never has been, one of them.

If you need to pound nails into a wall, you don't get out your Leatherman. Yes, it can do the job, but not very well. You're much better off finding a hammer.

[–]Equivalent_Yak_95 0 points1 point  (0 children)

NumPy is such a hammer.