Live data from Hacker News

Python has brought computer programming to a vast new audience

economist.com

61–70 of 268 posts

Re: Python has brought computer programming to a vast new audience

#61

For some reason, I never liked Python. I don't know... its classes look weird with all those self, __init__, etc. The __init__.py for packages is also a strange choice to me. It has classes, but no interfaces. The language is even slower than PHP. Does Python have type hinting? What all the hype is about? I just don't get it.

Yes, Python has type hinting since 3.5[1].

https://www.python.org/dev/peps/pep-0484/

Re: Python has brought computer programming to a vast new audience

#62
post #22

There seems to be a sentiment that Python is a kids language - but I think of Python as a language that scales with your experience. You can do some really interesting and complex things and I’m really appreciative of my deep understanding of the language through a decade of heavy use, open source contribution, and project ownership. Recently I released a package which allows you to dynamically create or change funct…

> There seems to be a sentiment that Python is a kids language

I only hear this from developers that have never used Python or work in problem domains where the language is genuinely not better (e.g. low-latency distributed services, embedded devices/IoT sensors).

I've scaled Python & PHP web apps to a hundred million monthly visitors on Top 20 US destinations on very limited hardware (6-10 machines). It's surprising how much you can get out of the language if you know how to take advantage of the strengths.

Re: Python has brought computer programming to a vast new audience

#63

Am I the only who thinks that "90% of American parents want their kids to be computer scientists" is rather unsettling? The market is currently full of people who are in for the money and will continue to be. It will be filled with people until supply meets demand. That the salaries will drop significantly is a natural result of this. We had this pork cycle for teachers, doctors and other highly trained people. No on…

Is there strong evidence that this will happen anytime soon? I've heard many arguments that claim this wouldn't happen anytime soon, particularly because of the level of difficulty and the required determination.

I don't know the situation in the US, but here in Germany the companies always say "Oh no, we don't have enough computer scientists" and continue to pay low salaries. Many people thought that CS grads were needed and chose it, but they earn average salaries and sometimes even have to fight for the good seats.

Our definition of skill shortage is that there are only 3 applicants for one open position. This means a skill shortage doesn't mean there's no one. It means that there are 3 people hoping for the job, but the companies would love to see as many as they can so they can push the salaries down.

> particularly because of the level of difficulty and the required determination

Maybe my imagination is limited, but I think there's a finite set of things we need until it gets exponentially harder to make big leaps (all industrial nations suffer from this phenomenon in advanced sectors) - basically the law of diminishing marginal returns [1]. And we will continue to improve the developer experience so it gets easier to build computer programs.

[1]: https://www.investopedia.com/terms/l/lawofdiminishingmargina...

Re: Python has brought computer programming to a vast new audience

#64

For me it's somewhat strange that it is universally presented as a beginner's language. Python would be hugely confusing to me if I didn't keep the underlying C model -- dynamically allocated objects with reference counts -- in mind at all time. Together with a lot of protocol that is largely arbitrary.

Can you provide an example of why you need to understand the underlying C model?

I don't think I've ever considered it when writing a Python program.

Re: Python has brought computer programming to a vast new audience

#65
post #30

> But in the past 12 months Google users in America have searched for Python more often than for Kim Kardashian, a reality-TV star. This seemed so unlikely that I thought the Economist had incorrectly used the Google Trends comparison tool, but they are right: https://trends.google.com/trends/explore?geo=US&q=%2Fm%2F05z... The gap is even bigger when you consider a worldwide audience (i.e. one less focused on America…

To be fair, a single python dev is going to search for queries about python dozens of times per day. Even the most ardent Kardashian fan is unlikely to search for Kardashians in any volume even close to that.

Re: Python has brought computer programming to a vast new audience

#66

For me it's somewhat strange that it is universally presented as a beginner's language. Python would be hugely confusing to me if I didn't keep the underlying C model -- dynamically allocated objects with reference counts -- in mind at all time. Together with a lot of protocol that is largely arbitrary.

When teaching Python to beginners, I struggle with the concept of mutability -- e.g. `sorted(mylist) vs mylist.sort()` without being able to refer to the concepts of memory and references. But it's not a terrible obstacle if you drill in extra adherence to logic and testing and jumping into REPL. After enough trial-and-error with `x is y` `x == y` and `id(x)`, the abstract concept comes through without having to acknowledge the existence of reference count.

Re: Python has brought computer programming to a vast new audience

#67

Read the comments here. Look at the diversity of opinions and the number of them that, while professing love for Python, directly contradict each other. Python is verbose|concise, simple|advanced, disciplined|experimental, modern|classical. It goes to show: something doesn't need to be actually-better. It doesn't need to be actually-simpler. It doesn't need to make your job easier or better. It needs to make people t…

> Python is not, in any way, revolutionary. Several contemporaries exist with similar design constraints.

I think it was revolutionary in its own terms. For example, list slicing was revolutionary and it reduced many lookups to the minimum. Sure, it was implemented by other (not so popular) programming languages before but not in addition of many other features like easy interpreter embedding, good reflection/metaprogramming, straightforward bindings, unicode, etc.

Now in 2018 all these things are discussable and we can objectively criticize eternal issues (e.g. interpreter lock) but Python showed that you can write applications in a concise way without a lot of boilerplate. I would love to see a programming language that progresses from this point.

Re: Python has brought computer programming to a vast new audience

#68
post #48

For some reason, I never liked Python. I don't know... its classes look weird with all those self, __init__, etc. The __init__.py for packages is also a strange choice to me. It has classes, but no interfaces. The language is even slower than PHP. Does Python have type hinting? What all the hype is about? I just don't get it.

What other language are you comparing Python's flaws and tradeoffs to?

Java, PHP, C#, heck, even JavaScript/ES[6,7]. I feel like Python has a lot of its own ways of doing things, whereas a more idiomatic approach is imho a better way to go. Why the hell in the world would you call a class constructor as __init__? Pretty much every popular OOP language does it either by naming a constructor the same name as the class name or through some form of a `construct` notation. Why `self` and not `this`? I mean, I know that the language has a very low entry barrier, but wouldn't it make sense to design it in a more traditional way?

    if __name__ == '__main__':
        main()
Code like that just doesn't make any sense to me.

Re: Python has brought computer programming to a vast new audience

#69
post #30

> But in the past 12 months Google users in America have searched for Python more often than for Kim Kardashian, a reality-TV star. This seemed so unlikely that I thought the Economist had incorrectly used the Google Trends comparison tool, but they are right: https://trends.google.com/trends/explore?geo=US&q=%2Fm%2F05z... The gap is even bigger when you consider a worldwide audience (i.e. one less focused on America…

I put in Beyoncé (with or without accent) and Kylie Jenner, and Python still looks higher on most days. Surprising.

Re: Python has brought computer programming to a vast new audience

#70

Earlier quoted context omitted.

Other than interfaces and generics (which would make no sense to add in Python, since it's dynamically typed), can you name some OOP features Java has that Python doesn't have?

> can you name some OOP features Java has that Python doesn't have? Encapsulation. In Python you can write code in an OO style and benefit from inheritance, but it’s really only good for people writing libraries and frameworks. For end user code, objects are best avoided because they can pick up state in unexpected ways, which leads to problems that are extremely difficult to debug.

[deleted]
Post reply on HN