
Retiring Python as a Teaching Language - nafizh
http://prog21.dadgum.com/203.html
======
charlysl
I believe that teaching programming should be centered around teaching
programming concepts as opposed to languages, a la SICP or Concept Techniques
Models of Computer Programming. The languages used there (Scheme and Oz) are
just vehicles to teaching timeless concepts.

Teach a language and you will prepare someone for the present. Teach concepts
and will you prepare someone for the future.

By concepts I mean things like closures, higher-order-programming,
concurrency, explicit state, inheritance, security, encapsulation, complexity,
laziness, etc

~~~
iovrthoughtthis
I think your on the money here.

Also, I believe that you need to learn more than one language to full
appreciate those concepts.

There is some irony in the fact that i developed my own indepth, initiative
understanding of these concepts while learning JS.

~~~
charlysl
You can certainly learn many concepts and techniques using js, but it is still
a severily limited language for general programming.

You could learn using many different languages for sure, but I believe it
would be more efficient with one language that is truly multiparadigm, where
no paradigm is favoured and there are primitives for all core concepts.

With all these general concepts, techniques and design principles under your
belt, learning the core of a new language is a breeze, almost just like
translating the syntax.

Maybe it has all the primitives, or you have to use a lib or build your own,
or apply a design pattern, it might be more or less verbose, but you would be
just implementing the crucial thing, the design.

Of course, then you have to learn the idioms too to become proficient.

~~~
iovrthoughtthis
> but it is still a severily limited language for general programming.

I don't understand where this concept comes from? It is as turing complete as
any other language. From a "General Programming" perspective, it is also one
of the most prevalent run time environments.

> You could learn using many different languages for sure, but I believe it
> would be more efficient with one language that is truly multiparadigm, where
> no paradigm is favoured and there are primitives for all core concepts.

I find being in a single language can lead you to associate the abstract
concepts with the syntax too much. In moving the concepts between different
syntax and forms the abstract notion becomes clearer, for me at least. I
appreciate that learning everything in a single would likely be more
"efficient".

> With all these general concepts, techniques and design principles under your
> belt, learning the core of a new language is a breeze, almost just like
> translating the syntax.

Absolutely! :)

~~~
charlysl
Its just that its domain is mostly restricted to the web. As you pointed out
this is not so terrible at all, at the end of the day that's where the bulk of
the jobs are for instance. Actually, I am amazed that a language that was
originally designed for such a narrow domain is where it is today (thank
XMLHttpRequest and V8 for that).

I totally agree that learning several languages is extremely enlightening,
exactly for the very reasons that you have listed.

One big reason for one teaching language is that there seems to be a bit of a
FP vs OO religious war of sorts. If you think in concepts, such disputes look
shallow; in fact, the whole idea of paradigms becomes irrelevant. This is why
I believe that to learn both FP and OO in the same language (together with
many other paradigms) is much more enriching, because then you will learn
which one to choose for a given situation, based on relevant techniques, and
when and how to combine them, rather than being stuck with whatever is
available in a language that favours one paradigm (or just one form of
concurrency, or of inheritance etc). You will learn how to let the problem
drive the design, rather than the language.

Pure languages like Haskell or Smalltalk, for instance, can be optimized and
super concise precisely because they are restricted to one paradigm. But, for
the reason above, I don't think they would be good for teaching general
programming and only entrench that FP vs OO view (in fact, I think js would be
better than these). But once you know, learning such languages is a pleasure.

------
ralusek
It's unfortunate how despised JavaScript is on Hacker News, because JavaScript
is objectively the best language suited for teaching people to program.

Want to work with data from any API? Well JSON, industry standard data
protocol, happens to already use exactly the syntax you're familiar with!

Want to give them a sandbox to mess around in...take your pick between
jsfiddle, plnkr, codesandbox, etc. Many of these let you collaborate realtime
with people to help them work through problems directly. Most people learning
to program have 0 familiarity with using a terminal, and having to go through
the process of getting an environment set up correctly ALONE is enough to turn
off the vast majority of people to programming.

As the author already mentioned, rendering a UI in JS is going to happen on
the most ubiquitous platform on the planet: the web browser. If a programmer
starting today goes into UI work, the odds are that they'll be building UIs
for a web browser is astronomically high, the odds that they'll be using a
one-off python toy library is highly unlikely.

And last but not least, the syntax of JavaScript is very much like the syntax
for Java and C. Learning JavaScript first makes it very easy to read code from
other mainstream languages and have a good idea of what's going on.
Particularly with ES6, there is very little to complain about in the syntax of
JavaScript.

~~~
minimaxir
There’s a difference between “teaching people to program” and “teaching people
to program _apps_.”

Sure, JS is the hip language for making SPAs, but not the best way to show
what boolean logic is and the difference between for and while loops.

~~~
spraak
Why can't you reach someone those things in JS? JS has all of what you
mention...

~~~
catnaroek
Using JavaScript to teach the _design_ of appropriate data structures and
algorithms for a computational problem is bound to be an uphill battle.

And anyone who seriously considers teaching a first language that students
can't use in a data structures and algorithms course (without having to learn
a second language) isn't worth paying much attention to.

~~~
JCSato
"And anyone who seriously considers teaching a first language that students
can't use in a data structures and algorithms course (without having to learn
a second language) isn't worth paying much attention to."

Why? Both colleges I've been to had their DSA courses after at least two intro
courses, and in a different language than the intro courses.

What is so inherently contemptible about this?

~~~
catnaroek
Did they give you a formal semantics for the language in which you implemented
algorithms? Or did you merely “prove” things about informal descriptions of
algorithms?

~~~
JCSato
No, proofs were usually done in an entirely separate class later, with the DSA
classes focused on data structures (stacks, heaps, hash tables, etc.), sorting
algorithms (merge sort, quicksort, etc.), and efficiency (e.g. using Big O).
Such was the majority of the content in both cases, at least.

I still don't really have an answer to my question, though. What makes using a
different language such a poor choice in this context?

~~~
catnaroek
> No, proofs were usually done in an entirely separate class later

Okay, now _that_ is contemptible. And you didn't address my question: Were
your proofs about actual programs, or merely about informal algorithm
descriptions?

> What makes using a different language such a poor choice in this context?

The fact you would waste too much time teaching a second language at a
sufficiently rigorous level to write proofs about programs written in it.

------
haloux
It feels reasonable to assume that a majority of his teaching has been for
boot camp style instruction and not the traditional, 4-year formal academic
route.

I say this because, across the board, I know my staff would gaff at the
prospect of trying to incorporate JS into anything other than an elective.
Honestly, even to that, they would throw their pinkies in the air in retort of
the thought that JS be taught at all in a 4-year institution. “Nay, let it be
relegated to the community college.

...I know I know, ‘burn him at the stake’

~~~
LA_Banker
Which only further demonstrates the gap between a 4-yr Comp Sci degree and
software development.

Which, don't get me wrong, I'm a university snob and think software engineers
should understand things all the way down to the machine level, but the
snobbery in reaction to JS* being taught in 4-yr curricula (which I wouldn't
doubt as a widely held reaction) is saddening.

*JS wouldn't be my first choice for an actual university course on real-world coding; but I do resent the the chasm between applicable and theoretical software engineering skills... though this problem isn't confined to Comp Sci.

------
zaro
So aticle is from 2015. End of 2017 I wanted to make really simple GUI for a
python script. It turned out making a GUI with 5 buttons and shipping it as
exe in Python 3.6 is extremely complicated and convoluted. I wrote the main
logic in 30min, and spend 2 days figuring out the GUI and the packaging to
Exe.

~~~
pen2l
Perhaps the real problem is GUI framework fragmentation or confusing docs,
because I ship GUI applications with tkinter and pyinstaller without great
issues (pyinstaller -m hehe.py and you’re done! Single file exe you have).

~~~
zaro
Well. I tried cxfreeze first, an sit failed on including tkinter properly. And
while pyinstaller handled tkinter w/o issues, it failed miserably with scrapy
requiring workarounds and many trial and errors.

Anyway, having packaged apps in Javascript (nodejs) , Java and several other
languages/tools/frameworks , I find the state of packaging and GUI in Python
simply pathetic, it really takes you 20 years back :)

~~~
jftuga
The next time you need a .exe with GUI, you might want to also try C# with the
free version of Visual Studio (Community Edition). C# is pretty easy and there
are lots of examples, stackoverflow questions, github projects, etc. to learn
from. If you target .net framework 4.5.2, then your app will run on any
computer running Windows 7 or newer. Also, the executable size will probably
under 200k for a simple application. Visual Studio makes it really easy to
build a GUI and attach widget event handlers, too.

~~~
zaro
Thanks for the suggestion. I kind of already know that. But does c# has
something like scrapy? Scrapy is really good for scraping, makes it really
easy to write all kind of scrapers and the performance is excellent for
something you hack up in 30min.

------
ohyes
Teaching what, exactly?

I don’t see why anyone would need a specific “teaching language,” in the first
place.

You don’t teach a language, you teach concepts. You teach about variables and
call-stacks, function calls, how the hardware works, computational complexity,
and common algorithms that are used.

In any application you’ll likely be using multiple languages and throughout a
career you’ll be using many languages or you’ll be unemployed frequently.

I don’t have particularly positive feelings about Python as a language, in
fact there’s a lot about it that I think sucks. But I feel the same way about
Javascript and Lisp and C.

Which doesn’t take anything away from any of them. But it does highlight to me
a deficiency in programming education if someone strongly believes that we
should put off exposing students to new languages.

The syntaxes and libraries can be slightly different but the concepts are all
very closely related. So I think it’s a huge problem that we allow people to
have these complexes where they say “I’m a C programmer,” or “I only know
Java.” Not that I’m against specialization but I think it causes some
artificial intransigence that’s undesirable at any level and hard to break
otherwise successful individual contributors of.

------
mythrwy
I still think Python is a superior teaching language. Less weird behaviors and
just easier to get the basics of things like manipulating arrays and strings,
reading/writing from a file, creating a "for" loop, etc. etc.

That being said there is a solid point to the article. If students want to
delve into graphical displays great. Suggest they investigate JavaScript
(after they get the basics of traversing an array down). Or teach both
languages at once switching to JS for graphical portions. They are similar
enough this shouldn't be too difficult. Plus it would help prevent language
tunnel vision or language clinging and/or new language phobia.

------
ianamartin
Like many others in this thread, I think the question boils down to what you
are trying to teach. How to deliver an app? Have fun with Python. :( Doesn't
matter how you cut it, if your Python program needs a gui, it's going to be a
challenge.

You're either going to have to go the executable route, which is difficult to
figure out your first time. Or you're going to go the web route, which is also
difficult to figure out the first time, and you're going to have to not only
learn html, css, javascript, but also WSGI, nginx, and a few other things as
well.

I happen to think that going the web route is a really good way of doing
things as a teacher because you get to teach a lot of general computing things
along the way.

But the bottom line is what are you trying to teach? You can teach almost
anything with almost any language, and in this case I'd say take the
"programming" out of the "Programming Language" and ask yourself a different
question: is there any one best language in which to teach people arithmetic,
or art history, or physics, or music theory?

There's obviously not. It doesn't matter if you're speaking English or German
or Japanese or Russian. These concepts can be described and explained just
fine.

I think a conversation about what language to teach in has to boil down at
least to the context it's being taught in and what is being taught.

This author's decision is as reasonable as anyone's based on what he's saying
he wants to teach. And I think I have some sympathy. I don't have a 4-year
degree in comp sci. Or anything. But if there's one thing I wish teachers
everywhere in the tech world spent more time on, it would be deployment
strategies.

Someone should be teaching that class at schools if they are not already.

------
dragonwriter
There's lots of different potential approaches and contexts for teaching
beginners.

For low-contact teaching where the students were going to be doing lots of
independent work between contacts, that was more concerned with enabling
students to try stuff out, I'd generally agree with this.

For other contexts, maybe not; I think Python (or Scheme, or some others) a
better choice for a first language in a broad, structured CS curriculum.
Though I'd certainly still agree JS is a useful thing to have in your toolkit
fairly early on in programming these days.

~~~
myaso
I think Python would be the best choice for an absolute beginner, I almost
always recommend it when I'm asked what to start with -- it's objectively more
pleasant to use than js. The thing about js is, you can get your hands dirty
actually making some fairly interesting things quickly, it's just that things
are much messier overall.

------
dundercoder
Python was my first foray into programming, and I still pay the bills with it.
I still love it.

Trying to not let that bias influence my opinion, I too have been frustrated
with some of its shortcomings. Distribution, concurrency, and GUIs have been
excersizes more in patience and persistence than utility.

I’ve moved most of my efforts into Nim and haven’t been disappointed. I don’t
know if it’s a suitable teaching language yet.

But JS as a general purpose language? For web, web, web.

------
valuearb
Just wrote my first Python program today, to massage some text files. It was
super easy.

I also found the syntax, uh, interesting. Mainly the lack of braces to denote
blocks, ie functions, loops, if statements, etc. Indentng to me seems
problematic and a learning hurdle. But as a long time Pascal/C/Objective
C/Swift/JavaScript developer, what a virgin programmer thinks I’ve long since
forgot.

Better than that garbage JavaScript though.

------
fooker
I feel Python is a terrible teaching language, the only saving grace being the
abundance of libraries. There is just so much magic involved that you can not
give reasonable answers to the inevitable 'why' questions coming from
intuitive students.

~~~
orangecat
_There is just so much magic involved_

Compared to JavaScript, where {}!={} and [["2"]]==2?

~~~
fooker
Not compared to JS, I was thinking along the lines of Scheme or C.

------
donovanm
It seems absurd to recommend a teaching language without any consideration for
the technical merits of the language to me. The argument in the article is
among the lines of lets use javascript because it has the most shiny things.

------
raphman
previous discussion on HN from 2015:
[https://news.ycombinator.com/item?id=8921320](https://news.ycombinator.com/item?id=8921320)

and a Twitter thread from 2018:
[https://twitter.com/mkennedy/status/949688651058835456](https://twitter.com/mkennedy/status/949688651058835456)

------
deepsun
Ok, so I want to quickly read a text file and save something back to another
file. JS anyone?

------
jaytaylor
(2015) is missing from the title.

