Live data from Hacker News

Python has brought computer programming to a vast new audience

economist.com

91–100 of 268 posts

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

#91
post #80

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…

A Javascript array comprehension [0] in theory is similar to a Python list comprehension [1]. However, the slight difference in syntax makes Python dramatically easier to read and write. Javascript dropped the feature. Pythonistas use it often. Many programmers, even Python core devs, don't understand what makes one syntax more readable than another. [0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...…

"However, the slight difference in syntax makes Python dramatically easier to read and write"

Please prove it.

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

#92
post #57

Earlier quoted context omitted.

It is not a problem, it was just non expected behavior for someone trained in strong typed languages. For example, you want to calculate the performance of your ML algorithm by counting the correct predictions / total. My expectation was that the result of a division of integers, would be a float, specially if the modulo is not 0.

In what strongly typed language does the division of two integers result in a float?

Many languages are not strongly typed (where "strongly typed" means "variables must be predeclared with their types (though they may be inferred)"). If your only experience is with strongly-typed languages, then MANY things about Python will be different, because Python is one of many languages that is not strongly typed.

For example, in Scheme (a Lisp), a division (/) presented with exact input values and a non-zero denominator will produce an exact value (an integer or rational). E.g., (/ 1 2) produces the exact fraction 1 divided by 2, and not 0.

In addition, both Scheme and Python have different ideas of what an "integer" is, e.g., both are happy to compute the exact value of 2 to the 9999 power. There's no requirement that "integer" correspond to the underlying machine integer.

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

#93
post #53

Earlier quoted context omitted.

> 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 think it does that. I don't agree with that takeaway. You ask us to consider all the diversity of opinions here, but then you evaluate them out of context, what one person says about Python is not necessarily in reference to the metrics tha…

> Why do you think Python, or any programming language, has to be "revolutionary" -- or engage in cultmindthink -- for it to become popular? I don't think it has to, and I didn't say you HAVE to. I'm saying that you can accomplish the goal with a community that prides itself on ignoring things. Python's community is even more insular and ensconced in their opinion than editor proponents. Most Vi proponents can tell y…

I guess I don't understand what your point is, I even less understand how you measure it, as you don't even offer up a particular language feature or PEP in which Python's purported ignorant groupthink has influenced, or even an outlandish personal anecdote ("This one guy tried to convert all our codebases into Python...").

I guess I can't personally relate since I came from Python after C/JS/Ruby/PHP and have done so not out of delusion or hype. Maybe your perception is based on having met a lot of non-erudite Python developers. Which wouldn't directly contradict the basis of the submitted article, which is that Python is an incredibly popular language, i.e. one that attracts the masses.

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

#94
post #80

Earlier quoted context omitted.

A Javascript array comprehension [0] in theory is similar to a Python list comprehension [1]. However, the slight difference in syntax makes Python dramatically easier to read and write. Javascript dropped the feature. Pythonistas use it often. Many programmers, even Python core devs, don't understand what makes one syntax more readable than another. [0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...…

"However, the slight difference in syntax makes Python dramatically easier to read and write" Please prove it.

The evidence is in the usage. As I said, Javascript decided it was a bad idea, despite its popularity in Python.

Your phrasing is a little aggressive, so I'm guessing this is one of those discussions where there's no real chance to change your mind, but I'll give it a shot.

Consider one of the most friendly languages, SQL. Python comprehensions follow the same pattern as SQL.

    SELECT expression FROM table WHERE condition
    [expression for name in sequence if condition]
Javascript put the expression at the end.

    [for (name of iterable) if (condition) expression]
Putting the expression first makes the language more declarative. The easiest languages -- SQL, HTML, etc. -- are declarative, not procedural or functional.

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

#95

Earlier quoted context omitted.

from __future__ import braces I hated the white-space thing until I discovered that. For whatever reason this made me get over myself and learn to love the tab/space argument that is somewhat akin to the vi/emacs argument.

Oh, I see. I use spaces and vim (I do, but who cares). Let's start a flamewar. /s Every time I think about tabs/spaces, I think about that episode in Silicon Valley [1]. Hilariously accurate, I have the exact same feeling when somebody uses the mouse to copy something or navigate. The cringe makes me feel alive (I guess this is the ultimate reason for those flamewars. And neurotic tendencies, of course). [1]: https:/…

Haha. When we watched that episode my wife was like, “...wait, what, is that a real thing?!” Only true computer geeks could possibly understand.

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

#96

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…

I believe SQL is "the most deployed programming environment family in human history". SQLite is seemingly everywhere.

Your second paragraph does not follow from the first. It could instead be that HN commenters are poor at this sort of analysis, or that people in general are poor at this sort of analysis.

What were the contemporaries with similar design constraints? I started looking at Python in 1995, and the major alternatives were Perl and Tcl. I don't remember anything close than those to Python.

I agree that Python is not revolutionary. I don't agree with your statement "avoiding any other aspect of programming". Van Rossum's ABC experience strongly influenced his ideas in how programming should be accessible to non-professional programmers, and that type of design is certainly an aspect of programming, though often overlooked.

I really don't understand "forcing it on more and more people." In some sense it's true - Python is a widely used teaching language, and as such the teachers are forcing ever more students to learn it; Python is the de facto required language for a number of fields, so again people are 'forced' to use it because their tools are often in Python.

But I don't think that's the type of force you mean?

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

#97
post #86
post #52

Earlier quoted context omitted.

This may sound super n00b but I really like that Java is explicit about everything. So for instance, you explicitly specify variables, methods as private with the keyword 'private'. In python you have to use an underscore, and its still not really private, its obfuscated. That's just one example, but in general I really like that kind of by-the-book verbosity, instead of having to mentally map it into the OOP concept…

Why would you want to actually enforce privacy? That makes it harder for the user to patch. Better to provide a mild discouragement via "_name".

Because in traditional object-oriented design you would extend rather than patch. It's the open-closed principle.

There are many benefits to enforcing privacy, and one of the biggest ones is that you can make changes to the internals of your library without breaking your users' code, because they never had access to the internals.

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

#98

Earlier quoted context omitted.

I really dislike converting Python to a different language. What type is this? Go 5 libraries down to find out ;)

That's a common misunderstanding. Python's type system is in the unit tests necessary to ensure the code is doing what it should. This is a boon because all of the behavioral rules are co-located for efficient reference. ;)

It's more a traits system than a type system. Who cares if it's a list so long as I can append to it?

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

#99

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.

Ironically, the PEP to add this to py3k is what's causing all the fuss in pythonland lately.

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

#100

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.

No interfaces?

    from collections.abc import Sequence
Slower?

    import numpy as np
Post reply on HN