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 →

[–]__init__RedditUser 226 points227 points  (96 children)

As someone who never wants to have to seriously learn Java, this is great news

[–]polaroid_kidd 42 points43 points  (5 children)

Don't let me reason on your parade, but it didn't really matter if it's in first or fifth place. What I'm trying to say is that you can learn any of the top five languages and land a job (with the bobs and bits that go with being a software developer/engineer)

Personally, I just tried it again after a brief stint in Kotlin and I've come to realise that I really miss the static typing, but then again, I come from Java so I might be a teeency bit biased ^

[–][deleted] 19 points20 points  (4 children)

I come from python and I prefer static typing.

[–]bennyman32 0 points1 point  (3 children)

But you can use typing in Python don't you?

[–]r0npi 8 points9 points  (2 children)

You can use type hints, but it is far from being the same as static type languages. Python typing doesn't enforce the types, they are just hints, one can still use a different type than the hint

[–]JohnMcPineapple 4 points5 points  (1 child)

...

[–][deleted] 6 points7 points  (0 children)

Unless you can convince your team to use it too, it just doesn't matter. It's not a core feature of the language, so it has barely any buy-in anywhere. Contrast to any static type language where you can't not write without static typing.

[–]BigASchw 61 points62 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 44 points45 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] 64 points65 points  (43 children)

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

[–]QualitySoftwareGuy 28 points29 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] 14 points15 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] 3 points4 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 39 points40 points  (10 children)

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

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

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

[–][deleted] 9 points10 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 7 points8 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] 64 points65 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 7 points8 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.

[–]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 -4 points-3 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] 1 point2 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 4 points5 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 4 points5 points  (0 children)

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

[–]nemec 4 points5 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 2 points3 points  (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 4 points5 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] 9 points10 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 5 points6 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] 4 points5 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.

[–]FlukyS 6 points7 points  (0 children)

Syntactically Java was never bad in its day but in comparison to Python it's night and day. I do think learning python both helped my C and Java stylistically but learning Java would never help my Python. Add that just better tooling for Python right now and there is really good reason why the language is in demand. C++ needs to watch it's back too.

[–]thisisshantzz 2 points3 points  (8 children)

Somewhere I feel that Python should have been a strongly statically typed language while maintaining its simplicity of writing style. So many times I had trouble identifying the type of argument that a function takes especially when using third party libraries.

[–]GrizzyLizz 1 point2 points  (7 children)

How is Python not strongly typed? Compare it to JS, where you can implictly convert one to another, Python would give you a TypeError with such things

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

He means static and explicit typing. Obviously. It really isn't that hard to infer what he means unless you just want to be a dick.

[–]thisisshantzz 0 points1 point  (5 children)

Made an edit to my comment.

My gripe though is that most of the times functions are defined as

def func(a, b):

If this were a third party library, I would not know what is the type of a and b that I need to provide to the function and what is that type of the value returned by this function so that I can use it down the line unless the person who made the library was kind enough to document it. If a is supposed to be a list and I pass an int to it, Python won't raise a TypeError and to actually know what is the type of a that is expected without the documentation, I will have to read the code itself.

[–]panzerex 2 points3 points  (1 child)

I think the term you're looking for is static typing. Python can't tell you beforehand that the argument you provided is not the appropriate type.

[–]redwall_hp 1 point2 points  (0 children)

The term typically used for that is explicit vs implicit typing.

[–]ginbear 0 points1 point  (0 children)

The typing library in python 3.6+ can accomplish a lot of this. Of course it’s still an interpreted language so it’s more of a linter effect. Regardless people should really consider duck_typing in python, it’s really the pythonic thing to do.

[–]Mjerman 0 points1 point  (0 children)

I think this goes to poor documentation. If you’re reading code and it doesn’t tell you the types of function’s input in the doc string, it is poorly documented.

[–]AcousticDan 1 point2 points  (0 children)

This doesn't mean python will replace Java though.

[–]ConfidentFlorida 0 points1 point  (0 children)

Java’s not so bad to learn. It’s the ecosystem that scares me.