
Retiring Python as a Teaching Language - xngzng
http://prog21.dadgum.com/203.html
======
johnloeber
When I took an introduction to Computer Science in college, it was taught in
Racket. Over winter break, I then learned Python, and I was baffled -- why
would any curriculum _not_ start with Python? Python was easy, expressive, and
allowed the user to get lots done with little effort. It was great at
motivating programming by showing its use and power. It seemed like an ideal
introductory language.

Over the last few years, however, I've back-tracked on this opinion: if you
really intend to _teach_ , not just _motivate_ , then Python is a poor choice.
A language like Racket is great for teaching because it lends itself to
exploring so many core concepts: complexity of algorithms, functional
programming techniques, recursion, data structures, etc.

A language like C (the next course I was to take in the introductory sequence)
is also an excellent language because it forces the user to understand
programming at the systems-level.

I don't really think Python is very good for illustrating either the
theoretical or the systems-level CS concepts. It's a nice language for
motivating programming and showing off how much you can do with little serious
investment, but it doesn't really motivate learning Computer Science, i.e.
learning Programming on a 'deeper' level.

Thus, I don't really think that learning Python offers solid programming
_foundations_. Consequently, if you really aim to teach, not just to motivate,
then use languages that bring the student closer to core CS concepts.

~~~
fchollet
Teaching is made of two components: access to knowledge, and motivation.
Today, access to knowledge is almost entirely irrelevant: pretty much all
knowledge is freely accessible from anywhere, anytime. You just need the
motivation to look it up. Teaching yourself can be easy, if only you have the
drive to keep at it.

It wasn't the case in our past. In the middle ages, before the printing press,
teaching was 99% passing on knowledge, and motivation was assumed to be a
given. Today, in the post-internet age, access to knowledge is a given, and
teaching is 99% motivation.

~~~
mkesper
Honestly, no. If you've got no overview, you'll not "surf the internet" but
get drown in irrelevant or outdated stuff which exists in abundance.

------
Mithaldu
As much as i can't disagree with the choice (the realpolitik of programming
has made it the most correct choice), i am saddened that the language on which
the choice falls is one not chosen based on any merit, but merely due the
historical accident of being the first to be implemented in a browser and
having had no appreciable opposition due to browsers at the time being in
hands of corporations.

In "A Deepness on the Sky", Vernor Vinge describes a future in which there is
the reality of a profession called "Programmer-at-Arms", necessitated due to
thousands of years of layers of indirection and cruft that will combine to
make the software of that time, making it a requirement for even simple
changes in a weapon system to be done by someone who can dig through all of
those layers. It seems that his prediction is closer and closer to becoming
reality.

~~~
gobengo
I thought Java was the first to be implemented by the browser?

~~~
olavk
Java was introduced in Netscape Navigator 2 at the same time as JavaScript.
But Java was really not integrated with the html at all. It lived in its own
isolated box on the page. JavaScript was integrated with html and with the
browser environment.

~~~
GFK_of_xmaspast
[http://en.wikipedia.org/wiki/HotJava](http://en.wikipedia.org/wiki/HotJava) ?

------
bjourne
I'm saddened by the lack of academic rigour displayed in this thread. If you
have not taught introductory computer science courses, then you have NO CLUE
what makes a good introductory language choice. It appears James Hague isn't
working as a teacher either, just giving advice to newbies, so his opinion is
just that -- opinion.

What you want is field studies: "This year we used Haskell and 75% of all
students gave up on programming stating that it was to hard. Last year we used
Visual Basic and only 20% did. Ergo Visual Basic is probably a better first
language than Haskell."

Lots of research is being done on the subject, see this survey:
[https://www.seas.upenn.edu/~eas285/Readings/Pears_SurveyTeac...](https://www.seas.upenn.edu/~eas285/Readings/Pears_SurveyTeachingIntroProgramming.pdf)

~~~
oskarth
> What you want is field studies: "This year we used Haskell and 75% of all
> students gave up on programming stating that it was to hard. Last year we
> used Visual Basic and only 20% did. Ergo Visual Basic is probably a better
> first language than Haskell."

Why is that necessarily a good thing? What are we optimizing for here,
understanding or popularity?

SICP review by Peter Norvig:

> Donald Knuth says he wrote his books for "the one person in 50 who has this
> strange way of thinking that makes a programmer". I think the most amazing
> thing about SICP is that there are so FEW people who hate it: if Knuth were
> right, then only 1 out of 50 people would be giving this 5 stars, instead of
> about 25 out of 50. Now, a big part of the explanation is that the audience
> is self-selected, and is not a representative sample. But I think part of it
> is because Sussman and Abelson have succeeded grandly in communicating "this
> strange way of thinking" to (some but not all) people who otherwise would
> never get there.

[http://www.amazon.com/review/R403HR4VL71K8/ref=cm_cr_dp_titl...](http://www.amazon.com/review/R403HR4VL71K8/ref=cm_cr_dp_title?ie=UTF8&ASIN=0262510871&channel=detail-
glance&nodeID=283155&store=books)

EDIT: People seem to be downvoting a sentiment Knuth and Norvig expressed,
rather than reflecting on the question posed - what should we optimize for in
a intro to CS class and why?

~~~
endeavour
Exactly this. Why are we trying to raise an army of procedural, object-
oriented programmers?

~~~
collyw
Easy for corporations to replace cheaply.

------
shadowmint
As a proponent of python and a full time python developer I fully endorse this
decision.

There is a compelling need to be able to distribute graphical python
applications that isn't met (and that
[https://www.python.org/dev/peps/pep-0441/](https://www.python.org/dev/peps/pep-0441/)
isn't even a step _in the right direction_ is an indication of how far away a
solution is).

Don't get me wrong, python is a great language, but its not the right solution
for teaching programming for exactly these reasons.

~~~
fpgaminer
From the link:

> This feature is not as popular as it should be mainly because no one’s heard
> of it

Count me as one. As someone who does a lot of development in Python, I'm
surprised I never heard of that feature either.

Perhaps another reason this feature goes unnoticed is because it still
requires the end user to have Python installed. Therefore, when distributing a
Python application, most people just bundle it into an EXE/ELF/etc and don't
bother looking for other solutions.

~~~
shadowmint
Basically that's because you can't bundle c libraries in a zip file like this,
so effectively you can't actually use it for any of the reasons you might want
to use it.

(.exe bundlers, by comparison, bind the shared library into the executable or
with it)

------
BuckRogers
I think this author has lost his focus. Maybe there's only 1 choice if you
want something to sit "on top", but anything can interact with "an
unprecedentedly ubiquitous cross-platform toolkit for layout, typography, and
rendering". Including Python.

For games, an introductory class using Python with Kivy or PyGame doesn't fit
the bill because they may not always be around? If a student really wants to
go deeper into game dev, they're going to need to learn at least one of
Swift/ObjC/Java/C# and their respective native libraries anyway. You're not
indoctrinating them into a platform like the web or iOS, you're introducing
them to programming.

The rant about libraries not always being maintained is really brilliant
considering the library churn than in the JS space. After all, they may be
"well-intentioned today but unsupported tomorrow?". TkInter? This was around
before Angular 1.x was a glimmer in daddy GOOG's eye. It'll be around after
Angular2.0, and long after 2.0 is buried and the next JS framework/library
rears its ugly head only to be put down in short time. Given the choice of
having invested my time into TkInter, or Angular 1.x, I know which I'd rather
have dumped my time into.

So what's the goal here, to teach _programming_ with something you can show
others? If so, then you can do it with almost anything, especially Python.

Use what you want to teach, but don't delude yourself with half-baked
reasoning to justify what you clearly always considered an inferior choice to
do it in- for the last 2 decades.

Back to the drawing board, professor.

~~~
ajanuary
It sounds like the goal is to get people programming. That means a combination
of teaching them, and getting them excited. Being able to show the thing you
created to your friends is a powerful motivator.

~~~
TheDong
If you get excited by showing your friend some silly webpage, but aren't
absolutely thrilled by function composition in haskell then you're a coder,
not a programmer. You're in the wrong class.

The point of programming classes should not be to hide what programming is and
show this silly mockery of it which javascript is. It shouldn't veil true
programming issues, like correctly reasoning about the structure of your code,
with a language which makes it easy to code in without ever programming.

If you need to motivate someone to be a programmer, they should not be one at
all. They should not be going on to write poorly implemented software because
they didn't have a passion for implementing proper reference counting in a
legacy C codebase, but instead wanted to write an iPhone app for their
friends.

If you need to motivate someone to be a programmer by teaching them to draw on
a canvas or manipulate the dom, rather than teaching them the wonders of basic
lambda calculus, then you're doing them a massive disservice by using the word
"programming" to refer to something else entirely.

~~~
hueving
_slow clap_

It's rants like these that really harm the perception of the functional
programming community. It just portrays you as the archetypal 'misunderstood
genius' trying to show everyone in the world how wrong they are and how only
the 'true programmers' do what you think is right. Yet none of this is backed
up by evidence that the benefits of functional programming lead to better
software.

~~~
cageface
_Yet none of this is backed up by evidence that the benefits of functional
programming lead to better software._

Amen. I've been hearing exactly these kinds of grandiose claims from FP
advocates going back as far as 1998. The funny thing is, the same people
almost never seem to getting around to actually writing any code of any
substance. As far as I'm concerned there are some good ideas coming from the
FP community but the more extreme implementations of FP like Haskell have yet
to prove their worth in production environments.

~~~
codygman
> FP like Haskell have yet to prove their worth in production environments

Huh?

What is your definition of proving worth in a production environment?

Did you hear recently about bond? It's written in haskell by Microsoft and
used in Xbox Live as well as other infrastructure.

There's also facebooks Haxl...

Remember Bump file/etc transfers in Samsung Galaxy commercials? That was
written in haskell too.

------
cageface
_It 's with all of this in mind that my recommended language for teaching
beginners is now Javascript. I know, I know, it's quirky and sometimes
outright weird, but overall it's decent and modern enough._

Javascript _is_ a flawed, quirky language, but with the upcoming ES6 and ES7
standards it's going to be a much, much better. I'd call it a tossup comparing
it to Python or Ruby. I wouldn't have recommended JS to a beginner a few years
ago either but that's where the momentum is now and, as the author says, the
ease with which a newbie can get something interactive up on screen trumps
smaller concerns. For a little more rigor you can use something like
Typescript.

~~~
gobengo
What's pretty funny is that the new features in ES6 and ES7 makes a lot of the
patterns/mishaps/X-parts from the last 15 years pretty irrelevant or less-
obviously-'the way'.

Examples:

    
    
      * "Class" syntax
      * Comprehensions
      * Modules
      * `let` scoping
      * Generators
    

It's a whole new ball game.

I think a lot (over 50%) of JavaScript devs 5 years from now will still be
using <= ES5, but only because they've so settled in their ways over the last
10 years.

~~~
saraid216
> I think a lot (over 50%) of JavaScript devs 5 years from now will still be
> using <= ES5, but only because they've so settled in their ways over the
> last 10 years.

5 years from now, there will still be people whose customers require IE6
support, too. We're still working on that.

~~~
pjmlp
The customer I am on, still uses IE 8!

------
bjcubsfan
You can program in Python using Kivy [1] to create apps for Android, iOS, and
the desktop. I made a simple app and took it through the entire process it is
now on the Android app store. You are still using Python so you can focus on
programming and not language features, but you get the benefits of programming
something your students can show off.

[1]
[http://kivy.org/docs/gettingstarted/intro.html](http://kivy.org/docs/gettingstarted/intro.html)

~~~
MarcScott
Thanks for pointing this out. I've been using pygame with my students but kivy
looks great.

------
Udo
JavaScript (or rather: a subset of it) is a fine teaching language too,
especially since it's easy to publish runnable code - even for beginners.

However, there is no language that can do everything equally well. It's a
common reaction displayed by the proponent base of many languages, even here
on HN, to advocate the use of _their_ language for every conceivable need.
This can't possibly work well.

Programming teachers should make a habit of pointing out that writing code is
a journey that will require students to learn new tools all the time.

~~~
coldtea
> _It 's a common reaction displayed by the proponent base of many languages,
> even here on HN, to advocate the use of their language for every conceivable
> need. This can't possibly work well._

Is that some law of nature, or merely a consequence in how we've designed
languages thus far?

A well designed type-infered statically typed language with a
REPL/interpreter, a fast AOT compiler, an optional GC, good documentation and
IDE support, and a big API library could work well for all kinds of domains,
from scripts and websites, to network application servers and systems
programming.

Note also that the money we spend on language and tooling development are
miniscule and laughable compared to the IT industry's size.

When there have been some decent money involved we had good results. Namely:

With SUN/Java we got the fastest, more mature VM out there, with very good GC
and a ton of tooling available.

With Javascript, we got V8/JSC/etc, that made the language 10-100x faster
compared to the nineties.

With MS, we got C#, a great language that can cover tons of ground for what
its designed, modern, with a huge ecosystem of tools and APIs.

And from Apple, we got the great Cocoa libs and Swift (still a work in
progress but very promising).

~~~
Udo
_> Is that some law of nature, or merely a consequence in how we've designed
languages thus far?_

It's a game of tradeoffs, same as everything else in nature, isn't it? I would
rarely say that a given language's design or implementation is universally
flawed, instead it's the result that comes out of a set of premises and
decisions. Yes, some of them may be _objectively_ bad, but mostly they are
just decisions made to solve specific problems.

In a way the whole point of my post was that languages don't primarily exist
on a one-dimensional spectrum of "good" to "bad". They're optimized for
different things. The assumption that given a list of possible decisions
during language design you just have to select _the right one every time_ is
based on the fallacious premise that right and wrong are the actual choices
you get.

 _> A well designed type-infered statically typed language [...]_

...and those are _already_ some key decisions you made that reflect what's
important to you personally. Every time you choose one of these properties,
you open doors and close others behind you. While you may personally believe
these are the minimum requirements which _every_ "good" language absolutely
_must_ have, you should also recognize that you are doing exactly the same
thing as every single language designer in history.

~~~
rtpg
>It's a game of tradeoffs

I find that less and less true. The canonical example for me are abstract data
types. They're pretty much free on a runtime level, enable clean code, and
allow for more static checking. Basically a superpowered version of enums. I
can't see any argument against having it in the language unless the express
goal is to have no syntax (lisp).

~~~
Udo
Again, that's a personal preference, not a statement of fact. There is a cost
associated with different type systems, and that cost can vary with the
problem you are trying to solve. It's not that I argue against the benefits of
having such a system in place, but you should be aware of the fact that this
too might not represent the end-all-be-all for all programmers.

One of the basic mistakes made here seems to be the notion " _if programmers
only _knew_ about the one true way of doing it, they 'd all use the same
language and tools, namely: mine_".

~~~
coldtea
Again, this is not about personal preference.

In the real world, 90% of programmers use either C#, Java, C/C++, JS or
Python/Ruby/Perl in their jobs.

We could restrict ourselves to this set of languages and syntax style, and
design a super-set language that does everything, gets rid of their historical
warts, and can go from scripting to HPC.

Stuff like using significant whitespace or not, are BS bikeshedding, which we
can bypass.

The thing is, were it matters (speed, expressivity, availability of REPL and
IDE, large SDK) nothing but money prevents us from making such a language...

Is there anything preventing a top notch team working for 10 years and come
with one ready, including all the trims and works, JIT, AOT native compiler,
ports to 2-3 architectures, batteries et al?

Sure, some people would still like their Java or their Lisp or whatever.

But there's not some logical impossibility preventing us from creating a
language that's better for 90% of the tasks than what's our there.

In a sense, that's what MS did with C# -- but they stopped too soon because
they have their own agenda. So it was Windows only, in the CLR with no
supported AOT option, etc.

~~~
Udo
_> Again, this is not about personal preference._

There is no need for passive aggressiveness. I get that aping the exact phrase
used in a parent comment is used to communicate disrespect, and it's duly
noted, but all things being equal I would prefer not to go down that route.

My argument here is that people designing languages have made choices based on
their personal preference as well. It's not really appropriate to take one
specific set of features you like and declare it to be the objective winner.

 _> In the real world, 90% of programmers use either C#, Java, C/C++, JS or
Python/Ruby/Perl in their jobs._

That's a No True Scotsman-like argument. Also, what's the meaning of the three
different types of separators you used there? But for the sake of convergence,
yes, let's assume every important real-world language is in that list.

I'm still not sure what to say about this without repeating myself, except
for: go and do it. You say it's a matter of investment, but on the other hand
consider the benefits if someone pulled it off. If you really do believe you
are the person who has this all figured out, please go ahead and implement
this. Heck, make it a Kickstarter project or something, I'm in!

~~~
coldtea
> _There is no need for passive aggressiveness. I get that aping the exact
> phrase used in a parent comment is used to communicate disrespect, and it 's
> duly noted, but all things being equal I would prefer not to go down that
> route._

What passive aggresiveness and/or disrespect?

The repeat is used to communicate disagreement with a specific thing
attributed to what I said. Since it was attributed twice, with no regard to
the arguments I made, it was mostly necessary.

If anything is "passive agressive" is this sudden ad-hominen and armchair
psychology attempt.

I only responded to the abstract issue under discussion, didn't made any
judgements on the participants. Can we keep it at that level?

------
MarcScott
I think there are a lot of commentators here that are failing to appreciate
that this is not about which programming language provides the best
introduction to Computer Science or Software Engineering, but which language
will inspire students to continue programming.

The readership of HN is self-selecting. Almost everyone here was drawn to the
world of programming. Very few of you probably had programming thrust upon
them.

I teach in the UK where all students from the age of 5 to 14 are now required
to study computing. I personally teach students from the ages of 11 upwards,
so when I'm looking at the best programming language to use, I don't even
think about which will provide the best introduction to Software Engineering.

My primary concern is what will interest an eleven year old, who's only
experience with a computer is using his iPhone, and whose primary interest in
life is football. Or how can I make this interesting for a student whose
ambition in life is to perform on stage, and has already decided not to
continue studying Computing for their GCSEs.

------
rrggrr
just the opposite. Many teachable subjects from Journalisism to data science,
biology to finance increasingly include Python. NLTK, Beautiful Soup, Pandas,
Ipython Notebook, Matplotlib... Programming is a tool for getting things done,
and few languages offer students more tools for doing than Python. On HN we
sometimes forget the ubiquity and pure value of automation and anaysis. We
focus perhaps too much on software engineering (in this case gaming).

~~~
shadowmint
> Programming is a tool for getting things done

...and some of those things, python _isnt any good at_.

To be fair, it's very _very_ good at others, but you can't argue with the
points he's making. They're spot on.

It turns out, people learning programming in school aren't interested in
processing scientific data. They're interested in games. and showing their
friends what they've made on their phones.

Python is flat out bad at those things. It was never the intended purpose of
python, and it's not a priority for the core team.

Why not teach kids with a tool that excites them, instead of one that
frustrates them?

------
br3w5
I've been through the Udacity CS101 and progressed well with their programming
languages and design of programs courses. These are all in Python but I have
covered interpreters, compilers, regex, recursion, types, etc. These all treat
python as a tool to learn CS not just the language in itself. Alongside these
courses I've also been building my own websites using Django and I'm now at a
stage where I feel I can solve any problem in any technology (even though it
will take me longer than someone experienced in that technology to learn it
and get stuff done).

I've started exploring other languages (C, Lisp, even Java at work, Haskell
next, javascript) and feel much more confident with the software engineering
stuff that CS courses don't necessarily cover, having managed development
teams (git, deployment, CI, TDD, etc). I agree with other commenters that
python gets out of the way so that you can explore CS concepts.

Javascript could be a good intro language but students might want to move onto
something else fairly quickly. I already tried js first and quickly started CS
courses because I didn't feel that learning javascript was helping me
understand how to solve problems with programming. I also don't think you can
teach all of the core CS concepts with javascript as effectively as you can
with other languages (e.g. OOP), so when you do start teaching js they will
still come to you and say "how do I put this on a website", "use node", "ok
but how does that work? why does that work? etc, etc". And when it comes to
websites are you going to teach students to build a webserver in vanilla js
(?!) or reach for node that abstracts so much that is going on under the hood?

Smart students are always going to ask questions and I've found in my
experience that I've been able to either get the answers or know where to get
the answers, by knowing core CS concepts. So whatever language you choose to
start off with it needs to be couched in terms of what CS it exposes.

------
hyperion2010
Funny, I have done a lot of game/graphics related programming using python and
panda3d, which is written in c++ and has nice python bindings [0]. Sure, you
can't just do "import wheemakegames" but the tools are out there. The same is
true for GUI apps. If you want to click on stuff just have them use pyqt or
pyside. I think that teaching students about other packages and how software
actually works together is very important. Having said that packaging a python
program into an executable installer or even just an executable is a pain in
the ass ("What sane person DOESN'T have at least one working python
interpreter?!?").

0\.
[http://www.panda3d.org/manual/index.php/Main_Page](http://www.panda3d.org/manual/index.php/Main_Page)

~~~
zarify
One of the issues I've had using Python to teach in the last few years has
been the glacial transition to Python 3 for some packages, often with some
annoying cross platform inconsistencies (trying to keep up with two or three
different tool kits for one purpose because of different support for Windows
vs OS X is annoying).

I really enjoy Python as a language, I enjoy using it for teaching
fundamentals, but I really don't enjoy using it for teaching 'the fun stuff'
as far as high school kids are concerned.

I might consider switching to JS in my new school. I was looking forward to
perhaps using Swift but the new place is Windows-based.

------
jacquesm
Nothing got people easier into programming than good old BASIC did.

MODE 4; LINE 10,10, 250,250

Instant attraction.

Beginner steps need to be small and need to give an immediate reward, BASIC
got that right, almost every other language stood so far away from the
available devices that the spark failed to jump the gap in many places.

Smalltalk is another language that got this right, people - especially
beginners - need instant gratification to move from curiosity to immersion.

~~~
adrianN
Yes. BASIC also had an _awesome_ help system, where an eight year old could
learn how to draw things on the screen without any teacher, even if they
barely spoke English.

------
jfarmer
I've had good success teaching Lua with
[https://love2d.org/](https://love2d.org/). Super easy to create click-and-run
executables that work on OS X and Windows. Mobile's a different story
(obviously), but as a teaching language + environment I find it, well, lovely.
:)

~~~
Gurkenmaster
There are some mobile game sdks that use lua like gideros and corona. It's
possible to do live coding in a simulator if you use zerobrane studio but I'm
not sure if it's possible on a real phone.

------
chipsy
I agree. As a beginner - and even as a professional, in an average-case
situation - what you need in terms of abstractive power and optimization
potential tends to be something akin to a classic microcomputer Basic, plus
some modern API calls. You're already way ahead of the game when you consider
JS in that light. You can write a lot of practical, maintainable JS that only
uses arithmetic, string manipulation, branches, loops, arrays and simple
function calls. POD objects, too, if you get a little more fancy.

Teaching towards that subset is also a healthy instruction in rule of least
power - once you grasp how to use the basics, you have a fighting chance of
picking up most other languages too. It's way more unhealthy to guide newbies
into cargo cult thoughts about "proper" something-something design(insert
favorite methodology here) - a learner has to make their own mistakes to learn
properly, but they should do so from within the subset of programming concepts
that predate current languages, because those are the things that have lasted
through multiple generations of software.

If we consider Python, Ruby, JS, C#, and Java - the design of most of their
core features was locked down all the way back in the 1990's. So all the new
ideas they brought to the table tend to be "baby implementations", frozen in a
half-correct state of refinement. But the things they got _really_ right tend
to be the things that were there and usable, but not refined so well in prior
languages.

------
allendoerfer
As already mentioned in the thread, it depends on _what_ you want your
students to learn. My universities CS courses (aside from theoretical stuff)
started with Racket for the basic concepts, good choice. We were then taught
Java to handle a small project, questionable. But after that we had no
problems with the language, when we had to implement algorithms, which would
look quite similar in most other OO languages, maybe with added memory
management.

I think JavaScript's prototype-based inheritance and global scope would make
it hard to abstract concepts learned in it to other languages. Strict ES6
might help a bit. When switching from Scheme + Java to JS, you can get the
Java+Scheme mix, that JavaScript is in my eyes, and use it accordingly.
Switching the other way round you would basically have to relearn the
concepts, because JavaScript does not express one distinct enough, but is an
exotic mix of them (or an ugly hack as others might say).

Outside of CS though, I think introducing people to JavaScript, PHP or even
advanced Excel is highly beneficial.

------
owlish
A lot of the discussion in here revolves around "not being able to get an
interactive GUI up and running quickly". If this is indeed the main problem
with teaching programming with Python, there are many ways of tackling this
problem without resorting to teaching Javascript. Don't get me wrong,
Javascript is an interesting language, but it has many oddities that could
throw off a newcomer.

Sites like OpenProcessing[1] and ideone[2] already allow users to compile and
share code in the browser. Why not create a Python GUI "toolkit" that
interacts with the browser and can be accessed from an interpreter implemented
in Javascript? Granted, this isn't the "vanilla" Python experience, but if
you're just ramping up, having shiny bells and whistles to show off to friends
is definitely a plus.

[1]: [http://www.openprocessing.org/](http://www.openprocessing.org/)

[2]: [https://ideone.com/](https://ideone.com/)

~~~
vanderZwan
An even simpler solution would be Python mode for Processing, which has most
(if not all) of the benefits of Python and Processing in one:

[http://py.processing.org/](http://py.processing.org/)

~~~
woah
Simplest solution of all would be to just use js. I don't think that any
syntactical or semantic niceties in Python matter much to an absolute
beginner, and the extra layers of indirection you guys propose will just lead
to more moving parts and frustration.

------
gunnm
Wouldn't something like pyjs ([http://pyjs.org](http://pyjs.org)) solve all of
the author's concerns, while still teaching Python?

~~~
aroberge
Brython is even better.

------
ekianjo
> A month later, more questions: "How can I give this game I made to my
> friend? Even better, is there a way can I put this on my phone so I can show
> it to kids at school without them having to install it?"

Giving a Pygame game to your friend is pretty easy. It has usually very few
dependencies and should be trivial to package. And it's multiplatform (Mac,
Windows, Linux including even exotic devices like the Raspberry Pi).

Putting a python game on a phone is definitely more of a problem, but at the
same time something that is NOT made for a Phone touch controls will anyway
perform poorly if you intend to do a demonstration with it.

~~~
ion201
> Putting a python game on a phone is definitely more of a problem

Not necessarily. kivy[1] is an alternative to pygame (for desktop builds, it
uses pygame/sdl under the hood iirc) but it supports exporting to android as
well as desktop platforms. I haven't done a ton with it so take this with a
grain of salt, but it looks like it could be a viable option in this case.

[1] [https://github.com/kivy/kivy](https://github.com/kivy/kivy)

~~~
zarify
I might just not have played with it enough at the beginning of 2014, but kivy
had some serious weirdness when it came to the way in which it approached its
layouts, which I feel was down to the way in which it tried to approach being
multi platform. This was mostly looking at developing a basic desktop app
which I could then shift over to mobile as well.

------
brudgers
I have a concern with Python as a teaching language in contexts where people
are not necessarily into STEM and are inexperienced or marginally experienced
as programmers.

There's no neat and tidy way to deal with Python 2 versus 3. You can say use
2. You can say use 3. You can kick the issue down the road by requiring
programming via web browser. But in the end anyone who catches the programming
bug winds up facing a decision that even seasoned professionals struggle with.

Python as a teaching language is great for replacing MatLab. After that it
entails tradeoffs as fundamental as character encoding. Not that I'm saying
JavaScript is the answer.

If I were trying to get someone juiced about programming and solving the
problems that MatLab does wasn't a feature the audience cared about, I'd pick
Processing. It does interesting things with sound and images and exports to
HTML and JavaScript to run in the browser. All that and it's small, well
documented and Googles up a low noise search results page. Yet it runs as deep
as you want to dive into the JVM and its languages.

~~~
kylebgorman
Telling somone to use Python 2 __is a neat and tidy solution __. What problems
would this possibly cause? Python 3 is fine too.

~~~
mkesper
Python 2 is not nice as soon as you face something containing unicode chars.

------
alexvr
My high school's student laptops were super restricted (I was suspended for
installing Eclipse on an unrestricted computer), so I played with JavaScript a
lot as a senior. I didn't have a good understanding of the virtues of
classical polymorphism and whatnot at the time, so JavaScript's unconventional
OOP didn't bother me; I was content writing procedurally, treating objects as
structs. JS was also my introduction to the notion of first-class functions,
and it made them seem so natural and essential that I get angry when languages
don't have them. I think JavaScript just barely misses the mark as a great
programming language. But its new standard might change that and make it the
best language for learning. If a language like Swift were as ubiquitous as JS
I would have a different opinion.

------
lmm
Even if "runs in the browser" is a hard requirement, surely there are options
like Dart that don't have as many horrible quirks and edge cases - quirks that
are probably no trouble for an experienced developer, but can be very
confusing to a newcomer - as Javascript does?

------
dinkumthinkum
This is always a hotly debated topic. When I learned to program, I started
because I wanted to understand how computers work. Javascript in a Web browser
so many layers above the basics of a computer; I just don't think it is a good
choice for a first language. Obviously, it depends on your goals. If you are
changing careers and you just heard that you can make all this money web
consulting and you couldn't care less about computer science then maybe go for
Javascript, I don't know much about people who got into programming via that
route.

I think Python is probably a useful first programming language for someone
interested in doing mathematics or algorithms but I still think, and this is
totally against the grain, that C is a good language for beginners to
programming. However, it may not be the best language to teach undergrads and
expect as many as possible to stick with CS, maybe that is not a terrible
thing? Though, that is elitist, I think C provide enough of an abstraction on
top of the machine while still allowing you to get some idea of how computers
and memory work, from a CS rather than an EE perspective.

The other benefit is that once someone wants to know how to create a game or
how to make a GUI program ... the resources are readily available and in fact
most of the libraries will be written in either C or C++. I think C over C++
because OOP concepts and syntax of C++ can be needlessly overwhelming for a
newcomer to programming.

I feel like it also gives the beginner the feeling of actually creating a
program. Those interested in learning to program will always be familiar with
normal executables such as EXEs on Windows or binaries that can be executed on
Linux. Using C means you can create something just like those programs they
are familiar with; it gives the learner a sense of really accomplishing
something, in my opinion. Creating something you have to run in conjunction
with another program and does not seem like a "typical executable" can leave
the user feeling like "OK, how do I create a real program, though?" This is
not to knock interpreted languages, at all; it's just something I think is
important for _some_ learners.

------
bartvbl
It's a fair point that the article makes. However, I've started out about 1.5
year ago with a programming group for kids in high school, and my choice was
Python. I have since not regretted this decision because of one factor: fun. I
could have gone with a weekly lecture on all sorts of theoretical things will
learn again if (or when) they start at university.

Instead, I wrote a wrapper around OpenGL that provided some functions like
"drawRectangle()" or "drawImage()", and they have used it to build all sorts
of things. Additionally, they are constantly wanting to try other stuff. I
don't think they would have done this if they didn't enjoy the process of
writing code.

------
Lerc
I looked at a bunch of things for teaching and I settled on JavaScript. It's
not ideal as a language, but it ticks enough of the required boxes. The
primary benefit was being able to teach someone without having to install any
software. Quite often I would have to use locked down school computers, so
doing everything from the browser was crucial.

I put together a simple library that has global functions to let the very
first programs do interesting things while remaining simple.

I made a mediawiki Plugin so that I could have code examples that you can edit
and run within the page.
[http://fingswotidun.com/code/index.php/Main_Page](http://fingswotidun.com/code/index.php/Main_Page)

Having simple examples that you can see,run and change helps a great deal.

This is my standard starter program.

[http://jsbin.com/camocarohi/1/edit?js,output](http://jsbin.com/camocarohi/1/edit?js,output)

It does something, and the entire program can be viewed on the one screen, so
you can keep it in one place and point to the parts to show what is happening.
When that question comes "How can I write a game?" (and it _will_ come before
the first lesson is finished, I can direct them to the list of available
functions at
[http://fingswotidun.com/code/index.php/API](http://fingswotidun.com/code/index.php/API)
point out the first entry "clear()" then put that in front of the fillCircle()
call. The program goes from a drawing program to a moving dot game. From there
you just go with the flow of "How do I make it do (X)?"

This is where a single hour lesson with my own daughter (age 11) ended up
after starting with that base
[http://jsbin.com/coguvokupu/1/edit?js,output](http://jsbin.com/coguvokupu/1/edit?js,output)

The single greatest downside to using JavaScript is that it is not
preempting/blocking. A beginner will always assume that

    
    
        var spaceShip=loadImage("myship.png")

will have the image loaded when the next line of code is reached. Events and
callbacks are not principles you want to deal with as a first step. Similarly,
you have problems when they try

    
    
        while(true){drawCircle(rand(),rand(),rand())};   
    

The reasons why they can't do things the way they assume are at a more
advanced level.

------
Anthony-G
Since I first came across Scratch, the programming language / environment
produced by MIT, I've recommended it to a number of friends who wanted their
kids to learn programming. It covers the basics of software development
(conditionals, loops, etc.) using intuitive and attractive GUI elements which
can be combined and manipulated to easily create interactive programs such as
animations and games.

It also integrates well with the web (Scratch 2 programs can be created from
within the browser) so it's very easy for users to show the results of their
work to others.

[http://scratch.mit.edu/](http://scratch.mit.edu/)

------
sbov
Javascript has been around for close to 2 decades. I'm somewhat curious if
there's a change in Javascript that has changed your mind, or is it something
you think should have been true for the past 10+ years?

------
dkarapetyan
It is amazing how much of an IDE a web browser can be. I use typescript these
days to prototype stuff and it is going pretty well. Reload and changes are
up. Nothing else even comes close.

~~~
dinkumthinkum
I think any REPL system does the same thing, though.

~~~
dkarapetyan
To some extent. I think pry comes closest to re-creating a truly interactive
development experience but the browser is slightly better especially with
source maps.

------
jdeisenberg
For getting people into programming with graphics quickly: Processing
([http://processing.org/](http://processing.org/)). Since Processing is a thin
wrapper around Java, the programming concepts transfer easily. Processing also
has a Python mode, and there's Processing.js for the JavaScript fans. If
you're a Racket/Scheme type person, ClojureScript might be an option, with
Quil for doing Processing-type graphics.

------
rbanffy
As much as I fear a Dijkstra apocalypse and how much brain damage newbies will
sustain by starting with JavaScript (and thinking arrays being hash maps to be
perfectly OK), I started with 8-bit AppleSoft BASIC and I have to say that,
while the concept of a function or recursion only appeared to me after my
introduction to Pascal, I turned out well enough. Also, I had a good idea of
how machine language programs operated - they map very neatly to what BASIC
could do.

------
kylebgorman
I don't think mobile gaming should play a dominant role in teaching
programming. (If I wanted to teach that, though, I wouldn't reach for Python,
however.)

------
PythonicAlpha
One important reason for the success of C was the library. One of the reasons
for the success of Python is the big library and the plenty of add-on modules.

But on the UI side, Python has its weak point. The other problem today is the
trouble with the migration from Py2->Py3. But on the long run, the UI problem
can be even more trouble. Python is still a good language on the server side,
even when PHP was faster and still has a bigger market share.

------
barrystaes
I learned in QuickBasic and later Pascal, and for that purpose they where
great. In my first stab at Python i had my POC running within an hour.. but i
do not like the hoops i had to jump through. Mostly the tabs, the v2/v3
incompatibilities and lingo. PHP and C# also are good languages for starters.
Today its JavaScript, but my impression is that becoming an software architect
in JS is not that easy.

------
leke
I taught my son JavaScript (along with html and css) because I think the
browser is a great platform to expose new programmers to programming. I also
think it's the most relevant because any knowledge and experience acquired is
likely going to count in some way in their future.

The JavaScript adventure can continue when we look at node on the server and
even use it to control embedded devices like Tessel and Espruino.

------
keithpeter
Lets run with the OA for a bit.

What textbook is there that is easily available in English that could support
a 30 lecture introductory course?

What 'environment' would you use? Text editor plus browser or a browser plugin
for JavaScript editing or something else?

What base selection of libraries would be included with each project in your
opinion?

Possibly linked with my first question, what kinds of projects/assignments
would you suggest?

------
facepalm
My impression is that Python is certainly not a better language than
JavaScript. They both have their quirks, so it ends up being a matter of
preference. For example Python doesn't have real lambdas, on the other hand it
has named parameters.

The only reason to use Python that I can think of is maybe SciPy.

I made me sad to witness Python gaining so much in popularity as a beginner
language in the last year.

~~~
boomlinde
I'm curious about this sentiment about python lambdas. What about them is not
real?

~~~
facepalm
It's been a while, but doesn't it have restrictions, like you can only use it
for one liners?

Edit: found this via Google - "lambda functions can not contain commands, and
they can not contain more than one expression"

~~~
boomlinde
> and they can not contain more than one expression

I don't believe that is different from e.g. scheme. Ideally, a lambda
expression would look like a normal function body, but I definitely wouldn't
discount them as "not real" on this basis.

~~~
facepalm
Iirc in scheme you can put anything into a lambda that you want.

Of course the Python lambda is "real", the correct word to use would have been
"limited" I suppose.

------
istvan__
I still recommend Ruby as the first language because it has all of the
features you want to know about as a newbie and at the same time there are
very few quirks. The things you sacrifice are performance and memory
efficiency. I have seen junior programmers picking up Ruby as be able to write
production ready code in couple of weeks. I guess the learning curve is not as
steep.

~~~
gtaylor
I don't think it's a performance and memory issue that the author is raising.
Ruby, much like Python, mostly wraps some lower level libraries for game dev.
In both cases, you either make sure your users have dependencies installed, or
you use one of the clumsy "compiler" solutions that don't always work well.

Consequently, Ruby isn't any better for the author's usage case (kids wanting
to learn to write games that are super easily portable). It _can_ be done, but
it's not going to be as easy as some of the other languages/toolkits (for that
specific usage case).

~~~
crpatino
> for the author's usage case (kids wanting to learn to write games that are
> super easily portable)

This is an artificial use case. Kids wanting to learn to write games should be
concerned with whatever works on the hardware they have available. Portability
is premature optimization at this point.

~~~
gtaylor
> Portability is premature optimization at this point.

It really isn't. If I am a new developer, you're raining on my parade by
telling me that I or my friends will have to jump through a bunch of hoops to
run my game.

In the context of learning to program as a younger person, this is a pretty
big deal. This is anything _but_ an artificial usage case, and is what the
author is specifically looking at (education).

~~~
crpatino
Expectations, expectations.

Mobile means stuff looks easier than what really is. If you cannot be bothered
to jump through hoops, this is not a career for you. What I recall of my
novice days is literally one hoop after the other. It is just that some people
enjoy jumping (this particular type of) hoops.

And regarding the social aspect, think of the days of microcomputers before
the PC. I am too young to have experienced first hand, but I recall my uncle
having a Commodore 64 and letting me use it. What I recall is that he had 2
different circles of friends: the C64 guys he traded knowledge and warez with,
and his actual friends who really need to come over home to be shown the new
feat (if they were interested at all).

------
MarcScott
I battle with the same problem with my students. I love teaching Python, and I
think it is a fantastic teaching language. JavaScript, although harder to
learn, is much more exciting for the students to play with, and libraries are
always just a link away.

My main reason for not switching completely over to teaching JS, is the
nightmare that is debugging simple syntax errors.

~~~
codecurve
Most editors have a JSHint plugin, which will check your code as you go and
point out when you've made a syntax error or used a bad practice.

I use it with Syntastic + Vim and it's a long time since I've ever loaded up
code in a browser and there's been a syntax error. Definitely worth checking
it out if that's the last hurdle before switching.

------
memracom
I would actually solve the game/show problem a different way. I would teach
kids how to build MVC web apps and set up a cheap server so that apps could be
"shown" to anyone on any device. If you use a mobile-first design philosophy
for the webapps then phones are not likely to be an issue.

Yes, there is still the issue of response time but no language works for
everything. You have to accept certain limitations and make compromises.

Actually, I might no longer even use webapps. Nowadays it is pretty cheap to
give every kid a Raspberry PI so WxPython or Pygame can be used for
everything. The showing problem boils down to borrowing a monitor, keyboard
and mouse. You could actually carry around a small portable bluetooth keyboard
and a mouse in your backpack with the Raspberry PI.

So, why stick with Python? It is because Python is a leader in moving up the
evolutionary curve towards functional languages and functional reactive
programming. I still think that Python is easier to get into that Erlang or
Scala because you can "make mistakes" but still have a working program. And by
examining the implications of mistakes you have a learning opportunity too.
Note that Javascript has been following Python's lead in adding more
functional features.

There is a general language evolution going on and Python is in the thick of
it, maintaining compatibility with the old imperative style beloved of data
crunching scientists along with the functional goodies that Haskell, Erlang
and Scala focus on. It is not out of date. It is not mired in the past like
PERL and PHP. What was good about Python 5 years ago is still good.

~~~
cageface
_I would teach kids how to build MVC web apps and set up a cheap server so
that apps could be "shown" to anyone on any device._

That's a pretty big hurdle for a newbie to get over before "Hello World".

JS in the browser has the massive advantage of being pre-installed and
requiring no special tools, with an immediate edit-run feedback loop.
Wrestling with a server and code deployment etc is a problem they can learn to
solve once they've been bitten by the programming bug.

------
skybrian
There are other languages that run in a browser and might be suitable for
teaching. How about Dart or Scratch?

------
mhd
A few months back I wondered whether one could have an introduction to
programming based on the language equivalent of "Evoland"[1].

For those who don't know this, it basically recreates the history of (console)
role-playing games. You start out in something that resembles Zelda, then
you'll get color, 3D movement and other perks.

One could do the same with a programming language, by using different
features, or even slightly tweaking syntax and semantics. One approach might
be similar to how some BASICs operate: line numbers and goto in the beginning,
than subroutines, objects etc.

Or something where people don't have to follow actual history and we're going
at things from a more mathematica/functional point of view (shouldn't be a
problem to do this with Racket dialects).

Then again, IANAT. Never mind that I would think that the _environment_ is
actually more important than the language itself (for most normal values of
"language"). So please don't inflict Eclipse on newbies.

1: [http://evoland.shirogames.com/](http://evoland.shirogames.com/)

------
IndianAstronaut
I figured this out when I was teaching my nephew programming. I started him on
Python. He got bored quickly because he really couldn't see the results of
what he did and he really wanted to make simple games.

Javascript turned out to be much better for making simple games and doing
simple puzzles.

------
avinassh
Interesting discussion on reddit -
[http://www.reddit.com/r/programming/comments/2t4pkq/retiring...](http://www.reddit.com/r/programming/comments/2t4pkq/retiring_python_as_a_teaching_language/)

------
TheDong
I completely disagree with the argument here.

The class isn't a class to teach graphics or to teach how to make android
games or how to put something on a phone. Beginning computer science classes
explicitly should not be about those sorts of things.

Beginning computer science classes should explicitly be about what a program
is, what a function is, abstractions, and so on. Not "what does code look
like". Not "how do I make a hello world program". No, what a program is.
Lambda calculus or a context sensitive grammar and lexer or what have you. If
you look at SICP, it got it 100% right there.

Now, you say, he said _programming_ , not _computer science_ , and your
argument presumes _computer science_. Even so, python and javascript are
terrible language for beginners if we ever want to see our craft improve. If
someone wants to be a good programmer, they should be able to understand the
full implications of having a proper type system, what memory safety and
management is, how functions work, and so on. They should be exposed to
haskell, lisp, rust, or the like.

If we teach a beginning programmer to use C or Python or Javascript, we're
simply teaching a new generation that memory leaks and buffer overflows are
_not_ a solved problem. That our languages are so poorly designed you have to
constantly check if your type is what you think it is. That resource ownership
is not a _solved_ problem. That functions are weak and uncomposable. By God,
you're withholding the true beauty of programming from them and showing them
some mockery.

If your students find the idea of having a webpage or a game that they
produced more appealing than delving into resource allocation issues and
understanding what a type system is doing then they shouldn't be told they're
professional programmers, they should be hobbyists coders. I'm all for people
writing toys like games or webpages in unsafe languages that have learnt
little from the last 50 years of CS research... coding but not programming.
That's great. I'm _not_ all for these same people being taught that they
should be writing security software, banking software, and doing this stuff
professionally when they have no clue what referential transparency is.

Truly, one of the reasons professionally developed software is rife with
issues is that we don't teach programming or computer science in our computer
science course; we teach some coding and software development and never even
let them know what true programming is until the theory of computation course
in senior year.

~~~
gcommer
Do note that the author is not a Professor teaching CS. If you click through
the link in the first sentence of the post, this is the question he was trying
to answer:

"What's a good first programming language to teach my [son / daughter / other-
person-with-no-programming-experience]?"

His post wasn't really about teaching CS to students who are paying for years
of classes. For his target audience, motivating them and giving them tools to
quickly build usable software is important. Being able to trivially share said
software is another plus.

~~~
Jweb_Guru
Everything the GP said above is correct, though. Since so many people's first
exposure to programming is through one of these languages, many people are
simply unaware that it's possible to do better. Many people find it hard to
switch from their first language. I agree with you that Haskell, Rust, and (to
a much lesser extent) Lisp have the problem that it's hard to get started with
easy graphical libraries aimed at beginners, though I don't agree that that's
the case for Python. This is why historically there were languages like Logo
explicitly designed as "Lisp for beginners," but today most such attempts seem
to simplify programming to the point that it can hardly be described as
programming at all (thinking of tools like Scratch).

------
flohofwoe
If the main focus of the class is to code games for smart phones the choice
should be the Unity Engine. BUT that would be the entirely wrong choice to
learn programming. Games are multi-discipline projects, programming is just a
small part of it, there are many distractions when writing a game to get
graphics, sound, AI 'look and sound right', and the visual 'rapid prototyping'
workflow of modern game engines gives you quick results, but you don't learn
anything about programming. You just cobble together code snippets from Stack
Overflow and tinker around until it feels right.

Python is a much better choice to learn programming then Javascript IMHO, then
take a quick tour into Lisp, Forth and C, and then may be worry about creating
games or UI apps.

~~~
flohofwoe
By the way, I earn my living with games programming.

------
kinleyd
Thanks for introducing me to dadgum. I read a number of his older articles and
I must say his opinions resonate with me. I'm going back in for some more. :)

------
simula67
A language like Perl 6 would probably be a good first programming language if
some good libraries become available for it.

Printing one line of text is one line of code. Then you can start teaching
branching, loops etc.

Object-orientation is also baked in.

Oh and by the way, there is this thing called "types". It helps you catch some
types of bugs early and can potentially make your programs be compiled and
thus run faster in some cases. Learn about that also without switching the
language.

Some functional programming concepts can also be taught.

Also it has a C-style syntax so switching to another similar language later on
would also be easier.

~~~
gthm
You could also not use Perl 6 for that.

Today, you could use almost any language for that.

Thanks, people who got stuck with Perl 5 code and now have to deal with it.
May the whole concept die in a fire.

------
oellegaard
The purpose of a teaching language must be to show students core concepts of
programming. Since JavaScript doesn't have proper polymorphism, inheritance,
hell even types, I don't see how they would benefit from being introduced to
it initially. We started with Java and while it was a pain in general, the
concepts were clear and you could easily go ahead with any other language
afterwards. We also had some scheme and C just to have a look at other
programming languages, but didn't do much with them.

~~~
hueving
>The purpose of a teaching language must be to show students core concepts of
programming.

Wrong. If the student isn't inherently interested in CS, teaching them all of
that up front will mask the fact that it actually takes very little to get
basic programs up and running.

For example, a sysadmin might want to learn some programming to automate some
basic tasks. You don't need to learn about polymorphism or type systems to
learn enough to become productive.

------
Beltiras
Just add HTML and a web framework at that time and all his concerns just fade
into the background. Teaches marketable skills too.

------
reacweb
javascript/html/css is a new lingua franca that is "understood" by all
computers, all OS. It is always useful to learn it whatever the purpose of the
student. If the purpose is to learn computer science, SICP remains the best
source of inspiration, even if scheme is out fashioned. Do you know if scala
is used for teaching ?

~~~
saryant
[https://sites.google.com/a/trinity.edu/csci1320-f14/](https://sites.google.com/a/trinity.edu/csci1320-f14/)

------
yCloser
I don't like this concept of "first teaching language".

It does not matter at all which one one learns first! It's not the language,
it's the ideas and the way of thinking...

This is like talking about whether it is better for a baby to speak english or
chinese, in order to learn how to walk

------
hollerith
Warning: this is a very opinionated comment.

One reason I haven't learned how to write web apps is because (sorry, but) I
consider the web-app software ecosystem to be not very good. One of the modern
web's defects relative other "software ecosystems" is that it is too
specialized IMHO for media consumption, media distribution, entertaining and
being entertained and persuading and being persuaded by "emotional" appeals
(more precisely, appeals to System I rather than System II). Another one of
its defects is that it is more complex (and consequently harder to adapt to
new situations and new purposes) than most other software ecosystems.

The topic under discussion is what programming language (and by extension,
what programming environment and what software stack) to recommend to
beginners. Here is my suggestion: it depends on whether the beginner has the
kind of mind that can stay engaged while alone and while staring at a white
screen containing only black text all day. If the beginner can do so, then I
suggest that Emacs (the version from the FSF) is the best software stack for
most beginners to learn.

Emacs is often considered complex, but its complexity is of a different kind
than the complexity of the modern web. Emacs consists of a small core that
anyone would have to master to be able to modify Emacs and to build upon Emacs
and a large amount of _optional_ add-ons. This kind of complexity is more
acceptable than the kind of complexity the web has as long as the beginner is
competent enough at deciding which optional add-ons are worthy of his
attention. In the case of Emacs, 95% of them are probably not. (More on this 3
paragraphs down.)

Most of the changes I want to make to my personal software environment (as a
heavy Emacs user and experienced Emacs-Lisp programmer) can be made in Emacs.
In other words, Emacs is a kind of non-proprietary "middleware" just as the
web is a kind of middleware (which is admittedly non-proprietary in the parts
most essential for a beginning programmer) and just as terminal-emulation apps
plus TTYs and PTYs plus ssh plus the ncurses library and cursor-address using
ANSI terminal codes is a kind of non-proprietary middleware on which a wide
range of software applications (or the user interfaces of the applications)
can be built. And I recommend Emacs over the "platform" consisting of
terminals, TTYs, cursor-addressing and traditional Unix shells (including rc)
because (very briefly) that platform has too many of it design decisions came
out of an environment so constricted in computing resources as to be mostly
irrelevant for today and because the common mouse idioms really did represent
an advance in the state of the user-experience-design art. Hey, since I've
already risked offending a large HN contingent (web programmers), why not risk
offending a second large contingent (those who like apps that use a terminal
for interacting with the user)!

I am aware that not all prospective programmers can stay engaged while staring
at plain text all day. They would get bored. To stay engaged, they need more
stimulation, e.g., colors, graphical elements, things that move around on the
screen (or they need a social element, social interaction being very
stimulating for humans). For them, maybe the web is the best environment in
which to learn how to program (since it is difficult to learn programming
while continuously staying engaged socially). I concede that I have not really
studied the issue, so I am (provisionally) willing to believe the general
consensus on this page -- but only when it comes to beginners who cannot stay
engaged while staring at plain text all day.

Since 95% of Emacs's add-ons (including almost everything in ELPA and MELPA
and much of what is distributed in the Emacs app itself) is not worth learning
or embracing, perhaps I should add to my recommendation of Emacs the further
recommendation that before tackling Emacs, the beginner should first explore
and learn how to use OS X so as to give him or her a fighting change at
learning how to tell which 5% of Emacs is worth learning and worth adopting.
(I consider most popular apps on OS X to be well-enough designed to be worth
learning, and my hope in making this recommendation would be that those
examples of good-enough design will rub off on the beginner to the extent that
he or she would be semi-competent in deciding what parts of Emacs to learn.
Textmate in particular has a very well-designed user interface, but Textmate
is just text editor for coders, not a flexible middleware like Emacs is, so
stay with Textmate only long enough to get an idea of what good user-interface
design is.) Certainly, I believe that most beginners should stick to
_graphical_ Emacs so that the common mouse idioms (moving the insertion point,
selecting by dragging) are available, leaving Emacs running in a terminal to
experienced employed programmers who need to ssh in to servers a lot. Also,
stick to dired mode as opposed to other ways of navigating and making changes
to the file-name space, and avoid org mode, shell mode, eshell mode and
_especially_ term mode: org mode makes you learn too many new commands and
keyboard shortcuts, and shell mode, eshell mode and especially term mode are
too rooted in the very old "ANSI terminal, cursor addressing and Unix command
line" way of doing things, which IMHO is overrated on HN unless the goal is to
become a professional sysadmin or maybe devops person. And all 4 of those
packages / libraries, org mode in particular, do not allow the user to use the
mouse enough IMHO.

A more important reason I haven't learned how to write web apps is because the
web is our civilization's most important medium for reading, publishing
writings and browsing (in the old sense of "browsing" as in browsing through a
section of a book store) through collections of textual documents, and IMHO
the more people writing web apps, the less suited the web becomes for this
essential civilizational function -- because as a general principle, when a
software ecology such as the web is adapted for a purpose A then it naturally
tends to become less useful and less good for purpose B. In other words, a
complex software system serving 2 masters serves those masters less well than
a system serving only one master.

Again, I realize that not everybody finds reading static textual documents on
the web stimulating enough to keep at for large blocks of time. however, for
those of us that do, and who are using the web for a serious purpose (e.g.,
learning, teaching, inventing, creating new scientific information) the web of
1998 (when the web was already pretty good for reading, publishing and the old
pre-electronic sense of "browsing", but had not been significantly adapted or
specialized for writing web apps) was generally superior to the web of today.
And I believe that the people for whom the web of 1998 was generally superior
to web of today deserve some consideration, and I choose to show them some
consideration by refraining personally from learning how to create web apps.

I am receptive to follow-up questions via email, especially from beginning
programmers.

~~~
hollerith
I did not sufficiently explain what I mean above by including "traditional
Unix shells" in the list of things over which using Emacs is preferred.

In my .emacs are calls to such Unix "command line" programs as Rscript, OS X's
open, sudo, rm, gzip, chown, chmod, /opt/mozilla/bin/firefox, OS X's
screencapture, fetchmail, OS X's system_profiler, shutdown, ping, ps and
growlnotify.

A popular and very much traditional way to call such programs (even in
languages like Ruby) is via a traditional Unix shell (invoked usually in
languages like C, Perl and Ruby by the "system" function), but there is no
need to do that. In emacs for example, one can bypass the Unix shells by
writing something like (call-process "sudo" "mv" "-i" "/foo" "/bar"). call-
process in turn does a fork and exec and the exec gets the command name (in
this case "sudo") and the command's arguments (here, "mv" "-i" "/foo" "/bar").

Actually, "sudo" might have been a bad example because for all it know is
implemented by calling out to a traditional Unix shell (though one can
certainly implement it without doing so). I'm not a purist striving to
eliminate every use of a traditional Unix shell on my machine -- that would be
a waste of my time.

Point is, I do not write shell functions and shell scripts anymore -- I write
Emacs Lisp code instead.

I used to make heavy use of traditional Unix shells and other parts of "TTY
world": from 1997 to 2005 or so, my only interaction with my computer, a Linux
box, was via the Linux console. For the 5 years before that my only
interaction with Unix and with the internet was through an old-school actual
terminal and (later) and IBM PC XT running a terminal-emulation app and almost
no other apps. But I've discovered, slowly over the years, that I'm happier
writing Emacs Lisp even for things that are traditionally done with shell
scripts and with shell functions defined in ~/.bashrc.

For many experienced Emacs users, Emacs is just another component of "TTY
world". these users typically use Emacs in "text mode" or in "-nw mode" (i.e.,
without a windowing system) and perhaps they use shell mode, eshell mode or
ANSI-Term mode, all of which pretty much require the use of a traditional Unix
shell. But it's not difficult to use Emacs without making constant use of the
components of TTY world.

------
frozenport
Life isn't all about game, sometimes its about matrix multiplication and NumPy
and SciPy do this exceptionally well.

~~~
jacquesm
Sure, but that's not how you start.

------
alextgordon
\- No memory management

\- No pointers

\- No cache

\- No branch predictor

\- No interrupts

\- No endianness

\- No alignment

What exactly are we teaching students to program? It's certainly not a
computer.

~~~
est
The best part is you can't forEach or map an HTMLCollection object. You have
to [].forEach.call it. lol

~~~
bzbarsky
HTMLCollection is a messed-up puppy, sadly. Consider this markup:

    
    
        <img name="forEach">
        <script>
            document.images.forEach.src = "something";
        </script>
    

This works, today, in all browsers. Adding "forEach" to the proto chain of
HTMLCollection would make this code no longer work, so no browser is willing
to add it for fear of breaking sites.

The answer is to stop using HTMLCollection.

What's worse is that NodeList doesn't have this named-lookup issue, but
putting Array.prototype on its proto chain (the obvious simplest way to get
all the array goodies) again breaks websites, because some people uses
"instanceof Array" to assume things about how an object will interact with
Array.prototype.concat.

Long story short, making improvements to the DOM is very hard because of the
two decades of weird website hacks that are supposed to not get broken in the
process...

------
elwell
I would almost suggest CoffeeScript in place of JavaScript. In fact it feels
more like Python. My main concern would be lack of Google-able resources
compared to plain JS.

~~~
jitl
Coffeescript is clearly in the same vein as Ruby: designed by experienced
programmers for experienced programmers. The list of caveats and gotchas for
both languages is a mile long, and the grammar of both is ambiguous. I love
both languages dearly for letting me be a trixy wizard but would never
reccomend either to a beginner.

~~~
elwell
I would argue that CoffeeScript has less _gotchas_ than JavaScript. And, while
you can be a _trixy wizard_ with CoffeeScript, it certainly isn't required.
The leaner and more linguistic syntax would aid beginners.

------
aerovistae
So incredibly in favor of this.

I love python, it's probably my favorite language. I taught a class on it in
Boston. But these _exact_ questions have indeed brought doubts into my mind.

Year after year I'm disappointed by what python simply cannot provide in any
straightforward way. The options are very few for making games. The options
are very few for desktop GUI (I tried to do PyQt and then discovered QML with
JavaScript and quickly left python behind for that project). The options are
few for back-end web development-- yes, there's Django, but it just doesn't
have the clarity, documentation, and community that Rails has, or Wordpress
(different type of entity, I know), or many others. Flask is amazing but small
in scope and community.

I'm a professional JS developer by day and I used to think JS was awful for
teaching, because the functional side of it is nightmarishly confusing IN
GENERAL, let alone to someone new to programming. Its objective/prototypal
system takes quite a bit of getting used to, also, and it has many other
quirks.

But, for the _EXACT_ reasons mentioned in this linked post, I changed my mind.
The fact that JS can be used for _almost anything_ nowadays, is ubiquitously
in demand, has a massive, massive worldwide "community," and allows easy GUI
manipulation via HTML/CSS, makes it the best candidate for teaching by far.

It'll just take some careful consideration as for how to approach it best.

~~~
orangecat
And this is why I'd argue that Python 3 was a big mistake. In exchange for 6
years and counting of freezing and bifurcating the ecosystem, we got a
smattering of minor improvements that don't substantially change the developer
experience. What could we have had if that effort had instead been focused on
things like real performance optimization and native browser support?

~~~
pekk
This makes the false assumption that resources put into Python 3 somehow
prevented "native browser support," something that has always been firmly in
the hands of browser vendors and was never blocked by insufficient loyalty to
Python 2. The world where just giving up on Python 3 would magically bring
huge benefits never existed.

If you don't want to use Python 3, keep using Python 2 through its EOL in
2020+ but why interfere with other people happily using and preferring Python
3 for years now? It is not interfering with you.

~~~
rdtsc
> This makes the false assumption that resources put into Python 3 somehow
> prevented "native browser support,"

Agreed, browser support was probably unrealistic.

However other points still stand.

Python 3 was a mistake. It at the wrong time (too late), and didn't bring
enough. The talks, and the time, and drama around it weren't worth to get dict
comprehension and unicode support.

A 10x speed improvement (heck, just a 2x) would have been. Better IO handling
via something sane like lightweight threads (via an already existing framework
like gevent or eventlet). Better packaging. Better default GUI library.
Refresh the standard library with something like requests, ipython...

Python had a golden opportunity and it squandered it. There were

~~~
nodejsisbest
There were, there were. I think Node.js is the way of the future with their
evented IO platform.

~~~
rdtsc
> I think Node.js is the way of the future with their evented IO platform.

But can I use it to build microservices?

