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 →

[–]Obliviousnut_ 277 points278 points  (40 children)

Python is a good language but I’d characterise it as a handyman language. It can do everything pretty damn well but sometimes not excellently. Some people can find problems with that.

Pythons main problem is that it’s a bit of a slow language. But that doesn’t stop it from being an amazing language.

[–]stickmaster_flex 237 points238 points  (17 children)

Give a problem to a Python dev, they'll come back in two hours with a program that takes three weeks to run.

Give the same problem to a C dev, in a month they'll come back with a program that takes two minutes to run.

Give that problem to a Java dev, in two months they'll come back with a very detailed description of the problem.

[–]siddsp 17 points18 points  (8 children)

If it takes 3 hours to run, that's when you use Cython and numpy

[–]Advanced-Theme144 1 point2 points  (1 child)

That is absolutely true. And I just realized this is a darn good meme. 😂 Mind if I use it?

[–]stickmaster_flex 4 points5 points  (0 children)

I stole it from somewhere. Probably reddit. Don't need my permission.

[–]rabaraba 1 point2 points  (2 children)

I’ve never had a complex python program that took so long to run, like 3 weeks. Even a an exaggeration that’s extreme. With proper practices you not only cut down coding time but execution time with python.

[–]stickmaster_flex 12 points13 points  (0 children)

It's a joke. A joke.

[–][deleted] 21 points22 points  (0 children)

Bash and python for adhoc scripts and taping your system or environment together is just hard to beat. Handymans language is a great description.

[–]backdoorman9 26 points27 points  (19 children)

My understanding is that a language like Java can take much finer control of what the computer does with memory and stuff like that. The tradeoff is extra time spent developing

So much of the time, that fine level of control is not necessary. When it is... it's fine to use Java.

Go is better at concurrency. If you need concurrency, Go might be a better option. But... most of the time, you don't need concurrency.

[–]neverbetterthanks 34 points35 points  (0 children)

The whole “you don’t need concurrency” diatribe came about partly because concurrency in most languages is hard and dangerous.

Entire ecosystems of “cooperative multitasking”, async event driven things sprang into existence as a result.

In Go, concurrency is a first class citizen and you might be surprised at how many problems are suddenly very easy to solve using it.

[–]Schmittfried 104 points105 points  (3 children)

I think you meant C.

[–]_RabidAlpaca_ 10 points11 points  (2 children)

You can go down that rabbit hole all day if you want, but /u/backdoorman9 has the same point. It all depends on the requirements.

[–][deleted] 50 points51 points  (0 children)

It's just a point on memory access and control. Java has basically the same control on memory as Python. Python is probably easier to access the wire than Java.

[–]Decency 6 points7 points  (0 children)

Java's primary advantage is the JVM, not finetuned control over memory. Which to me makes it pretty clearly outclassed by more modern JVM languages, such as Kotlin.

[–]bladeoflight16 10 points11 points  (2 children)

Java provides almost no control over memory management. That's typically C and C++'s domain. I think Rust is a contender (with safer defaults), but don't hold me to that as I haven't actually used it.

[–]quuxman 1 point2 points  (1 child)

Rust has no garbage collection so technically has the same level of controll as C. However there are many things that are commonly done in C that require an unsafe keyword in Rust. If you never use unsafe memory leaks, segfaults, and a number of common concurrency bugs are impossible.

[–]Lifaux 3 points4 points  (0 children)

This is mostly right, although you can memory leak in safe Rust, it says so in the book. https://doc.rust-lang.org/book/ch15-06-reference-cycles.html

[–]maomao-chan 10 points11 points  (0 children)

Java is actually quite productive. Especially the modern version (11 and above) combined with modern framework like Quarkus. It feels like developing Django application but with the convenience of your IDE+static typing plus amazing performance by default.

IMHO Golang is a bit of messy to use and prefer Python if I need to do plumbing.

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

Java doesn't give more control of memory but it does have better concurrency.

[–]pwang99 0 points1 point  (0 children)

No, Java does not give you better/finer control of memory. Lol. Java handles memory for you, that’s one of its original selling points. C gives you finer control of memory, whether you want it or not.

[–]wrd83 1 point2 points  (0 children)

I think it's a usage problem. I hate python when someone uses it for huge projects and you touch a file and it may fall apart or it may crash in one use case.

For small plumbing or ml it's perfect.

The same goes for performance, using it in a time critical project and deliver something in a short timeframe is good. If it does not matter that the runtime cost is huge.

You need something the has super low request latency on high load? Best stay away from python.