
Python has brought computer programming to a vast new audience - leonagano
https://www.economist.com/science-and-technology/2018/07/21/python-has-brought-computer-programming-to-a-vast-new-audience
======
riazrizvi
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. For
example, it is so quick to design a suite of classes that have algebraic
operators, which leads to elegant mathematical expressions of your custom GUI
objects for example. But you can also change the way classes are instantiated
by overriding Class.__new__ which I've used to make powerful libraries that
are a joy to use.

Further elegance can be added through creative use of the flexible argument
passing machinery, and the lovely way that functions are also objects.

Your application architecture tends to be concise because there are so many
existing libraries, you can often design your application at a more
interesting higher level. For example, you don't have to worry about the size
of int's.

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.

Besides the odd gripe here and there, the language really gives me a warm
glow.

~~~
throwaway5752
_" 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.

~~~
stevesimmons
I agree. I came to Python in 2000, after Perl (1996-1998), PHP (1999), Matlab
(1992-1996), C++ (1990), Fortran (1989), C (1988), Pascal (1988), Assembly
(1984-86) and Basic (1981-83).

After all those, I found Python, as the saying goes, really does "fit your
brain" [1]. Since discovering Python 18 years ago, I have looked at Haskell,
successfully avoided Java, and promised myself to "one day" do more JS. Still,
Python remains 95% of what I do, and I don't see a problem with that :)

[1] "Python fits your brain" was the theme of the 9th International Python
Convention in 2001.

~~~
dorfsmay
> "Python fits your brain"

For me, I find using python is like touching both data and code with my hands.

As much as it's trendy to bash Object Oriented languages, the way python
allows to lookup all variables and method on a class or an object makes it
like using your hands:

dir(MyClass) help(MyClass) dir(my_object) help(my_object)

etc...

~~~
opnitro
If you'd like to go further along that path, and I'd really recommend trying
to learn a lisp. How to Design Programs[0] is good gentle introduction if
you're new to the ideas of lisp or functional programming, and SICP[1][2] is
the old classic.

[0]
[http://www.ccs.neu.edu/home/matthias/HtDP2e/index.html](http://www.ccs.neu.edu/home/matthias/HtDP2e/index.html)

[1]
[http://web.mit.edu/alexmv/6.037/sicp.pdf](http://web.mit.edu/alexmv/6.037/sicp.pdf)

[2][https://www.youtube.com/watch?v=2Op3QLzMgSY&list=PLE18841CAB...](https://www.youtube.com/watch?v=2Op3QLzMgSY&list=PLE18841CABEA24090)

~~~
dorfsmay
Which one though?

I have looked at LISPs, but it's difficult to pick one to invest time in.
Because I am so restricted on time I have to stick to languages which are used
in the industry (so my fun has real-life ROI), which I think boils down to CL
which is often touted as old-fashion and its market seems to shrink slowly,
and Clojure which means the JVM and mainly Java libraries and high mem
requirements.

For pure fun and practicality, Racket does seem up on the "list", but not used
at all in the industry. A lot of languages (Python, Rust) are adopting the
good parts of lisp (except for the minimal syntax, sadly), and I'm getting
better mileage from spending time learning and becoming better at those than
starting from scratch in a language that I won't be able to use during work
hours.

~~~
opnitro
So, I really like How To Design Programs, because the thing it got across for
me is how to appropriately think in a functional way. It walks you through
building data structures and full programs in a really nice method. I've now
been going through SICP, and nothing has seemed out of place as the notation
is almost identical, and the few places that it isn't are not hard to
translate.

~~~
dorfsmay
My question was more about which program language, which Lisp to choose in
2018?

~~~
opnitro
Oh, so How To Design Programs uses "teaching" languages, which are sub-
languages of Racket. Going from that book to learning the full features of
Racket has been fun.

------
danso
> _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...](https://trends.google.com/trends/explore?geo=US&q=%2Fm%2F05z1_,%2Fm%2F0261x8t)

The gap is even bigger when you consider a worldwide audience (i.e. one less
focused on American gossip):

[https://trends.google.com/trends/explore?q=%2Fm%2F05z1_,%2Fm...](https://trends.google.com/trends/explore?q=%2Fm%2F05z1_,%2Fm%2F0261x8t)

~~~
chatmasta
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.

~~~
kjeetgill
If we're using Google to approximate mind share them it's skewed way farther
than that. Nobody who follows the then is sitting doing Google searches.
They're already following them on Snapchat, Facebook, Insta, and Twitter.

You only get searches with breaking tmz news.

... I say this with detailed observations of my girlfriend's media habits.

------
lordnacho
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.

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

It isn't. Frankly, it isn't even top 3 in any "field of computing" depending
on how you define "field of computing".

What python has going for it is the evangelists who do a great job of
spreading the word and of course funding - they have lots of money backing the
language. Also, being an interpreted language, it has a much lower barrier to
entry.

I'm not much of a fan of python and its block syntax - I very much prefer
braces or markers delineating the beginning and end of code blocks.

Also, python wants to be everything ( functional, OO, imperative, etc ) and
hence is the worst language to learn programming language topics in my humble
opinion.

My hope is that python will serve as a "gateway drug" to other languages like
ruby, ML, C/C++, SQL, etc. So that people will learn what programming and
languages are rather using python as a glorified calculator which I'm sure
many are doing.

~~~
timb07
"My hope is that python will serve as a "gateway drug" to other languages like
ruby, ML, C/C++, SQL"

Your inclusion of SQL in that list really shows you have no idea what you're
talking about.

~~~
rs86
SQL is immensely successful.

~~~
talltimtom
Yea, so is HTML, but if someones list of useful programming languages went C#,
HTML, ruby, SQL. You would have to admit too that you would consider that
person very inexperianced. It’t like listing a blender in a list of your
favorite power tools. It’s not that it’s not useful for what it does, it just
doesn’t belong in that particular comparison.

~~~
ianai
SQL stands for standardized query language.

~~~
grzm
It was originally SEQUEL (Structured English Query Language) and then changed
to SQL (Structured Query Language) due to acronym conflict with Hawker
Siddeley's trademark.

[https://en.wikipedia.org/wiki/SQL#History](https://en.wikipedia.org/wiki/SQL#History)

------
KirinDave
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 _think_ it does that.

Python is not, in any way, revolutionary. Several contemporaries exist with
similar design constraints. But Python persists because it's created a
community that considers itself hygienic for avoiding any other aspect of
programming. And by doing this, it can be superlative in any aspect it wants
to be. It simply conjures the worst example from any given competitor and
those are, by proxy, pushed onto all of them.

Did we see a glowing review of how Javascript did this? No. Javascript,
despite being the most deployed programming environment family in human
history, didn't do this. Python did. Because it says so, over and over.

Even if you disagree with that assessment, I think Python has had a lot less
to do with pushing python to new audiences. Its community has projected it
outward with an impressive degree of vigor over the years, forcing it on more
and more people.

~~~
eesmith
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?

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

How many computers have a browser on them vs an interactive and instructable
version of an SQL server?

~~~
eesmith
You'll need to define some terms here. What is a "programming environment
family"? Does BASIC in its various forms count? That includes Visual Basic and
VBA.

Do people need to use it, or could it just be sitting there, like BASICA.EXE
on an old MS-DOS distribution?

For that matter, the DOS shell is still hanging on, and it's a programming
environment.

Most people use browsers on a smart phone or pad, with (as I understand it) no
access to a programming environment.

SQLite is not a server.

~~~
KirinDave
I think that BASIC might actually be the dark horse I haven't considered here!
Nice! I wonder if the fact that it isn't shipped on the other platforms evens
that out though.

I just pulled out my surface book and Basic doesn't seem to be on my command
line. I wonder if that's unique.

> SQLite is not a server.

Did I imply it was? SQLite is not a programming environment when shipped,
either. An SQL server with a sufficiently large editor buffer might be able to
squeak by as one.

------
throwaway5752
I remember _hating_ the whitespace thing so much when I started with Python
circa 2.4, but have really come to love the language in a lot of domains since
then.

A huge, huge "thank you" to Mr. van Rossum for creating this quirky language
that I've become so fond of and for the countless hours of his life he's given
to the project.

~~~
irishcoffee
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.

~~~
mockingbirdy
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://youtu.be/SsoOG6ZeyUI](https://youtu.be/SsoOG6ZeyUI)

~~~
jacobwilliamroy

      :set ts=8 sts=0 sw=8 expandtab
    

I have secrets.

~~~
kjeetgill
Thank you for this. I've been typing out:

:set tabstop=4

:set shiftwidth=4

:set expandtab

Like a pleb for years. What's sts?

~~~
gjvc
Put them in your .vimrc, and put your dotfiles in git.

Hint: searching GitHub for "dotfiles" can be a fun and productive way to spend
a Friday afternoon :-)

~~~
kjeetgill
I mean locally yes, but I'm poking around on servers frequently enough and
writing python there (Hey, I'm no saint) that it gets committed to memory
eventually.

------
dfee
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
function signatures and went deep into `typing` and `inspect`, and found the
experience rewarding.

[https://pypi.org/project/python-forge/](https://pypi.org/project/python-
forge/)

~~~
tomnipotent
> 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.

~~~
antt
Even IoT sensors are easier to program with micropython.

What I find worrying is the the language is changing to suit those people,
e.g. type hints, rather than teaching them learning to use the language. You
don't complain you can't use a hammer as a screw driver, you just don't use a
hammer.

~~~
StavrosK
I agree that sensors are easier with Micropython and will use that if I can
(unfortunately the C++/Arduino ecosystem is much, much larger). However, type
hints are a fantastic feature and I can't recommend them enough to anyone who
writes software for a living. It makes maintenance at least an order of
magnitude easier.

~~~
antt
1). C++/Arduino for micro controllers ends up using more memory than
micropython. I've managed to get the binary sizes to 1/4 by doing cross
compiles and linking things my self.

2). Types hints are a terrible non-pythonic kludge to solve a people problem
in code. People who want to write java with whitespace and no curly brackets
love them. CPython has made a number of bad decisions lately that make the
language less usable. I've moved quite a bit of my everyday code to PyPy.
Since they eat their own dog food they are keeping their dialect sane.

~~~
StavrosK
Type hints are optional, why not just not use them?

How are you going to know the type of an object that gets passed to a
function? Why is it better to go around the codebase looking for things
instead of glancing at the function signature?

~~~
antt
The type (class really) of an object tells you nothing about how it will
behave. What you need to do is check the methods attached to the object, not
class, at runtime:

1) Exist.

2) Behave how you want them to behave.

I've written plenty of code that got that done by using an assert just after
the docstring.

People will monkey patch, if not in your code base, than in a library you're
importing.

------
andreygrehov
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.

~~~
cm2187
Agree. I can't understand people praising the lightness and readability while
at the same time stuffing their code with underscores. Also it seems often
inconsistent. Like some functions are used as prefix (len(x)) while other are
suffix (x.clear()), I assume for historical reasons. Or like the "b if a else
c" which reverse the logical order (you evaluate the condition then you can
tell if you go one way or another). Same for [x for x in list], the Linq
approach is more logical (for x in list select x).

I understand why people like it. And I like scripting languages, it's nice to
find a piece of script somewhere and being able to edit it directly having to
find the correct source code and recompiling. But it has lots of shortfalls
and quirks too (multi-threading, dependencies management, deployment, no
refactoring/static checking, python 2 vs 3, 50 different kinds of strings,
APIs full of abbreviations which probably meant something to their creators 20
years ago, etc).

It's a nice language, among others. Not an "ultimate" language by any means in
my opinion.

~~~
meowface
Those are all valid gripes, but for most use-cases (where performance isn't
critical), I haven't found anything better than Python yet. Ruby is an
aesthetically nicer language and doesn't have those issues you mentioned in
the first paragraph, but the Python ecosystem is amazing and better than
Ruby's IMO. And compared to most other languages Python still feels very
clean, terse, and pretty to me.

>multi-threading

Most interpreted languages have a GIL, sadly. But yes, this is annoying.

>dependencies management

Annoying, but resolved in part with new projects like pipenv, and also still a
big issue for other popular languages.

>deployment

Also helped by pipenv, and Facebook's xar
([https://github.com/facebookincubator/xar](https://github.com/facebookincubator/xar))
is new but looks promising.

>no refactoring/static checking

It's a dynamic language. But this is now possible to some extent with type
hints.

>python 2 vs 3

They did screw this up, yeah. Python 3 fixes a ton of issues and is a better
language, but the backwards incompatibility created way too many problems.

>50 different kinds of strings

There are 2 kinds: bytes and unicode.

>APIs full of abbreviations which probably meant something to their creators
20 years ago

Can you give some examples? This is an issue in a few of the old standard
libraries, but even then it's not too common. This is way, way more prevalent
in PHP and C than in Python.

~~~
cm2187
> There are 2 kinds: bytes and unicode.

No I mean single quote, double quote, triple double quotes, r prefix, u
prefix, f prefix, combinations, etc

> Can you give some examples

The one I have in mind is the os library, which I use a lot (like why
st_mtime?).

~~~
meowface
>No I mean single quote, double quote, triple double quotes, r prefix, u
prefix, f prefix, combinations, etc

These are all extremely helpful, though. All of those quote combinations are
equivalent, and can be used to prevent having to escape quotes within the
string. The u prefix is gone from Python 3, r is a raw string (which many
other languages have, like C#'s @ prefix), and f is a new feature which
generated a lot of debate but basically allows interpolation similar to Ruby
and ES6.

>The one I have in mind is the os library, which I use a lot (like why
st_mtime?).

That's the one I thought you were going to bring up. I agree the naming
conventions in the os module have a lot of warts. The function names could use
a refresh.

~~~
eesmith
You wrote "These are all extremely helpful".

I disagree, in that I think they are only somewhat helpful. If we only had
double-quoted strings, and not single-quoted strings, then I think there would
be little difference to the language or its quality of use.

Going back to the question of "why st_mtime?" \- that's because os.stat() is a
wrapper around the POSIX stat(2) system call. My FreeBSD man page defines it
as:

    
    
       st_mtim   Time when file data last modified.  Changed by the mkdir(2),
                 mkfifo(2), mknod(2), utimes(2), write(2) and writev(2) sys-
                 tem calls.
    

The Python implementation of stat for MS Windows is basically doing its own
emulation layer for POSIX compatibility.

------
random_upvoter
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.

~~~
danso
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.

~~~
alimw
Hardly a beginner at programming, but I also struggled with this when I picked
up Python recently. The documentation doesn't make it obvious when functions
have this sort of side effect, so like your students I play with the REPL to
establish exactly what a function will do. Even then an unexpected side effect
was the source of the single most perplexing bug in my program. I imagine that
in complex programs this philosophy of sometimes-mutability-sometimes-not must
lie at the root of a huge amount of programming error.

------
mockingbirdy
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).

~~~
booleandilemma
Maybe it makes sense to encourage your kids to go into blue collar jobs. In a
future teeming with code monkeys, plumbers and electricians are going to be
highly valuable.

As for the current career programmers, maybe we should unionize before our
jobs are being taken by kids coming out of 2 week bootcamps (who have been
taking programming classes since kindergarten).

~~~
Tade0
_In a future teeming with code monkeys, plumbers and electricians are going to
be highly valuable._

As a person who repaired quite a few toilets in their life

 _As for the current career programmers, maybe we should unionize before our
jobs are being taken by kids coming out of 2 week bootcamps (who have been
taking programming classes since kindergarten)._

I've seen such people(well, they started learning in primary school, not in
kindergarten, but nevertheless) and two things stand in the way of this
scenario:

1\. Barely anybody likes this line of work. I've had people who would really
use some extra cash outright refuse to learn our trade because they found it
boring. Apparently Our unique skill in the job market is an immunity to
boredom.

2\. There's more to this job than programming. There's also working in teams
which, despite the focus of pretty much every western education system on
this, is something that people seem to learn only after a good few years of
full-time work.

Also people fresh out of college/bootcamps tend to fall for the typical "nerd
traps" like trying to build beautiful abstractions where there is no time nor
need for that.

~~~
mockingbirdy
> Apparently Our unique skill in the job market is an immunity to boredom.

This is about right IMO. Most of the work is seriously boring. I was in
meetings talking with software developers about API interfaces of legacy
systems (with monologues about the intriguing question: "Why is the <insert
stupid decision> a thing we have to stick with?" \- answer is always backwards
support, btw) and I couldn't understand _why are they sitting here and why do
they think their life is well spent doing that_? Anything is better - and they
earn €3500-4500/month, so it isn't even that much for their 5-10 y/o careers.

Everything is better than this. I love programming, I've started when I was
10-11y/o, but I hate most things in the software industry. I love to program
my own little tools, but I've become so fast building CRUD applications and
apps that I have 200-300% efficiency (and thus a very high hourly rate) but
I'm simultaneously so seriously bored that I have a hard time focussing on
work because it's always the same.

\- - -

> I've seen such people

Me too: I've seen a kid (maybe 15-16) that has no A-level and dropped out of
the 9th grade to work in a startup. Without any shares. I think he makes
€10/hour maximum. I was 2 years older than him at that time and worked as a
freelancer and had much more experience. Even 2 years earlier I had more skill
than him. And I would never have considered to drop out of school back then
because it's hilariously naïve. I can't understand how the startup could
support it without any moral conflicts. Exploiting 15y/o and encouraging them
to drop out is something I don't want to be involved in. But I guess this will
happen a lot more in the next few years which is sad.

> Maybe it makes sense to encourage your kids to go into blue collar jobs.

Yeah, don't expect anything like a developer salary. Not even half of it.

My grandfather and my uncle have a blue collar company. They're operating with
a 10% profit margin - sounds good, right? Wrong - if one of their employees is
sick, they get into money problems really quick. Normally every employee needs
to earn the company 2-3x of his salary to compensate for random events. They
can't do that because the market doesn't allow them to - other people would do
it for less than them and the quality is the same. Supply and demand will
eventually lead to diminishing returns in all sectors. And if plumbing is too
damn expensive, we have better incentives to automate the whole job.

------
lainproliant
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.

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

------
sputknick
Very appropriate timing. My son wanted to learn programming, so we started
yesterday with python, using Jupyter notebooks on Azure (notebooks.azure.com).
No setup, easy to create little code snippets, and he can do it all from his
Chromebook. Python is intuitive, simple, useful; best first language in my
opinion.

------
ucarion
In case anyone else was confused by the literary reference, "one with Nineveh
and Tyre" is from Kipling's "Recessional":

[https://en.wikipedia.org/wiki/Recessional_(poem)](https://en.wikipedia.org/wiki/Recessional_\(poem\))

Which, I think, is the poem that made "lest we forget" a well-known phrase
(though the original is from the Bible).

Nineveh (now Mosul, Iraq) and Tyre (in Lebanon) were great cities of their
time, but now mostly known for their ruins. In Britain, they're commonly used
as symbols of foregone empires.

------
pm90
Python is a great language to start programming in. My biggest frustration
with traditional programming languages (well, C/Java mostly) was just how much
upfront effort and understand is required to do useful stuff. Whereas with
python it is pretty easy to whip up a script, read input and transform it into
output in real time etc.

That said, I think its also important for Python programmers to dabble at
least a little bit with Java to really understand how OOP works. Python does
have OOP but it has certain quirks which can confuse newcomers. Java helped to
clarify my understanding of OOP a lot, even though I've only used it
marginally.

~~~
meowface
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?

~~~
pm90
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 concepts.

~~~
xapata
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".

~~~
twblalock
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.

~~~
xapata
You can get that benefit with Python. Name mangling helps. It gets the
benefits of `final` without the annoying enforcement.

Don't stop me from patching your buggy code. If writing an extension is more
efficient, that's how I'd solve the problem.

------
siddboots
I think this comparison [1] in particular explains a lot of Python's continued
success over the past 5-10 years. For a very long time, CRUD back-end
programming was one of the biggest draws of new users to Python. In the last
couple of years, interactive data analysis has completely overtaken it.

[1]
[https://trends.google.com/trends/explore?date=all&geo=US&q=%...](https://trends.google.com/trends/explore?date=all&geo=US&q=%2Fm%2F06y_qx,%2Fm%2F0rphppq)

------
elorant
The great advantage of Python is the vast amount of libraries out there for
pretty much anything you can think of. As a C# developer that's the one thing,
and probably the only, that I envy from Python.

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

~~~
politician
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. ;)

~~~
xapata
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?

------
taeric
This seems misspoken. Python hasn't necessarily brought computer programming
to a new audience. A new audience is being brought to computer programming.
They just happen to be given python as their first steps.

There is nothing intrinsic to python that is helping these use cases. Some
people like it. Some people don't. I have not seen studies showing any real
advantage or disadvantage to it. Do those exist, and I've just missed them?

~~~
xapata
Perhaps. Or perhaps programming instructors like Python better. When I taught
statistics, R was more popular and featureful for the task than Python, yet I
chose to teach my students Python.

~~~
taeric
If the competition is R, I can see how python is a pretty language. I think R
still has prettier charts, with ggplot. However, there can be little argument
that it is a peculiar language.

That said, I don't see much that python really has going for it in the pretty
scenario, either. Most of the examples that make it worth looking at get ugly
as quickly as most any other programming language. And the error messages are
no more helpful than any of a myriad other languages.

None of which is to say I think it is bad. Just I suspect it is getting credit
for some intrinsic quality that doesn't really exist. It is getting used
because it is the language people know is getting used.

~~~
xapata
Not as _any_ other language, but as any recently designed language. They
(almost) all have good REPLs and a decent variety of data structures.

It's easy to compare Python against C or Java and say how great it is, but
against Rust or Dart, maybe not so great. However, popularity has its own
benefits.

Still, compare against Go. There's a major difference in philosophy of
deployment. Python's modularity causes dev ops problems, but it also means
that any user can monkey patch whatever they need. With Go you need access to
the original source, which isn't necessarily provided.

~~~
taeric
Fair, I meant as any comparable language. Though, I confess I suspect people
could make more progress with C and the like than the advocates of python
would like to acknowledge.

And I'm quite fond of lisp nowadays.

------
oh-kumudo
Python's core strength, among the half dozen of language I used in daily work,
is that it is simple and focus on easy human expressiveness.

It is the best example of 'simple is hard' when done right. Its core
abstractions are carefully selected and weaved in a way, using them to
organize/orchestrate your thoughts is just natural and fluid.

Huge thanks to Guido for presenting the world such a meticulously crafted
work.

------
ufo
The Brian analogy was a surprisingly apt way to explain the PEP 572 kerfuffle

------
kankanaads786
It's really interesting. I am a beginner to python an just read the above
article. it's really interesting and I too enjoy coding with python.

------
SilverSlash
I just love Python. It's my favorite programming language for many reasons but
one of them is writing python never feels like the language is working against
you. Python always feels like it's helping you.

------
drpgq
Python is certainly way better for a layman trying to do small things than C++

~~~
whatever1
True, but for me that python was my 4th CL (after fortran, c, c++), there were
lots of gotchas, specially with implicit type conversions, mutable classes,
and passing by value / reference which all seemed quite arbitrary in my first
steps.

Maybe for a complete beginner these are no-issues.

~~~
llukas
Can you explain implicit type conversions problems in python?

~~~
whatever1
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.

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

~~~
dwheeler
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.

~~~
kjeetgill
Double check me on this, but I'm pretty sure your definition of strong types
is wrong; that's static typing.

Python is strongly typed but not staticly. Weak typing is more like 1 == "1"
is true. Aka implicit parsing or casting.

~~~
ufo
Weak vs strong typing doesn't have a standard mathematical definition but you
are correct that it is usually has to do with implicit type conversions.

~~~
kazinator
Decades ago, the Pascal camp hijacked the term for the requirement of explicit
conversions in a static language.

Pascal would be strongly typed because for instance, characters and integers
will not inter-operate without _chr_ and _ord_ , and also floating and integer
conversions must be explicit. This is in contrast with something weakly typed
like C. The weakness in C can be a problem. For instance, a floating to
integer conversion that is out of range of the target type invokes undefined
behavior. Also, when in range, it can produce a value not equal to the
original integer, due to lack of precision. So an innocuous statement like f =
i; that passes static type checks without any required diagnostics can go
wrong. If a cast were required to make the diagnostic go away, then that at
least creates a visible record in the program text that a dangerous conversion
is taking place.

Another use of "strongly typed" in the realm of Pascal is that it refers to
name equivalence for type alias definitions. The C typedef mechanism is weakly
typed because "typedef int user_id_t" doens't create a new type; user_id_t is
the same thing as int, such that a pointer to user_id_t is compatible with
pointer to int and so on.

------
timb07
Nice reference to Karel Čapek's "R.U.R."
([https://en.wikipedia.org/wiki/R.U.R.](https://en.wikipedia.org/wiki/R.U.R.)).

------
MarkMMullin
To me, Python has represented the nice friendly face one can put on the mean
nasty stuff written in C++

------
devin

      python -c "import this"

------
yontherubicon
Archive link for losers like me who can't get past the paywall:
[http://archive.is/8mRZ0](http://archive.is/8mRZ0)

------
vgy7ujm
Meh.. try Perl.

~~~
EGreg
Why?

~~~
vgy7ujm
Peel makes me happy, Python makes me want to go to sleep.

