Live data from Hacker News

Python has brought computer programming to a vast new audience

economist.com

41–50 of 268 posts

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

#41

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.

Would you also find Excel macros hugely confusing if you didn't know the underlying C model? Because I think that's the level of programming that the masses are doing.

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

#42
post #16
post #6

Earlier quoted context omitted.

Can you explain implicit type conversions problems in python?

bools can be silently converted to int. 1 + true is ok, but 1 + "true" throws. Sometimes you do want to do math on bools, but it would avoid a class of errors if they would make you wrap them in 'int(the_boolean_variable)'.

issubclass(bool, int) == True in Python 2. They're not converted to ints silently they are ints.

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

#43

The thing I love most about the language is its conciseness, on several levels. It's syntactically concise because of its use of whitespace and indentation instead of curly braces. Expressions are often concise because of things like list slicing and list expressions. It can be linguistically concise, because it is so easy to fiddle with the data model of your classes, to customize their behavior at a deeper level. F…

"Besides the odd gripe here and there, the language really gives me a warm glow." That's a perfect summary of my feeling towards it, too. If the PSF puts up a GoFundMe for sending Guido on a nice vacation of his choosing, I will be happy to chip in a few bucks. Same goes for Linus when he hands over the reins, and a few other maintainers who probably cannot be adequately compensated for the impact of their work.

[deleted]

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

#44

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.

In all this time I didn’t even know python uses reference counting instead of tracing gc...

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

#45

Not only is Python easy to learn for beginners, it allows for some deeply expressive constructs and patterns that are difficult or impossible in other languages. This is why even though I started with C/C++ and Java pays the bills, Python is where my heart is. Thanks Guido.

Well yes, if you come from C/C++/Java, Python is going to feel that way ;)

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

#46
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 one is benefitting from too many people who drive the prices down (although I'm not gonna say something as an employer, companies are happy about it - the profit margin will shrink but this can be compensated for using scaling). Those that are in for the money will leave (or continue to suffer in an unfulfilling job) and those that have passion can't sustain themselves (we can see this trend in indie game development today).

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

#47

The thing I love most about the language is its conciseness, on several levels. It's syntactically concise because of its use of whitespace and indentation instead of curly braces. Expressions are often concise because of things like list slicing and list expressions. It can be linguistically concise, because it is so easy to fiddle with the data model of your classes, to customize their behavior at a deeper level. F…

> My big regret with Python 3.0 is that the scoping rules in list expressions changed to prohibit modification of variables in surrounding scope. This degraded the utility of list expressions. The work around is so long-winded. Can you elaborate? I'm not sure what this is referring to.

In Python 2, "[x for x in range(10)]; print(x)" prints 9. x is available outside the list comprehension.

In Python 3, it raises a NameError, because the x in "print(x)" is not defined. It's contained in the list comprehension.

But I don't know a good use of the Python 2 behavior.

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

#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?

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

#49
Someone else said this on HN: Python is the second best language in almost every field of computing.

That's why there's a library for everything in Python.

It's limitations are also not terrible for most people. If you want super fast, you will know how to do that some other way. If you just want simple and easy to read, you use Python.

Post reply on HN