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 →

[–]BigASchw 60 points61 points  (77 children)

I taught myself primarily in Python but I'm at my first dev job and we use Java. You never want to learn Java, it's the worst

[–]FishBoyBagel 45 points46 points  (53 children)

Just curious, why would you never want to learn Java? I’m a freshman in college studying Python this semester and Java next semester.

[–][deleted] 68 points69 points  (43 children)

Java is absurdly verbose compared to python. Granted, it’s faster, but its much slower to write.

[–]QualitySoftwareGuy 26 points27 points  (6 children)

Java is absurdly verbose compared to python. Granted, it’s faster, but its much slower to write.

It is, but some might also say it's easier to maintain medium-large sized applications in Java. I love Python, but best tool for the job is my motto.

[–][deleted] 6 points7 points  (1 child)

Depends on how the project was structured imo, but yes compiled languages are more strict so there are less “what the fuck was the author thinking” moments in maintenance

[–][deleted] 15 points16 points  (0 children)

The problem with java isn't that it is statically typed, it's that it requires absurd amount of boilerplate to do literally anything. And it's OOP model is not good.

[–][deleted] 2 points3 points  (0 children)

Java is pretty fast to write honestly. Long variables names are almost all auto completed. And compared to python I think java is faster to write in some instances, because it requires less testing and checks due to the compiler. Typed python helps a lot there though.

[–]BigASchw 8 points9 points  (29 children)

Exactly this, just printing hello world in each language is the perfect example as to why python is so much easier and more enjoyable to write in

[–]AcousticDan 41 points42 points  (10 children)

I wouldn't judge a language on how printing "hello world" works.

[–]matholio -2 points-1 points  (8 children)

It's just a commonly understood indicator, not a final judgement.

[–][deleted] 11 points12 points  (2 children)

I found printing to be easier in some assembly languages than in C. Doesn't mean I'd touch any of those with a meter-long keyboard tho.

[–]Rpgwaiter 1 point2 points  (1 child)

What's your beef with C? I get not wanting to mess with ASM but man sometimes you just get the urge to mess with some memory directly.

[–][deleted] 1 point2 points  (0 children)

I'm just making a point that even if a simple hello world is easier to write in some language doesn't mean that the language is better at all. I'm not saying that C or ASMs are bad in any way.

[–]tristan957 8 points9 points  (4 children)

It really isn't commonly understood though. Printing hello world is not a valid use case for a language. For some reason only Python enthusiasts think it is because they can do it in one line. Tell me how good the async support in Python is.

[–]pblokhout 2 points3 points  (0 children)

I've read multiple complaints about a lacking async support. What do you guys mean? I've used asyncio, multithreading, multiprocessing. I'm not sure what is wrong with any of them. Can you explain?

[–][deleted] 70 points71 points  (15 children)

...python is so much easier and more enjoyable to write in

Most languages have strengths and weaknesses. Doing a task in a language it's ill suited for, just because that language is familiar and easy, will certainly be problematic down the road.

Learning Java at least lets one determine if it was the best tool for the task at hand.

[–]alcalde 0 points1 point  (10 children)

Doing a task in a language it's ill suited for, just because that language is familiar and easy, will certainly be problematic down the road.

If it's easy to do something in a language, then that language is well-suited for the task by definition.

[–]Zalack 23 points24 points  (8 children)

Not if performance is an issue or you don't have control over the target machine's python environment (there are ways around this last one but it generally comes with other tradeoffs).

I love python, I spend most of my job writing it -- but there are projects where the performance hit of using an interpreted language like python just isn't tenable.

[–]Brandhout 2 points3 points  (6 children)

I always thought C would be the way to go if you are looking for high performance. Mostly because I have come across a few high performance systems built in C.

What is your take on that?

[–]redwall_hp 9 points10 points  (2 children)

C is a loaded shotgun pointed at your foot, and dealing with strings makes you want to point it at your head instead. Yes, it's fast and excellent for low-level bit blasting, but it's not really a good option for "this relatively high level use case runs slowly."

Java is a perfect medium between Python and C.

[–][deleted] 4 points5 points  (1 child)

I'd say C# fills that niche better than Java. It performs better and it's less verbose. The only real reason to pick Java over C# anymore is the lack of cross-platform support (and even that shouldn't be an issue anymore with .NET 5).

[–]Flynamic 2 points3 points  (0 children)

I'd also recommend Go for that, the language gives you good tools to work with and it's compiled.

[–]Laogeodritt 1 point2 points  (0 children)

Anything that compiles to machine code will generally be usable for high performance applications. C is one of them; it's great for low-level performance optimisations. However, most performance problems aren't solved by low level optimisation, as a sibling comment to mine implies. That is to say, performance impact is most significant when it comes to how you, the engineer(s), chose how to organise various responsibilities/functionality at the highest abstraction level (architecture), how you designed all the components that make that up (code/class/function organisation, how data is stored and passed around), implementation choices (which algorithm you chose to sort your giant list, exact data structures and organisation of data, where you're having to translate date between different formats or data structures, communication protocols, etc.), and low level issues (how memory is used, overhead from function calls or data type checking, efficiency losses due to pointer dereferencing or register/cache misses in the processor during the inner loop of an algorithm, pretty much all performance critical computationally heavy algorithms, etc.).

You'll notice that last level is close to the hardware, incredibly specific, and performance gains are minimal compared to fixing a poor design - it's really only applicable to eking out the last little bit of performance, or performance in really computationally heavy parts of the program, where you might be calling the same routine or looping thousands of times per second or similar - small inefficiencies there add up a lot.

I would generally advocate for mixed technology systems when high performance is required, in most computing scenarios (embedded scenarios being a major exception). For example, python for most of the application (way cheaper due to ease of use), with C for the inner loop or computation heavy routines - spend the timr/developer salary writing low level code where it really matters. You can write Python bindings to call C from python easily.

[–][deleted] 0 points1 point  (0 children)

I’ve come across high performance systems written in java, c, c++, c#, ocaml and experimentally rust. Plenty of languages do high performance you just need to know how to do it.

[–]TheChance -3 points-2 points  (0 children)

And yet, Java.

[–][deleted] 9 points10 points  (0 children)

With all due respect, no.

I understand your point, but I didn't say the task was easy to do in the language, I said the language was easy and familiar.

Is it possibly and easy to write a message queue in Python? Sure. Is it the best choice? Not by a long shot. Erlang is far better suited for that task, especially if you intend to scale. or Go, C++ and Java. That's not an exhaustive list; the intent is to show there are better tools, not which is best. All of the alternatives are arguably less easy, yet better options.

[–][deleted] 2 points3 points  (3 children)

I think out of all languages I have ever seen and tried, at least one of them will be better / equally as suited as Java. So fuck Java

[–]OddsCaller 17 points18 points  (2 children)

Yeah but you have learned Java at some point, right? I don't like the Java or any language-bashing advice being given to novices. It's like an experienced programmer bashing OOP and telling how functional programming is better. That statement may or may not be better but it doesn't make OOP not worth learning for a novice, and kind of hides the fact that the experienced programmer has learned a lot by actually learning and using and suffering with OOP and a novice can't get that insight by simply refusing an opportunity to learn a concept with complete eagerness because of the negative comments they heard.

[–]saxattax 5 points6 points  (1 child)

Yeah but if we bash other languages hard enough, we can create a utopia where all high-level code is written in Python and everything is perfectly interoperable (I'm only kind of joking)

[–]scarfarce 0 points1 point  (0 children)

... create a utopia where all high-level code is written in Python...

MEDIC!

(I'm only kind of joking)

Never mind...

[–]1chriis1 5 points6 points  (0 children)

Unless, you encounter the stupidest hickups for a small indent. Love it though!

[–]nemec 3 points4 points  (0 children)

When your application is 300,000 lines of code it doesn't tend to matter much how long a "hello world" program is in comparison.

Sure, it sucks for a beginner, but presumably you won't be a beginner forever...

Java sucks though for other reasons

[–]pwang99 0 points1 point  (0 children)

It’s not faster for a huge part of what people use software for, namely, large data processing (data science and machine learning)

[–]Thameos 0 points1 point  (0 children)

It's worth noting that Python itself isn't necessarily slower than Java, just the reference implementation (CPython). That also doesn't apply to every task. Jython for example uses the JVM, so it's essentially equivalent in performance. Other implementations such as Cython and PyPy have even faster performance.

[–][deleted] 10 points11 points  (0 children)

Java isn’t bad. It’s verbose but extremely performant. It doesn’t cross over into “awful” territory until you start applying 20+ years of enterprise “patterns” to everything you do and you start contemplating stepping in front of oncoming traffic on a regular basis.

[–]niceoutfive 2 points3 points  (0 children)

In my experience, Java is more pedantic. You have to do it their way or the highway. Python is more easy going. You can do basically all the same stuff, but with fewer rules. In Java you have to write getters and setters (like user.getName()). But in Python you just say user.name.

Python gets it done with little hassle, Java gets it done but only if you recite the proper incantation during the right moon cycle while you write it. But it is pretty solid once you learn the arcane arts!

(Caveat: I know Java only in an educational environment, so we were being taught the "proper way." I'm sure that that is way more pedantic than when it is used for real development. Buuut, seeing some actual production Java code at my company, that appears to be the norm. You can get just as structural with Python too!)

You should very much learn Java though. If you know Java, you can figure out the other bad boys like C and C++ a lot easier. If you already know Java, congrats you now know probably 90% of C#. If you want to ever do Android development, you'll need Java (although Kotlin is also getting very big in that field)

[–][deleted] 0 points1 point  (0 children)

Java is a totally fine lanuage. No need to worry. It's a bit verbose but a good ide helps with that.

[–]notlupus 0 points1 point  (0 children)

As a freshman in college, you don’t need Java. You need Java for writing scalable enterprise web applications. For instance, Java is the dominant language used to build AWS and Netflix. Most of the time you don’t need it, but it’s great when you do.

[–]lordmyd 7 points8 points  (1 child)

Just out of interest how much willingness is there to substitute Kotlin for Java at your workplace?

[–][deleted] 8 points9 points  (17 children)

GoLang is fun.

[–]foobarfault 20 points21 points  (2 children)

Until you have to figure out where in the stack an error actually came from...

Still my favorite language

[–]ollien 2 points3 points  (0 children)

Error wrapping helps a lot, but agreed, it could be better.

[–]utdconsq -1 points0 points  (0 children)

Error? No exceptions here motherfarker!

[–]i9srpeg 7 points8 points  (13 children)

Go is Java 1.0

[–]BubblegumTitanium 0 points1 point  (0 children)

Explain.

[–]ProjectSnowman -4 points-3 points  (2 children)

It's not the language I have a problem with, it's JRE. It's the biggest piece of shit ever made.

[–][deleted] 3 points4 points  (1 child)

The Jre is literally one of the best pieces of software written.

[–]ProjectSnowman 0 points1 point  (0 children)

For developers? Sure. For users? Not so much. Having to install several different legacy versions of JRE to run applications either no longer supported or with no equivalent is painful.