Live data from Hacker News

Why Python keeps growing, explained

github.blog

61–70 of 459 posts

Re: Why Python keeps growing, explained

#61

Comparing Python to Java 8 and saying it’s more readable isn’t showing much. And it’s not very portable the second dependencies with native code (which is common since pure Python is too inefficient for many tasks) are used. I think Python is popular for two reasons: - it’s believed to be beginner friendly compared to other languages. I’m not really sure why - maybe the whitespace? - it has an enormous set of librari…

> Comparing Python to Java 8 and saying it’s more readable isn’t showing much.

It shows an obvious reason why a lot of beginners choose python, even when learn Java basics in university first.

Re: Why Python keeps growing, explained

#62
post #35
post #11

Python keeps growing in number of users because it’s easy to get started, has libraries to load basically any data, and to perform any task. It’s frequently the second best language but it’s the second best language for anything. By the time a python programmer has «graduated» to learning a second language, exponential growth has created a bunch of new python programmers, most of which don’t consider themselves progr…

There's also the argument that at a certain scale the time of a developer is simply more expensive than time on a server. If I write something in C++ that does a task in 1 second and it takes me 2 days to write, and I write the same thing in Python that takes 2 seconds but I can write it in 1 day, the 1 day of extra dev time might just pay for throwing a more high performance server against it and calling it a day. A…

If Python was merely twice as slow then I could agree with you.

Re: Why Python keeps growing, explained

#63
post #59

Earlier quoted context omitted.

A lot of Java's verbosity isn't so much from the language, but from when the code was written. It happened to come to popularity at a time when big over-engineered Gang of Four-style design was hot . So you get a lot of code written in this over-engineered fashion where half the classes have names that end in DelegateFactoryFacadeMessengerImpl. Some of it is the language too, but modern Java can definitely be reasona…

Java is still good for several use cases, which were popular at the time, or let's say much more code was needed. Now in the Enterprise world you have much better no- or low-code tools. But in large teams all of these public/private/protected key words are quite nice. Totally unnecessary for a small codebase. But Java with its great runtime, verbose patterns is great for web server applications in large teams. I woul…

Protected data was never as useful to me as package-only data. The former is only relevant with inheritance hierarchies, whereas the latter is more open while also restricting access only to other classes in your com.example.concern package. Extremely useful for keeping big teams on the right track.

Re: Why Python keeps growing, explained

#64
post #7

Eh, they're just a lot of ways to say "path dependence". Scripting languages are basically the same exact technology with respect to each other. In the alternate universe where numpy and scipy are, let's say, numruby and sciruby, wouldn't we be here asking why Ruby keeps growing? That's not a sales pitch for python, it's a sales pitch for the concept of a scripting language; it's like saying "you should really buy a…

Luck of libraries and initial userbase are certainly involved in success, but not all scripting languages are equal. I mean we could add bash to that list then. In fact I'd argue that python enjoying the success it has, despite probably the worst handling of a version bump in any language (2->3), is a testament to its popularity.

The worst version bump ever seen was Perl 6 which literally became another language (Raku).

Re: Why Python keeps growing, explained

#65
post #35
post #11

Python keeps growing in number of users because it’s easy to get started, has libraries to load basically any data, and to perform any task. It’s frequently the second best language but it’s the second best language for anything. By the time a python programmer has «graduated» to learning a second language, exponential growth has created a bunch of new python programmers, most of which don’t consider themselves progr…

There's also the argument that at a certain scale the time of a developer is simply more expensive than time on a server. If I write something in C++ that does a task in 1 second and it takes me 2 days to write, and I write the same thing in Python that takes 2 seconds but I can write it in 1 day, the 1 day of extra dev time might just pay for throwing a more high performance server against it and calling it a day. A…

Realistically something that takes 1 second in C++ will take 10 seconds (if you write efficient python and lean heavily on fast libraries) to 10 minutes in python. But the rest of your point stands

Re: Why Python keeps growing, explained

#66
post #11

Python keeps growing in number of users because it’s easy to get started, has libraries to load basically any data, and to perform any task. It’s frequently the second best language but it’s the second best language for anything. By the time a python programmer has «graduated» to learning a second language, exponential growth has created a bunch of new python programmers, most of which don’t consider themselves progr…

There are also programmers who are tired of chasing pointers and simply want to get stuff done.

E.g. people who once wrote "robust" code in Rust but were "outcompeted" left and right by coworkers who churn out shiny new things at 10x the speed.

Re: Why Python keeps growing, explained

#67
post #59

Earlier quoted context omitted.

Java is still good for several use cases, which were popular at the time, or let's say much more code was needed. Now in the Enterprise world you have much better no- or low-code tools. But in large teams all of these public/private/protected key words are quite nice. Totally unnecessary for a small codebase. But Java with its great runtime, verbose patterns is great for web server applications in large teams. I woul…

Protected data was never as useful to me as package-only data. The former is only relevant with inheritance hierarchies, whereas the latter is more open while also restricting access only to other classes in your com.example.concern package. Extremely useful for keeping big teams on the right track.

Yeah I think the problem is better understood now than when Java was originally designed.

Modules/Project Jigsaw is arguably an even better step in the right direction. It arguably allows a much saner granularity of visibility and access.

Re: Why Python keeps growing, explained

#68

The comparison with Java is always a funny one. Consider this: import sys def main( args: list[str], ) -> int: sys.stdout.write(“hi\n”) return 0 sys.exit(main()) Apart from the call to write instead of print everything else there is a standard Python pattern for writing testable, type-safe arg-parsing code! It’s just that you don’t have to write testable, type-safe code if you don’t want to.

The example they give later in the article is also pretty verbose and includes much more "magic" than Java

Example:

  import antigravity

  def main():
    antigravity.fly()

  if __name__ == '__main__':
    main()
I would argue that there is nothing simple about the last if-statement and will probably be very confusing for new developers.

Re: Why Python keeps growing, explained

#69

Earlier quoted context omitted.

> - it’s believed to be beginner friendly compared to other languages. I’m not really sure why - maybe the whitespace? I am leaning more towards it looking like pseudocode > - it has an enormous set of libraries available to use I believe that to be the actual reason. I've long held that python is a kinda bad language, but with FANTASTIC libraries

beginner programmers don't know pseudo code either though! the best teaching language (imo) is one with few features or surprises. I think Scheme might come out top here.

I think Scheme might come out top here.

Depends what you are trying to teach. If you're trying to teach computer science and programming fundamentals, then sure. If you're trying to teach people how to get 'real work' done quickly and efficiently then Scheme will only get in the way and slow people down.

For example when I've taught programming, one of the tasks I taught fairly beginner programmers was to grab some satellite images between certain dates, try to detect if there is a forest fire, measure the spread of the fire and plot the spread on a map.

With python (and its excellent libraries) this is quite quick and easy, and most people are up and running and hacking around with their programs in pretty short order. They find it really cool and inspiring and makes them quickly realise that programming could be something useful in their day to day job. Trying to start with chapter 1 of SICP and Scheme and working up from there to solving the above problem would probably lead to most of these people giving up on programming very quickly. That being said the few people that made it all the way through that would no doubt be much much better programmers because of it.

Re: Why Python keeps growing, explained

#70
post #57

It's interesting that people keep claiming that indentation-based blocks makes Python easier to learn and read. I've been teaching programming to students in banking, finance and insurance for a few years, using Python, and my experience with them is the opposite. They have been struggling with that a lot. They didn't pay too much attention to white spaces and tabs, probably because they are "invisible", and couldn't…

> Explicit block markers are much easier to teach. The point of communication is to express something in a way that the listener understands it. Simply expressing something that is comfortable or normal to the speaker is simply not useful for either party of the goal is communication.

You're right. What matters is that explicit block markers are easier to learn (from the student's perspective). Being easier to teach (from the teacher's perspective) doesn't matter as much.
Post reply on HN