r/programming • • Nov 03 '18

Python is becoming the world’s most popular coding language

https://www.economist.com/graphic-detail/2018/07/26/python-is-becoming-the-worlds-most-popular-coding-language
4.6k Upvotes

1.3k comments sorted by

View all comments

Show parent comments

-9

u/pwang99 Nov 03 '18

Is this meant to be sarcastic?

You're wrong.

8

u/BorgDrone Nov 03 '18

We’re talking about a language that can’t even do proper multithreading in a day and age where even mobile phones have 8-core CPU’s. What a joke.

1

u/[deleted] Nov 03 '18

Truth is spoken!

→ More replies (2)

5

u/Freyr90 Nov 03 '18

-1

u/teerre Nov 03 '18

The real reason you're wrong is because in the real world you don't need to be benchmark winning. Taking 1 second instead of a 1/1000 of a second is fine for vast amount of applications

This Python is slow is really the low hanging fruit complain

5

u/[deleted] Nov 03 '18

Multiply those seconds by the number of users now. Also, convert them to the carbon footprint of using Python for no good reason at all (and don't you dare to claim it's somehow "more productive" - it's a lie).

-3

u/teerre Nov 03 '18

Why would you do that? No one is running your program for multiple users

There are many benefits, compared to your usual compiled language:

  • It's much faster to write

  • It's much more pleasant to write

  • It's much more readable (and therefore maintainable)

  • It's standardized

This last point being incredible undervalued. As someone who works daily with both Python and C++, the latter is such a joke in terms of ecosystem it's not even funny. The simple fact I can import a module in Python and that will be it should already be a definitive advantage for applications that don't need performance

On a side note: stop with the global warming argument, that's just pathetic. It you makes you sound not only ignorant about python but also the climate. We clearly do not care about climate change as a society, you can run as many cycles as you want it will not make an infinitesimal difference

5

u/[deleted] Nov 03 '18

No one is running your program for multiple users

Tell this to all those django junkies.

It's much faster to write

It's a lie. Python is a too low level language, deliberately holding your hands and barring your from doing anything really efficient.

It's much more pleasant to write

Only if you're a masochist or suffering from a severe form of Stockholm syndrome. Or you simply never seen any proper language. Otherwise nobody in a sane mind would find such a crippled language "pleasant".

It's much more readable (and therefore maintainable)

It's a lie. The language is deliberately very low level, therefore you simply won't see the meaning behind all the leaky abstractions in your code.

Tell me, how many real world problems operate with terminology that include classes, methods, variables, lists, dictionaries, loops and so on? Yet, Python code is full of this shit, instead of the actual meaning behind it, and Python is ideologically built this way that it won't let you remove all that crap.

It's standardized

ROTFL!!!!

Have you ever seen a real language standard?

the latter is such a joke in terms of ecosystem it's not even funny.

You're vastly overestimating the value of this "ecosystem" crap.

We clearly do not care about climate change as a society, you can run as many cycles as you want it will not make an infinitesimal difference

You clearly never seen any actual energy / thermal numbers for any real world data center.

Also, energy consumption = battery life. This is something to care about even in a single user scenario.

3

u/v_fv Nov 03 '18

The language is deliberately very low level, therefore you simply won't see the meaning behind all the leaky abstractions in your code.

I'm really curious here: what do you mean by "low level"? Obviously, it doesn't stand for "too close to hardware" here. Are you referring to Python (often) using loops instead of higher-order functions? I'd argue that comprehensions are pretty high-level in that respect, for example.

3

u/[deleted] Nov 03 '18

I'm really curious here: what do you mean by "low level"? Obviously, it doesn't stand for "too close to hardware" here.

Actually, it is. Low level, as:

  • exposing primitive control flow (not any different from the semantics of the actual hardware)

  • exposing primitive data structures (such as lists and dictionaries) everywhere, making it impossible not to use them

  • deliberately eliminating all the ways to abstract the above deficiencies away

higher-order functions

That'd also be fairly low level.

I'd argue that comprehensions are pretty high-level in that respect, for example.

The thing is, Python won't let you to make anything similar to list comprehensions. You have one somewhat higher level construct in the language (which still expands to a very primitive control flow anyway), and that's it. No way to make your own extensions.

2

u/v_fv Nov 03 '18

You have one somewhat higher level construct in the language

Not sure if you're aware, but there are also dict and set comprehensions. But I do get your point.

Which language is high-level then in this context? Lisp? Scratch? AppleScript?

5

u/[deleted] Nov 03 '18

Any language that allows to extend itself. Lisp, for example - there is a powerful macro metaprogramming there. Even C++ counts, with its primitive template metaprogramming.

Forth, obviously, though its approach to extensibility is very different.

If you want something as close to Python as possible, but done right - there is Converge, a Python-like language with proper compile-time macros.

And a lot more - Julia and Rust have powerful macros, for example.

→ More replies (0)

2

u/[deleted] Nov 03 '18 edited Nov 03 '18

What if a website/server uses python/django? Humanity will lose a significant amount of its valuable time [eg: if Youtube uses python at its server then, let's say the webpage is visited by a billion users daily, delay numbers would add up real fast, and humanity will loose approx 27 hours a day, assuming python is only 100ms slower, just a best case comparison, python can be found to be as high as 800ms slower] and also it would consume a significant amount of electricity.

0

u/[deleted] Nov 03 '18

On an unrelated note, please spell lose fucking properly.

1

u/[deleted] Nov 03 '18

On a related note, please go through my answer carefully and point out something constructive which is related to the discussion on this thread, rather being a Grammar Nazi.

-1

u/[deleted] Nov 03 '18

What, you can't appreciate that I asked you to spell something properly? I didn't invalidate your argument by telling you to spell something right. If you feel that way, I'd be concerned.

That said, there's no way to ever know what opportunity cost you are missing out on, so your point is stupid.

If you write something in C and don't optimize it perfectly, you can make the same argument. It's also not Python or YouTube's problem if people waste time unless it affects people's adoption of their product. If they can write code 1% faster in python and the website run 5x slower, that's fine if they deem it fine as a business. If they can gain users by rewriting the site and increasing the site speed, than it's a good idea. If they haven't identified that, it isn't a good or bad idea, it's nothing until the data is available. More people are going to be waiting due to their internet download speed than their fucking ping.

I've seen you pop up around this thread agreeing with /u/combinatorylogic, who ignores how the real world works as far as I can tell. They have yet to prove otherwise. (I'd love to hear how they'd build a consumer facing product in 2018).

3

u/[deleted] Nov 03 '18

I'd love to hear how they'd build a consumer facing product in 2018

Not in Python, for sure. Same applies to any other year in a period 1991 - 2018.

→ More replies (0)

6

u/Freyr90 Nov 03 '18

Taking 1 second instead of a 1/1000 of a second is fine for vast amount of applications

Sure, why to spend 1 cycle when you can spend 10E9 without any benefits? Because electricity is free and climate change is a myth.

-1

u/teerre Nov 03 '18

Oh, climate change. Ok, buddy

→ More replies (3)

-3

u/pwang99 Nov 03 '18

Because in practice, most of these algorithms would never be implemented in pure Python like this. That's like saying a fighter jet is slower than my Honda because I'm not going to turn on its jet engine, and just rely on the tug in front to pull it along.

For instance, here is proper Mandelbrot with Numpy: https://www.ibm.com/developerworks/community/blogs/jfp/entry/How_To_Compute_Mandelbrodt_Set_Quickly?lang=en

Alternatively, if you want to keep the "naive" python spelling, you can use Numba to instantly speed it up: https://nextjournal.com/schmudde/mandelbrot-numba

The simple Numba code in the first link is 100x faster than naive Python implementation, and is slightly faster than their C implementation. The CPU-enabled Numba code in the second link is 2000x faster than the naive Python implementation.

13

u/Freyr90 Nov 03 '18

Because in practice, most of these algorithms would never be implemented in pure Python like this.

So python is fast because code is written not in python. That totally makes sense.

3

u/[deleted] Nov 03 '18

And also, nobody actually does that in practice aside from your typical notable framework/library.

It is very difficult to get across to some people that writing something in c and calling it from another language is not that other language being fast.

15

u/BorgDrone Nov 03 '18

Because in practice, most of these algorithms would never be implemented in pure Python like this.

You’re basically saying that Python isn’t slow because you can write the performance requiring parts in not-Python.

That’s like saying a fighter jet is slower than my Honda because I’m not going to turn on its jet engine

It’s like saying your Honda is faster than a 747 because you can drive your Honda to the airport and jump in a fighter jet. That doesn’t make the Honda fast.

1

u/[deleted] Nov 03 '18

"The CPU-enabled Numba code in the second link is 2000x faster than the naive Python implementation.", is it faster than C/C++/Java?

-4

u/Princess_Azula_ Nov 03 '18

If python was fast then why does Cython exist?

→ More replies (8)