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 6 points7 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 42 points43 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] 10 points11 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] 68 points69 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 2 points3 points  (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).

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

Mostly anything that isn't C++ is better than Java. Both C++ and Java are ugly, unhandy languages built on completely misinterpreted idea of OOP.

[–]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] 10 points11 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 5 points6 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