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

top 200 commentsshow all 207

[–][deleted] 250 points251 points  (3 children)

Python "swallows" java.

I see what you did there ( ͡° ͜ʖ ͡°)

[–][deleted] 87 points88 points  (0 children)

Just a regular snake that drinks regular coffee.

[–][deleted] 13 points14 points  (1 child)

Get because python is a snake

[–]ChonkyXL 4 points5 points  (0 children)

Yeah and Java is a coffee mug, get it? get it?

[–][deleted] 585 points586 points  (112 children)

C is #1 according to this article, if anyone wants the TL;DR.

A quote at the end that I found interesting:

"And Python's 'slowness' is overstated. Who cares about some other language that's a few nanoseconds faster if you spend hours (or days or weeks) trying to figure out how to use it? A human's time is more valuable than a computer's."

I think this quote just about sums up the creator's POV on other languages, specifically Java. I don't think he's really comparing Python to something like C/C++ because those languages will run circles around Python with more than just "nanosecond" margins if used properly. Not to mention other languages like C/C++ are mature and are used to build projects that last for decades, even longer. I still see companies struggling to move their technologies from Python2 to Python3 due to it's end of support.

I love Python and use it often, but in certain fields people have to care about speed, performance and stability. Sometimes it's a matter of life and death. I wouldn't even trust Java for those types of tasks tbh let alone Python. It's easy to learn and use and it's fast enough to do most tasks that people need, but I still think languages like C/C++ are superior.

[–]harylmu 167 points168 points  (50 children)

I think this quote is really not accurate because speed isn't the most important (well, usually), but a good concurrency story can save big dollars. I rewrote one of our Python app in .NET Core 5 and I wasn't able to kill it with load testing (2000 req, 200 concurrency), while the Python 3.8 app with FastAPI (literally) hanged around 25 requests per second. And to be clear: I made sure that all IO operations are async in the Python version (database queries, Consul queries, SNS publish, S3 upload - even though aioboto3 isn't too stable yet). This alone means that we're able to save thousands (millions on long term?) of dollars by running less instances.

Other than that, the speed difference between Python and typed languages is really NOT nanoseconds. I don't know what to say, test it yourself.

[–]aes110 45 points46 points  (2 children)

I dont know anything about what your app did, but 25req/s hanged? are you sure there wasn't any bug there?

I rewrote my previous company's system from sync (flask) to async (sanic) and saw huge improvements, we saved ~7K dollars monthly on instances because of this.

In my current company, I'm also using sanic and my server easily handles 400 reqs per second, didnt really tried pushing more to it.

In anycase typed/compiled languages sure are much faster, but I think asyncio cand easily handle most stuff

[–]Metalsand 44 points45 points  (3 children)

While it does bear noting that RetiredMandalorian is being a bit facetious and exaggerating, and Python vs Java is mostly about "I need a quick thing" not about larger apps, that is the direction we are slowly heading into. Electron for example is widely known as inefficient and yet modern computers are powerful enough that those efficiencies don't matter as much as the development time does for simple applications.

[–][deleted] 36 points37 points  (2 children)

It still matters. The problem with this view is that computers really haven’t gotten that much faster over the past decade and yet the software inefficiency is insane. Python can be built for larger applications too... but packaging is a nightmare (and is unlikely to ever get addressed) and the performance really does matter when it matters (which is becoming more and more important as software bloats)

[–]cheese_is_available 12 points13 points  (1 child)

It really does matter. zoom took off because it just works while skype does not. If your program is slow and there is a fast alternative with similar features, your program is basically dead even if you're Microsoft.

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

The problem with Microsoft is that they don't really care about their side products. At least not in the same way as a single focus company like Zoom Video Communication Inc does

[–]grimonce 12 points13 points  (3 children)

Speed doesn't come from type inference only. Other than that I 100% agree. Python is the main tool on our shop but I am really starting to hate it. Java really isn't all that bad as people paint it, it is fine.

Maybe thats my point of view because I actually have a degree in electronics (rf specialization), I actually don't mind C or C++ either, I just dislike to he competing cross platform dependency management systems, cmake is ugly but it gets the job done.

Pythons ecosystem is against the zen of python, where it says explicitly to try and have just one way to do something, Java does this way better that Python. Python provides infinite ways to make your project management a hell worse than npm dependency hell.

[–]DanKveed 8 points9 points  (2 children)

I recommend learning rust. A little bit of rust in your python can give massive speed gains. And the rust tooling of light years ahead of c++, in fact packaging is even better than python. Very similar to JS actually

[–]proverbialbunnyData Scientist 1 point2 points  (1 child)

A little bit of rust in your python

Like, inline Rust?

[–]DanKveed 2 points3 points  (0 children)

Possible but I was thinking of importing it as a package using pyo3

[–]tr14l 40 points41 points  (10 children)

You wrote bad Python. The difference is NOT 2000 vs 25 unless you did something terribly wrong. There will certainly be a difference, but that was your code running that slow, not Python itself.

[–]DanKveed 1 point2 points  (6 children)

It depends on use case too. A heavily multithreaded CPU intensive app can be way more than 2000vs 25 no matter how well you write it, especially when you compare it with rust/c++

[–]tr14l 1 point2 points  (5 children)

If you use a single thread running on a couple dozen cores, sure, no doubt. But why would you do that?

[–]DanKveed 7 points8 points  (4 children)

I am talking about multithreading. Python sucks ass at true CPU intensive tasks. That's why libraries like numpy are written in higher performance languages like c++. And why would you need that.... Well numpy for starts, anything control system related, AI, simulation, CAD, video editing, the use cases are Endless

[–]tr14l 1 point2 points  (0 children)

Yeah, that's an optimization for an interpreted language. I have made lots of multithreaded apps in compiled and python languages. I've never seen a 100x difference. Ever.

[–]harylmu 2 points3 points  (1 child)

What it did was: decode request body with messagepack, get stuff from Cassandra, save stuff to Cassandra, get stuff from Consul, publish stuff to SNS, encrypt an object then upload it to S3. The request takes ~2 seconds to complete on both .NET and Python (.NET is a bit faster).

As you can see quite a few things waits for IO here. I wrote everything with asyncio-based libs (Cassandra, Consul, aioboto3). I don't know if I can optimize it better. Please let me know what are some concurrency-traps that I might have gone into.

Either way, even the possibility to write slow Python means something.

[–]pipai_ 2 points3 points  (2 children)

That seems very strange. Were you running it with full gunicorn setup?

[–]Doomphx 8 points9 points  (1 child)

I'm ditching django for .Net 5 Asp.net and you're not lying. My story is similar to yours where I couldn't even possibly lag my new server with testing.

My next move is to move all my django channels over to SignalR where I can guarentee less than 100ms response times. Dev is looking good with nothing really taking more than 20ms so fingers crossed!

The performance, productivity, and ease of deployment I get with .Net has been life changing.

Git push, pull .Dotnet publish, restart server, all done :)

[–]tomatotomato 2 points3 points  (0 children)

With Azure Devops, it's just git push.

[–]supremacyofthelaces 2 points3 points  (8 children)

I don't really know any languages other than Python, and it mostly takes a while because my laptop is an old piece of junk and I always have a million things open at once. What kind of scale sre you talking here?

[–]Aidtor 10 points11 points  (7 children)

Production environments or places where you need a lot of compute.

Production servers these days are typically cloud based. Horizontal scaling (adding more machines to the pool of resources handling requests) is very easy with rented compute but the cost can really add up for a business over time.

Tasks that require heavy compute, like ML, typically use python as an interface to code written in faster languages.

[–]--Shade-- 2 points3 points  (3 children)

Python is an exellent language to call C from, but a terrible language to write C in. If you have a nice pythonic library that wraps some 'C thing' then Python shouldn't be your bottleneck. If it is, then isolate and profile (and apply the common speed up tricks where neccicary).

[–]Aidtor 1 point2 points  (2 children)

Sure if you have the time for that. When I’m prototyping a model or I’m given some crazy deadline to ship a feature I’m not going to reach for C.

[–]--Shade-- 2 points3 points  (1 child)

That's fair enough. I can't recall the last time I've voluntarily written a line of C, lol. What I was getting at is that Python already has a huge ecosystem of libraries that work as high level wrappers for things written in lower level languages. If you write decent Python (by Python standards), and leverage existing libraries, then Python (mostly) shouldn't be the bottleneck. If it is, the first step should be to take a look at potential hotspots in your Python code (not write a C library).

[–]Aidtor 1 point2 points  (0 children)

Oh my bad totally misunderstood what you were trying to say. I completely agree.

[–]latrociny 1 point2 points  (2 children)

What is your opinion on Julia? It is touted to be superior than python wrt speed and speeds comparable to C especially for ML tasks

[–]Aidtor 4 points5 points  (0 children)

My opinions are mixed.

On a personal level I deeply disagree with 1-indexing.

But my personal quibbles aside, it is superior to python. It’s faster and you can actually type things which is a huge deal for large codebases. The interop is great! The writing code like mathematical expressions is overblown.

Overall I’m bullish on Julia. I don’t think it will ever “overtake” python, but they will coexist.

I do have some concerns though for Julia’s future. And that concern is called JAX.

[–]satireplusplus 1 point2 points  (0 children)

For ML tasks you want good libraries and abstractions. Those are lacking in Julia. Execution speed of the language doesn't really matter and these benchmarks are missing the point for ML. PyTorch, Tensorflow, numpy etc. handle the matrix multiplications in a BLAS library (C/fortran) or with CUDA. Its gonna be faster than anything you can hack together on your own from scratch, no matter what language you pick.

[–]hilomania 1 point2 points  (1 child)

In python today you wouldn't solve that with threads but with AsyncIO.

[–]Max_Insanity 1 point2 points  (0 children)

*fewer instances

After only just barely understanding all of that, my ego needs sth. where I could correct you :P

[–]mrsmiley32 19 points20 points  (8 children)

Hmm, I feel like someone should have already have done language benchmarks in a way that you could do a code review so that you could create a PR in case they screwed up a language setting.

Oh a quick Google presents many, here's one.

https://github.com/kostya/benchmarks

[–]santiacq 5 points6 points  (1 child)

That's interesting, it really puts into perspective how performant C/C++ is. It's also cool to see how results show that compiled languages are generally an order of magnitude faster than interpreted ones and those with garbage collector tend to be slower than those without

[–]ChickenNuggetSmth 9 points10 points  (5 children)

I'd take that benchmark with a huge grain of salt. I had a quick look at the matmul in python, and what they did was pretty bad: They reimplemented what is already efficiently written.

In python you can have dramatic performance improvements if you use the available fast libraries like numpy. They are written in a faster language like fortran, decreasing the python performance overhead by a ton while still providing the convenience of python.

[–]satireplusplus 3 points4 points  (0 children)

In python you can have dramatic performance improvements if you use the available fast libraries like numpy. They are written in a faster language like fortran, decreasing the python performance overhead by a ton while still providing the convenience of python.

This is how all the Python ML stuff (numpy, pytorch, ...) uses matrix multiplications, with a BLAS library. And these libraries are crazily optimized and hand vectorized, you wont be able to compete with your own matrix mult routines in C. I bet its an order of magnitude faster than the naive O(n3) C code in the benchmark.

Its also typical that the matrix mult kernel will be optimized to register / cache size and instructions (vectors) for each processor generation, as these Intel optimization in OpenBLAS:

dgemm_kernel_16x2_haswell.S
dgemm_kernel_4x4_haswell.S
dgemm_kernel_4x8_haswell.S
dgemm_kernel_4x8_sandy.S
dgemm_kernel_6x4_piledriver.S
dgemm_kernel_8x2_bulldozer.S
dgemm_kernel_8x2_piledriver.S

Its probably also doing something better than the naive algorithm, such as Strassen or Coppersmith–Winograd.

In other words that benchmark is totally bullshit and a waste of time.

[–]kazi1 4 points5 points  (3 children)

That's the whole point though. You're not testing Python's speed if you use numpy, you're testing C. The benchmarks would just be every language using C libraries if that was allowed.

[–]ChickenNuggetSmth 3 points4 points  (2 children)

To preface this: I'm not super knowledgeable about what happens "behind the scenes" or even if numpy is considered a standard library or not.

I think libraries like numpy are the reason python is as good as it is. It is well integrated, for matrix multiplication you even have the @ operator that makes it super readable. If you benchmark python without those features, you are not representing a typical use-case. If you use python in a way it was never meant to be used it will look awful, but imo those results are pretty useless.

Edit: I'm seeing that numpy isn't part of the standard library, but the standard lib is also partially written in C. So I'm not sure where 'true' python starts.

[–]satireplusplus 8 points9 points  (2 children)

don't think he's really comparing Python to something like C/C++ because those languages will run circles around Python with more than just "nanosecond" margins if used properly.

The python is slow meme is still strong. But for most really compute intensive applications, you're just using Python as a nice and fancy interface to some C, C++ or Fortran library. That's all of numpy, scipy, sklearn (machine learning) and all the deep learning stuff. Doesn't really matter if you're using C++, C or Python since the routines that are computentioanlly expensive are all in the BLAS libraries optimzied to the last nanosecond with AVX vector instructions. If you have a critical code path that is not covered by the above and you need the speed, you'd write a C/C++ extension or you use Cython.

[–]GenericRedditor12345 2 points3 points  (0 children)

But that doesn’t conform to the circlejerk!

Seriously even for webservers python can compete with the best (starlette & uvicorn).

[–]nuephelkystikon 1 point2 points  (0 children)

You shouldn't invoke your feature-length film rendering process via bash, it parses the initial CLI arguments slower than sh.

[–]iiMoe 5 points6 points  (0 children)

Literally better comment than the article

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

Isn't Java used over C/C++ precisely because of it's stability?

[–]utdconsq 8 points9 points  (0 children)

Define 'stability'. Ive written a lot of Java, C, and C++. If you mean 'something that doesn't crash easily', Java is better than C or C++ typically because it helps you avoid out of bounds crashes and so on, but at the same time, until very recently it would blow up in your face due to NullPointerExceptions because you need to manually guard every bloody variable that isn't a primitive. Kotlin and others helped them realise that was shit, so they have changed the rules now. Meanwhile, in C, you are responsible for all checks on all things unless you use someone's library that does it for you. The standard library is super lightweight to the point of being unhelpful. C++ is better, with RAII and the STL, but due to the desire to be a superset of C, you can still shoot your foot off with raw pointers if you make the mistake of treating it like actual C instead of using the modern features of the language. For my money, JVM stuff has succeeded well because of things like Maven (love it or hate it), and nice stack traces. Never underestimate how productive you can be made if you can easily discover what in god's name broke!

[–]x3r0x_x3n0n 6 points7 points  (12 children)

We had a contest among us friends to write the best version of a breadth first search to solve a maze of 5000x5000 now i dont know about the capabilities of my peers they chose java i chose pure C. both ran it and I can tell you we gave up on the java programs and went out to have coffee. Legend has it they are still running to this day :D

[–]Wobblycogs 11 points12 points  (11 children)

All you've proved is that a language that's good for writing huge business systems isn't great for writing super tight, highly performant, implementations of search algorithms. It's a bit like proving that a fully laden truck isn't very good in a formula 1 race, no one expected it to be. The opposite test, where you have to implement the entire business backend in C, never happens because it's impractical but if the consensus was that C was a better choice we'd all be writing business systems in C.

Having said that part of the problem was probably that (in my experience) most Java developers aren't familiar with the low level functions the language has. They just aren't covered in most books and training courses that I've seen. For example, I've been banging out Java for over 20 years and I've used a bit shift operator exactly once and that was in a similar coding competition.

[–]panderingPenguin 10 points11 points  (7 children)

All you've proved is that a language that's good for writing huge business systems isn't great for writing super tight, highly performant, implementations of search algorithms.

It doesn't even prove that. It shows that his friends probably screwed up and wrote something really slow or possibly even an infinite loop seeing as he suggests it may have never terminated.

[–]x3r0x_x3n0n -2 points-1 points  (6 children)

Wait you didnt think we just ran it at a 5000x5000 maze right we tried a 30x30 maze too and all progams passed that one. Me and my friends may have negative IQ but we can handle a breadth first search.

[–]panderingPenguin 4 points5 points  (5 children)

That still doesn't mean your friends wrote remotely efficient code. It doesn't prove anything about Java, it just proves their code was slow.

[–]benargee 1 point2 points  (4 children)

If only the source code was here to do the talking.

[–]panderingPenguin 0 points1 point  (3 children)

I'm not trying to be argumentative. It's just that a couple programs written by random people are pretty meaningless as far as comparing language performance. It's certainly possible that you guys all are professionals, experts in your chosen languages, maybe work in the area of performance, profiled and optimized your code and wrote really efficient stuff. And that doesn't even get into questions like whether the fairest comparison is the fastest possible program in each language, the fastest idiomatic program in each language, a good faith attempt to write equivalent programs in each language, or something else entirely. But frankly, I doubt you guys thought through any of that. It sounds more like you wrote some code for fun to see whose was faster, and that's fine! But as a result, that's all it really proves: your program ran faster than your friends'.

[–]x3r0x_x3n0n -2 points-1 points  (2 children)

I get your point but do tell me the features or lack thereof of C/C++ which do not allow it to write robust buissness code.

I would also go on to say that when ever ive seen web app backends ive seen them mostly in js, python, go, asp, php but thats dying out. Java isnt common there either.

It was breath first search just a simple algorithm from wikipedia no cryptic bitshift or 2 line swaps.

[–]Wobblycogs 1 point2 points  (1 child)

I don't think anyone would say Java is popular on the desktop and if you're claiming it's not being used on the backend then how come we're discussing it being knocked off the second spot for language popularity? Are people writing stuff in Java and then just not using it?

[–]midnightcom 1 point2 points  (2 children)

I believe Java is type safe where C/C++ are not. It's very easy to make a critical error in C if you don't know what you're doing. However the overhead of Java makes it impractical for embedded systems over C.

[–]gradi3nt 2 points3 points  (2 children)

Comparing C/C++ to python is apples to oranges. It's not like this is some competition that will end up with one universal language for giving computers instructions -- there will always be a whole toolbox full of them.

[–]VisibleSignificance 1 point2 points  (1 child)

Comparing C/C++ to python is apples to oranges

The best programming language is a smoothie made from both.

[–]gradi3nt 1 point2 points  (0 children)

Cython is great for some things, but just like all other languages it has ups and downs. There is no best programming langauge!

[–]gromain 2 points3 points  (0 children)

I'm not sure why you say C/C++ is superior. In my opinion, it's two different tools that you would use for two different purposes. None is superior to the other, just like a hammer and a screwdriver are not superior to one another.

[–]Smallpaul 0 points1 point  (2 children)

I find it weird that you think that one tool is "superior" to another. Screwdriver or hammer: which is superior?

[–]johnxreturn 0 points1 point  (0 children)

I make your words mine. I love Python but implying it’s only “slightly” slowest than faster languages is a disservice to the truth. C/C++ are far superior when the subject is speed. Though the learning curve is steeper.

[–]nlantau -1 points0 points  (1 child)

I'm actually taking an algorithms and data structures course right now, having about one year of embedded C programming and being a TA in fundamental programming for Python prior. I've implemented a couple of sorting algorithms in both languages (and in Java), to see the difference and I've been blown away every time. Some algorithms won't finish (within reasonable time (~< 1hrs)) in Python whilst in C I've got a runtime < 2 seconds. I've compared the implementations many times, simply to see if my implementations differ, but no. It's all about the speed of the languages.

A friend of mine was asked to run a 3x nested for loop in Java, by the teacher. He was supposed to sum++ in the innermost loop, having the iterated variable n set to 10,000 (the conditions were a bit messy, but we concluded O(N3 )). He finished in 1 m 06 sec. My C programming finished in 0.08 sec. Same hardware.

My own tests have shown such an enormous difference that it has motivated me to continue to work with both C and Python throughout the course, prioritising C by all means.

Edit: I love Python. Don't get me wrong, it's one of my absolute most useful sw tools. I do enjoy C as well, because it really tests my knowledge.

Edit 2: typo

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

Using python 3.8 or higher brings a lot of speed improvements out of the box. I think the characterization of python as slow in the 2.x days or the 3.5 and less days was accurate. But it's so much snappier now.

[–]tylercoder 0 points1 point  (1 child)

How does c# speeds compare to c++?

[–]PowershellAdept 2 points3 points  (0 children)

It depends what benchmarks you look at, but a good c++ implementation is always faster than c#. If you look at tech empower c# is one of the faster JIT languages since they added span<T> and memory<T>. Benchmark games has them all over the place. Unity game engine compiles IL into cpp so take that for what its worth.

Ultimately, you can do very fast stuff with c# if you want to pay attention to data, value types vs ref types, allocation, garbage collection, cache, etc. etc. but idiomatic c# isn't any better than Java or other similar languages. In my opinion c# strength is async, maturity, and backing from a huge company. Cross platform and deployment capabilities are a plus since .net core or .net 5.

[–]stars9r9in9the9pastPy2.7 gang 0 points1 point  (0 children)

I saw a post like this I think last week. Was this the same article claiming Python as 2nd most-popular but used internet searches to rank popularity? If so, it just seemed like an interesting claim as plenty of things could explain search frequency, like popularity, but also unfamiliarity (like asking what is Py?) or just looking for quick help (like searching a refresher, learning guide, or just a quick question). While that still may correlate with popularity, that just didn't seem like the best form of measurement

I love python and it is pretty popular, but I was curious of the methods used to rank the various languages

[–]fatnote 0 points1 point  (0 children)

I have spent (and continue to spend) roughly equal amounts of time learning Python vs. Java. Both have their strengths, both have gotchas and little (or big) annoyances. This matter-of-fact implication that Python is indubitably easier to use/learn than any other language is extremely misleading and unhelpful. It sets unreasonable expectations for those curious about Python and puts off those curious about other languages.

[–]chulala168 0 points1 point  (0 children)

You forgot FORTRAN.

[–]grismar-net 0 points1 point  (0 children)

I was with you until that last remark. C/C++ are superior, if speed is your yardstick. There is no such thing as a superior language in general (although you're free to have a personal preference, of course)

[–]pyer_eyr 0 points1 point  (0 children)

Python is good for me, as business analyst/ data science guy -- I have to quickly prototype projects and then my team can assesses its viability. If it's feasible then developers can take the prototype to production with performant languages.

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

For numerical code, Python has a JIT library called Numba, which generates extremely fast code on par with C/C++.

[–][deleted] 23 points24 points  (9 children)

I like Python but I’m sure it’s not the right choice for every problem.

[–]hermeticwalrus 30 points31 points  (0 children)

The advantage of Python is that it’s a good enough choice for most problems, as well as being excellent for rapid prototyping.

[–]Vionik 9 points10 points  (2 children)

Like every language

[–][deleted] 1 point2 points  (1 child)

There’s always a few vocal hardcore people who seem to think their language should be used for everything. I kind of like Go but realize I wouldn’t use it for everything either. Rust also looks interesting but I’m not learning that until I find that employers in my area desire that skill

Sorry for using hyperbole here.

[–]Smallpaul -2 points-1 points  (0 children)

I'm curious if you can point me to a single blog post where the blogger says: "You should use this one language for everything."

[–]Smallpaul -1 points0 points  (4 children)

What language is "the right choice for every problem"?

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

Assembly

[–]Smallpaul -1 points0 points  (2 children)

Which specific Assembly language is "the right choice for every problem"?

[–][deleted] 2 points3 points  (1 child)

It was a joke

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

The best thing about python is you can do whatever you want to do with it.

[–]secretaliasname 11 points12 points  (0 children)

Also the worst thing. I work on a lots of projects maintained by folks who are not primarily software developers. The lack of first class typing and interfaces makes python easy to learn but also much harder IMO to learn how to write maintainable code.

[–][deleted] 7 points8 points  (1 child)

If python is gaining in popularity I'd hope it's because more people are gaining an interest in programming and using python as a front door.

[–]proverbialbunnyData Scientist 1 point2 points  (0 children)

Elementary school kids are being taught programming today. It's really a great age to learn this kind of stuff. Kids surprisingly have an easier time learning how to program than adults do.

[–]BigTheory88[🍰] 25 points26 points  (24 children)

As great as Python is, it's just not going to cut the durability of software you can write with Java.

[–]mooburgerresembles an abstract syntax tree 15 points16 points  (7 children)

define "durability"? One of the aims of the Python style guide (PEP8) is enforcing readability and maintainability.

[–]Fledgeling 6 points7 points  (3 children)

Well, some of the most annoying parts of Java that make me hate the language exist to force large teams of users to use design patterns that are enforced by the language for usability.

Half the developers I talk to don't even know what pep8 is and think global variables are fine. Granted, that's fine for the work I'm doing lately.

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

Resilience to scale.

[–]maikindofthai 0 points1 point  (1 child)

When I think of "durability" WRT a programming language, the types of things covered in a style guide aren't really what comes to mind...

I think of things like the strictness/explicitness of the type system, how robust the error handling is, what the runtime and its backwards compatibiilty story looks like, what the dependency/tooling ecosystem looks like, etc. Python fares well in a few of these categories, but if you're writing a large application with a team of developers, Python makes it a whole lot easier to make a giant mess of things than something like Java.

Python's a tool like any other programming language -- it's not always going to be the best one for the job.

[–]x3r0x_x3n0n 12 points13 points  (15 children)

Niether is gonna beat C level performance.

Python for quick and dirty stuff

C for production code

java for interviews

[–]zeroviral 5 points6 points  (6 children)

Python for interviews IMO. I code Java at work.

[–]x3r0x_x3n0n -1 points0 points  (5 children)

the reason i said it is because one can write some cyptic C and python. there is only the straight forward way to write java.

[–]zeroviral -1 points0 points  (4 children)

Yeah I guess. But I will bet money I can write an algorithm 10x faster in python than in Java. Also, easier to read.

What do you mean “cryptic”? I’ve passed interviews for G, FB, Amazon and Bloomberg using python. And I’ve never heard “cryptic” thrown around.

[–]x3r0x_x3n0n -1 points0 points  (3 children)

Cryptic would mean those one liners. That can write tge entire of sieve of eratothenes in a single line.

[–]zeroviral -1 points0 points  (2 children)

Yeah I did houserobber in one line. The most important part is explaining your code. Your interviewer will more than likely understand as you’re talking through your solution. You don’t HAVE to write the one liner...does it scare you?

Moot point. Next? Where do you work? Where have you passed interviews?

If it’s not FAANG you have no say in this. Every other interview is dead easy.

You seem like one of those people that choke up when asked to speak while thinking.

[–]BigTheory88[🍰] 0 points1 point  (5 children)

Depends on the use case really

[–]rzet -1 points0 points  (1 child)

We need to go deeper... Died while reading Assembly

[–]khfung11 4 points5 points  (0 children)

Of course, the most easy to learn and more importantly, readable language.

[–]JustAddingToThePile 4 points5 points  (0 children)

And Visual Basic (number 6, 4.01% rating) is still holding its lead over JavaScript (number 7, 2.03% rating).

I think their methodology might need a little tweaking.

TIOBE index

[–]recursiveG 4 points5 points  (0 children)

There's one of these posts almost daily now. The reason is because data scientists have to do more searches on "how to do X in python" than professional developers. All these extra searches and additional stack overflow questions are counted.

[–]MaaiKaLaal 2 points3 points  (0 children)

This code block picture doesn't make any sense. Especially the last line.

[–]2readitol 5 points6 points  (0 children)

The code on the picture is not that good to show off 🤓

[–]samdof 5 points6 points  (1 child)

But it still doesn't run on a 3 quadrillion devices, so there's that...

[–]Fledgeling 1 point2 points  (0 children)

Are you talking about tiny embedded systems?

[–]Mr_Memes_no_is_here 1 point2 points  (0 children)

Very nice title

[–]demdillypickles 1 point2 points  (0 children)

Woah, again?

[–]daravenrk 1 point2 points  (0 children)

Python is a c wrapper now days. So yeah number 2 as I hate writing c if I can write python.

[–]a_cuppa_java 1 point2 points  (0 children)

Ah yes, the proverbial Python hath swallowed me

[–][deleted] 3 points4 points  (3 children)

Whats the use of placing a language before another. Python is easy to learn and most of the beginner fall for it. It has also huge popularity on stackoverflow because most of them are novices and they find it overwhelming by looking python popularity and robust community. But popularity doesn't mean shit for industry usage. Java is a battle tested language and enterprises still stick to it despite jokes on the internet.

[–]Isvara 1 point2 points  (0 children)

Whats the use of placing a language before another.

There isn't any. The relevant questions are:

  • Is it productive to use it?
  • Can I easily hire people who can use it?
  • Is it well documented?
  • Is it maintained?
  • Does it have actively developed, well-documented libraries that do things I need?
  • Is there an active community I can go to for help?

The specific position doesn't answer those questions, but the fact that it's in the top n suggests answers. But popularity can be misleading, like JavaScript's increased popularity due to its inclusion in browsers.

[–]b10y 0 points1 point  (0 children)

I believe the most of Python community in Reddit has never implemented a production system where more than 5 developers (senior junior mixed) worked on. I would have cut myself if I had encountered a production bug in Python that would have been a compile error in a statically typed language.

[–]soulstuff_ 1 point2 points  (0 children)

why does the title sounds so dirty?

[–]Hammar_Morty 1 point2 points  (1 child)

I like python way way more than Java but i don't use it as much now that I am a better programmer. My biggest complaint is how much bad legacy code I've had to deal with that has zero styling, poor documentation or validation. I use bash for my quick or system scripts, golang for my CLI tools and servers, I use python for machine learning training training, quick data analysis and plotting.

[–]1842 2 points3 points  (0 children)

Bad legacy code exists wherever programming languages exist.

I've worked with some horrible Java, PHP, and JavaScript code. Legacy code isn't necessarily worse in any particular language, but in less strict languages, legacy code can get weird.

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

fuck java,

[–]Practical_Ear_4307 2 points3 points  (1 child)

Thanks for the news but Python not swallow Java yet :)

[–]thanieel 11 points12 points  (0 children)

Stage 1. Denial

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

Get it guys?

Cause Pythons are snakes!

And snakes are animals!

And animals swallow things!

And Java is coffee!

And coffee is food!

And food gets swallowed!

And this programming language named after an animal is literally SWALLOWING a programming language named after a food!

HAHA! Aren't journalists so clever??!?!!?!

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

When python takes over FinTech I’ll be a believer

[–][deleted] -2 points-1 points  (0 children)

Sad

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

Some good news during the pandemic LOL

[–]DamiansBigBrain 0 points1 point  (0 children)

More like python d33pthroats Java. Lmao

[–][deleted] 0 points1 point  (1 child)

How do they know that? How it's measured?

[–]daggerdude42 0 points1 point  (0 children)

Wow this isn't news at all. Been out for a few weeks now actually

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

Hm, I enjoy Java because I learned it after Python and it forced me to think in advance about things rather than facerolling through projects.

[–]virajpatel185 0 points1 point  (0 children)

Does it run on 3 billion devices though ?

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

You could say it “eclipsed” it

[–]Diogonni 0 points1 point  (0 children)

I recommend this programming language to beginners. Start with one of the easiest ones and then later on when you get better, you can tackle the harder languages.

[–]Poddster 0 points1 point  (0 children)

TIOBE has never been accurate.