
Python has brought computer programming to a vast new audience - akulkarni
https://www.economist.com/science-and-technology/2018/07/19/python-has-brought-computer-programming-to-a-vast-new-audience
======
42B
dupe:
[https://news.ycombinator.com/item?id=17569756](https://news.ycombinator.com/item?id=17569756)

~~~
jolux
That's 4 months old and the discussion is locked on it.

~~~
merricksb
From the official FAQs[0]:

 _If a story has had significant attention in the last year or so, we kill
reposts as duplicates. If not, a small number of reposts is ok._

252 points/261 comments probably qualifies as "significant attention".

[0]
[https://news.ycombinator.com/newsfaq.html](https://news.ycombinator.com/newsfaq.html)

------
nicolashahn
Python was my first programming language love. I had a few false starts: Logo
when I was very young, which I found too useless. Perl, which made no sense to
me as a middle schooler. Actionscript came close, I was eventually able to
create a Flash game in high school, but the API was still too arcane for me to
actually _like_ it.

In college, Processing.js was what I used in the Intro to Programming class,
which was fun, but like Logo, not powerful enough. Java (why do I have to type
so much?) and C (why do I have to worry about memory allocation?) for the
intermediate courses. But I never really enjoyed a language until one of my
upper division classes had us work in Python.

Finally, a reasonable language. Easy to pick up, but very powerful once
mastered. Easy to read, quick and concise to write, thanks to the syntax and
interpreter. A massive amount of open sources packages to choose from, for
nearly any programming task you can think of. A sane blend of functional,
object-oriented, and procedural features.

Python was the language that made me actually enjoy programming. Thanks GVR!

~~~
BurningFrog
> _why do I have to type so much?_

As someone who came to it from Ruby, that is often my question about Python :)

~~~
robben1234
I'm a Python developer (web back) who occasionally does some fixes on legacy
RoR project and I always ask myself why does Ruby needs so much sugar. Also it
does not look very consistent to me, but it's probably because I get to
practice only once in a couple of months.

After Java, CPP and Node, Python looks to me as the greatest of all. Syntax is
just comes to you and usually does not produce problems. And Python even right
now has so many areas of application, and does it without much compromises,
that I wonder why would I want to change anything.

~~~
rckclmbr
I programmed in python for years, am starting to code in javascript/node and
am really liking it. Typing in python is weird, i much prefer flow/typescript.
Async in python has a history of being weird, from twisted, to yield from, and
finally to async/await (which still has some issues, but is much better). I
thought javascripts "callback hell" actually made sense, promises made it
easier, and now async/await which works great. Pip has a long way to go to
catch up to npm/yarn (i cant believe im saying that). Virtualenvs are weird,
even though node_modules can be bloated i think its a lot more intuitive.

Anyway, long winded answer that i think i prefer node after a lifetime of
python

~~~
BurningFrog
pipenv replaces pip and virtualenv, and is actually decent.

~~~
xkcd-sucks
Pipenv looks good on paper, but it is a total trap. Pipenv breaks differently
on every single release. The user experience is absolutely hideous.

I am currently in my third hour of getting a pipenv+pyenv python project
running. I started the project this past summer, and have reinstalled it three
times. Each time I have spent 3-6 hours getting pipenv working, and each time
the errors/problems/workarounds are completely different!!!!!!

~~~
BurningFrog
All I know is it works well on our projects.

I'm not the one doing any dirty work though...

------
minimaxir
As a part of my college curriculum most students are required to take a
programming course; I got put into the Java course. Although I was good at it,
I hated every minute of it because it felt like I was fighting the computer to
make things work.

I played around with PHP in order to make hacks on WordPress themes, which
again I hated due to system-fighting.

I learned base R (pre RStudio/tidyverse) for stats classes, which I hated even
more than the previous two since everything felt combersome.

Then just for fun I installed Linux on my laptop and experimented scraping
APIs with Python with only a few lines of code and I got _hooked_.

Nowadays I use primarily Python for both work and personal projects. If I had
_started_ with learning Python, I would have had a much different career path!

~~~
eksemplar
Java has some advantages over python in a teaching environment.

Writing a basic hello world function you’ll learn about types, return values,
references, imports and access modifiers, all in three lines of code.

Java is also excellent for building stuff like various linked lists to see how
the lists and arrays we all take for granted actually work behind the scenes.

The confines of Java’s strictness is also a really great sandbox in which to
teach best practices without students ever getting in danger, because java
will tell them every time they do.

I know a lot of teachers really struggle to do it well, but going through
public void X, word for word can be extremely useful in teaching. For one,
it’s very easy to spot who knows what is happening and who is just copying
stuff to make it work.

I think python is quite terrible for teaching beginners, but it’s certainly
fun to write. These days, I think JS and Node is more fun than python but
that’s mostly because it’s where a lot of the fun is happening, I certainly
could do without all the {s and ;s.

~~~
earenndil
I disagree. Those three lines of code are three lines of utter black magic to
a beginner. Things are only useful insofar as they solve a problem, and the
beginner hasn't yet encountered the problem solved by types yet, so there's no
reason to teach them.

~~~
eksemplar
Well, after the first programming lesson, they are no longer magic. In python,
they are never demystified.

~~~
earenndil
Right. Let's learn 50% of all the mechanical aspects of programming in one
lesson. Those just serve to get in the way of initial learning, general
program flow and logic.

~~~
eksemplar
Those few topics aren’t close to being 50% of the mechanical aspects of
programming. What are you even on about?

Furthermore they are all easily explainable concepts that any CS student will
be able to grasp once they reach their first programming language course.

I’d say most of the concepts are easy for non-CS students as well. Access
modifiers, especially public and private aren’t hard concepts, are they? Yet
they are insanely important to your basic understanding of what a function
does. Private is like singing in the shower, you’re doing it for you. Public
is like signing at a concert hall, there you’re signing for the audience.

Return values are values functions return, your can think of them as the
result a calculator gives your when you ask it to add 2 and 2, here the return
value is 4.

Types are typically the first thing you explain anyway, including when you
teach python.

Maybe you could get people writing complicated functions faster in python, but
why would you want to? The purpose of teaching programming isn’t to have
people writing code as fast as possible, it’s to teach them to understand what
the hell it is they are writing, so they’ll know why they do it.

------
sytelus
A 5 year old can do bit of Python programming :). Start terminal, type Python
and then type 2 + 3. Watch them getting kick out of typing huge numbers and
Python spitting out the answers.

~~~
jolux
Same with Haskell or ML family languages.

~~~
bbeonx
Ahhhh, but then they will ask how to print things and you'll have to explain
monads :)

~~~
jolux
I thought we were talking about a REPL instance. Have you already explained
how to use a command line and what files are and how to run them? stdout?

~~~
Godel_unicode
You need none of that in a jupyter notebook.

~~~
jolux
Jupyter supports Haskell too though. As well as OCaml and Scheme...

------
jolux
I found this article to be profoundly weird in a lot of ways. It's not quite
suffering from the "igon value" problem, but gosh does it come close. It's
hard to measure programming language popularity, and most estimates I've seen
have Python neck and neck with JavaScript with regards to popularity. Plenty
of other languages have simple syntax and are easy to read, the only thing I
would say Python has that is clearly superior is availability of packages and
community support, (and even then JS has got to be close there) which are
undoubtedly huge, but I think it's fallacious to assume that those reflect
intrinsic technical worth.

~~~
tormeh
>Plenty of other languages have simple syntax and are easy to read

As easy as Python? That's a very high bar. We all agree (I hope) that
JavaScript requires linters (plural) to write well. Rust/Scala/Haskell have
unpleasant learning curves. Java is verbose and clumsy. Basic and Pascal have
fallen into disuse. Go may be simple, but it's syntax is more symbolic and
less English-like than Python. Don't get me started on Perl and the lisps.
C/C++/PHP have more footguns than features.

I'm not a Python die-hard, but it's obvious that it's superior when it comes
to ease-of-use and learning curve. It's very similar to how people write
pseudocode.

~~~
jolux
I will argue that learning curves are similar with Ruby, SmallTalk, ML, and
Scheme to Python. Logo is the original teaching language, and I think is
similarly easy. It's my belief that people exaggerate the learning curve of
Haskell, but whatever, I'll grant you that.

If your criteria for readability is "English-like" I think you're missing a
lot of what makes Python so readable in the first place. It is not very
English-like at all. Compare to say COBOL, which actually had English-like
readability as a design goal and was by all accounts an unmitigated disaster.
AppleScript has a similar reputation for being a "read-only" language because
of how difficult it is to pick up from reading it. What makes Python readable
is having a small number of concise syntax constructs that compose into
complex programs, the same things that make functional code readable. The
presence of words vs operators is probably important, and Haskell tends
towards the latter, but the ML family doesn't, and Lisps are plenty readable
if you keep them simple. There's a reason that SICP and HTDP use Scheme, the
latter using a gradually larger subset to make it less intimidating.

------
laurieg
Python was not the first programming language I wrote a program in, but it was
the first one I _actually ran_.

When I was a kid I wanted to make games, I picked up a book on C from the
library. I wrote a simple interactive fiction type game but with never managed
to compile it.

When I tried out python a couple of years later I was blown away. I could
actually write and run programs. I wrote a mandelbrot set generator and I was
hooked. _This_ is what programming is supposed to be like, I thought to
myself.

------
bbeonx
Biggus Uptickus

