
Python squeezes out JavaScript, C as best starter programming language - btimil
http://www.itworld.com/application-management/401419/python-squeezes-out-javascript-c-best-starter-programming-language
======
Derbasti
I have taught an introductory course for programming in Python, and there
certainly are a few areas that are less than ideal for beginners.

1) Setting up Python, a text editor and a shell is easy on Windows (using
WinPython), but pretty confusing for Mac users.

2) It is actually surprisingly difficult to teach object oriented programming
in Python, since most simple problems are much more easily solved in a
functional manner than with classes.

3) It is more or less impossible to peek under the hood. There is no way to
teach integer logic really (Python has auto-growing arbitrary precision
integers) and floats can lead to strange errors (x=1; for i in range(10):
x+=0.1 does not yield 2).

4) It can be very difficult for students to grasp the difference between
different types and when or how they are to be used. I suspect that these
kinds of problems might be more easily explained in C.

All that said, I feel that the students did learn quite a few things that
would have been more or less impossible with C or Javascript. In many ways,
Python provides a happy medium between full-on dynamicism and strictness. Four
stars, would teach again.

~~~
zhemao
Could you explain how setup is more difficult on a Mac than on Windows? Other
than a decent beginner's text editor, everything you mentioned comes pre-
installed on OSX. Trying to install 3rd-party Python libraries on OSX is kind
of a pain, but if you're just using the standard library (which will get you
pretty far in an intro class). Finding a good text editor for Mac also isn't
that difficult. When I've taught beginners on a Mac, I usually just download
Textmate.

~~~
KC8ZKF
Doesn't Emacs and Vim come preinstalled on OS X? Or has that changed with
Mavericks?

~~~
zevyoura
Those are exceptionally poor choices for a beginner's class.

~~~
KC8ZKF
I disagree. Why do you say they are?

~~~
zhemao
Most new students have seen a text editor before (like Notepad or Microsoft
word). They are used to things like using the arrow keys for navigation
(instead of HJKL), not having to switch modes, and using the mouse to
manipulate text. There are plenty of serviceable programmers' text editors
which follow these idioms. Better to let students use something familiar so
you can focus on the actual subject (programming) and not frustrate them with
learning a completely different set of keyboard shortcuts.

~~~
KC8ZKF
When was the last Emacs that didn't use arrow keys by default? 1987 on a VAX?
Ditto with mice and such. And it's modeless.

People just ape things they've heard without thinking. Emacs and Vim may not
be perfect beginner's editors, but they are much better than just decent.

------
sdegutis
Lately I'm way more excited about Julia than I've been about any language for
years. My son is learning programming, and I was debating between starting him
off with Ruby, Python, or Clojure. But I think Julia might just be it. Out of
all the languages I've learned it definitely feels the most intuitive. As I
read the docs, I constantly find myself saying "yes! this is how it should
work!" way more than I did when I learned any of the aforementioned languages
(except maybe Clojure).

~~~
csense
I think the Python community is more mature in terms of the number and quality
of applications and documentation. Julia is getting close to critical mass,
but it's still "niche," but Python is firmly "mainstream."

I think it's important that a beginner's first "real" language is a mainstream
language, due to the existence of libraries and a community which will help
them through and beyond the "beginner" phase.

Clojure suffers from the same problem as Julia (not mainstream), and Ruby
suffers from the same problem as JavaScript (most applications are tied to web
development, which is such a Gordian knot of related technologies all tied
together that it will simply overwhelm most beginners.)

EDIT: Seriously, parent was downvoted? _Why?_

~~~
sdegutis
Lack of community isn't a problem for him, since he has me to help him, and
I'm proficient in all these languages. However you bring up a good point, I am
somewhat concerned about lack of tooling and libraries.

~~~
csense
> he has me to help him, and I'm proficient in all these languages

I think we have different assumptions about the goal of teaching your child
programming. Your goal appears to be "create an activity where parent and
child can spend time together." My goal (if I had children) would be "get them
to be able to program independently as soon as possible," because IMHO that
will ultimately both increase the amount they learn (because they'll start
learning on their own time to scratch their own itch, just like mature hackers
do, so the amount of learning your child does is no longer so dependent on the
amount of time you spend teaching them) and increase the probability they'll
stick with it for the long term (because being able to do their own projects
and have their own ideas makes it much more attractive, especially as they
head into the teenage years and start to establish their own identity).

Having an activity parent and child do together which increases emotional
family bonds is great, but I think the more important goal is the transfer of
knowledge, skills and the hacker mindset.

Disclaimer: I don't actually have kids, but if I did, the above would describe
my philosophy.

------
yeukhon
Python certainly makes sense to new programmers because the only thing that
makes people wonder is the indentation. But with good resource out there
(books, stackoverflow, Codeacdemy, Coursea, visual Python), Python tutorials
have been better. The language also makes reading code quite easy.

On the other hand, Javascript seems to be always start with HTML and CSS.
That's where the obstacle is. People begin playing around with three separate
technology and the learning is really high.

however, if you ask me "yeukhon do you recommend freshman start with C / C++"
I'd say absolutely. I am a bit bias since I knew a bit C++ before I started
Python (although my first official programming class in college was Python and
Matlab... funny right?) but I think the learning curve in statically typed
languages like C++ is absolutely helpful in the long term.

If people want to learn Python without Hello World, try
[http://www.youtube.com/watch?v=RrPZza_vZ3w](http://www.youtube.com/watch?v=RrPZza_vZ3w)

~~~
nawitus
These days you can start JavaScript with Node.js and create simple command
line applications.

~~~
bphogan
I agree with this. I currently teach beginning programming using JavaScript in
HTML, and we currently just provide pre-made web pages for the students to
write their basic programs in. They come in already knowing basic HTML as
they've taken a previous class.

But I've been thinking of rewriting the curriculum to use Node.JS for about a
year now. The only reason I haven't yet is that the students seem to enjoy
doing things in web pages.

I think there's something awesome about writing console apps, but I don't know
if they really hold the attention that today's students have.

------
alkonaut
To be a good developer you'll need to learn several languages, but that is
beyond the scope of the article. But in terms of a "first" language, are those
who learn python first and THEN C, Haskell and C# in the end more likely to be
better developers than those who learn the same four languages in another
order?

I think it's unlikely that the language you start with has much effect in the
end. Those who never use a low lever language or never use a functional
language will be worse developers than those who do, however.

So for a first language: just pick a fun one. If you happen to pick JS you can
always choose again later.

~~~
marcosdumay
My impression is that if you follow that order you are way more likely to get
through the end than if you followed any other order (except by switching
Haskell and C#, I don't think that'd matter). But yes, if you did go through
those languages in another order, there is no reason to think you'd know any
less than somebody that followed the "easy" sequence.

------
gravedave
How about picking a focus, then a language? I see no point in "becoming a
programmer". Want to make web apps? JS. Want systems? C. And so on.

Going for a "first" programming language seems to assume certain things:

* That you ARE going to become a programmer and that you will NOT change your mind/priorities

* That somehow whatever language you first pick will definitely be useful for your final goal. Sure, C will teach you all the ins and outs of manual memory management, but why go through it if all you really need is Processing?

* That there is some special point in time when you're supposed to learn how to deal with the grave dangers of the misplaced semicolon/memory leak/etc.

How many of those "learning to code" really become programmers and end up
doing it for a living, or making habitual use of pointers or some other
concept that a programmer must/must not deal with in their first programming
language?

~~~
dinkumthinkum
But some people are actually interested in being competent in computer science
and not just whipping out blog engines in the latest fad framework.

~~~
gravedave
The main idea still applies. C and Scheme show very different aspects of
computer science, so even those people will need to choose a focus.

If all you want to do is "become a programmer" you'll discover that you'll
never get there, as there's always more to know. If you're asking yourself now
what language to pick, you'll later ask what to learn next, and once you've
done that, ask again. Asking what first language to pick is just the first
manifestation of a potentially never-ending bad habit of never gaining focus.
This applies to both web apps and computer science.

------
atomicdog
>“I see JavaScript as the modern equivalent of BASIC. ...because of its
simplicity, it is a great language for learning fundamental programming
concepts.”

So what's wrong with BASIC? It still exists...

~~~
sehr
Because people still use JavaScript

------
atmosx
Sure, and Ruby squeezes out Python as a starter language because it's closer
to English and the identation doesn't have to be strict.

That said, I find both Ruby and Python considerably user-friendly and
extremely powerful. JS of course is today's hot stuff and if you want to be
on-top of the game, you have to know and understand JS. But once you've become
comfortable with any other OO language JS is easy.

~~~
marcosdumay
Strict identation is a good thing.

A teacher can compensate a non-strict compiler by being strict himself, but
identation is one of the most important concepts you should be teaching to
beginners.

------
anaphor
>“Python, because you do not need a compiler and it's very VERY easy to run
your programs and test.”

That really depends on your definition of "compiler". If your definition is
"translates a high level language into machine code" then the popular
implementations don't do that. But the most popular implementation does pretty
much act like a typical compiler except that it generates code for a VM, not a
physical machine.

On a more on topic note, these sorts of things are pretty pointless because
it's just the Emperor's nose thing really.

"Nobody was permitted to see the Emperor of China, and the question was, What
is the length of the Emperor of China's nose? To find out, you go all over the
country asking people what they think the length of the Emperor of China's
nose is, and you average it. And that would be very "accurate" because you
averaged so many people. But it's no way to find anything out; when you have a
very wide range of people who contribute without looking carefully at it, you
don't improve your knowledge of the situation by averaging. "

~~~
eshyong
I think the original meaning of that quote is more "I don't need an
intermediate compiling/linking step before I run my program," not "Python
doesn't need a compiler because it doesn't lex/parse/generate code." I agree
it's an ambiguous and confusing statement though.

------
pera
Where is Scheme? :'(

~~~
eternalban
> :(

More like ((((.))))

But seriously, given how much effort the folks behind DrRacket have put in
making programming accessible [1] it really makes you wonder if m-expressions
are not such a bad idea ..

[1]:
[http://en.wikipedia.org/wiki/Racket_features#Educational_Too...](http://en.wikipedia.org/wiki/Racket_features#Educational_Tools)

~~~
anaphor
It's funny how often I see people criticize lisp's syntax and write things
that aren't even valid syntax like (() ()) or (()) (assuming they don't get
autoquoted).

~~~
eternalban
Fine, let's see your 'syntactically valid' LISP smilie .. and also one for
'tin ears' while you're at it. TIA!

------
pjmlp
Well, that was always one of Guido's goals if I am not mistaken.

------
reuven
I've been teaching programming to many people, for many years. The majority of
my students are experienced programmers, but no small number are new to
programming beyond very simple stuff. I've found that Python has a number of
aspects that are ideal for first-time programmers:

\- It's dynamically typed. Say what you want about static vs. dynamic typing,
but this is one less thing that newbie programmers have to get right. There's
no chance of an error when they say "i = 'abc'", if you've defined i to be an
int.

\- It's interactive. The fact that you can "play" with the language within the
interactive shell is a huge selling point. IPython and the IPython Notebook
are easy to get working, and for people to work with.

\- Python's restricted command set and simple, regular syntax let you
concentrate on ideas: Yes, many newbies to Python (and to programming in
general) get confused by indentation, blocks, colons, and the like. But
they're going to get confused by the syntax of nearly any language. Python has
a simpler syntax than most other languages, meaning that there's less to
learn, and less to remember. This lets the new programmer concentrate on the
ideas that they're learning, or the implementation of what they're doing.

\- It's cross platform. The fact that people can use Python on any computer
they like is a big selling point.

\- You can easily teach object-oriented and functional-style programming.
Python is obviously object-oriented, but can also be used to introduce
functional programming. In this way, you can expose programmers not only to
multiple paradigms in Python, but also in other languages.

\- You can use it for real applications. People are often surprised to
discover that real-life applications are being written and used in this
language that they're learning, which seems so simple.

I'm sure that there are more reasons than these. But let's consider the
alternatives that the article suggested:

\- I would be hard-pressed to think of a _worse_ first language than C. You
want to introduce people to the concepts of programming, which means
abstractions and high-level thinking. C forces you to think in terms of the
computer and its memory, which is just the opposite. The fact that it's
compiled to binary form, that you don't have an interactive C shell, and
pointers are just three reasons why I think that C would be a very bad choice.
Sure, everyone should learn C at some point -- although I often point out that
I'm a much happier person since I moved to dynamic, high-level languages many
years ago -- but if you want to teach the concepts of programming, C is going
to require too much learning just to get simple things done.

\- JavaScript has many good points for beginning programmers -- but the chief
problem, in my mind, is the language's syntax, which is far too inconsistent
and forgiving/flexible for newbies. I think that someone coming to JavaScript
from Python will have a very easy time; the mapping of data types is fairly
straightforward, and even the notion of passing functions is pretty easy to
get. But the learning curve in JavaScript seems steeper to me than in Python,
despite the obvious advantages of being able to work within a browser.

~~~
bliti
It is also not very verbose (most of the time (I'm looking at you list-
comprehensions))

~~~
cjfont
The use of list comprehensions is optional, and would probably not be covered
in an introductory course anyway.

------
neoyagami
I wish they( my teachers back then ) had python but instead we ended learning
cobol :( unforgiving syntax but boring as hell

------
_random_
Best for starting... You just need to remember to move on later!

~~~
bayesianhorse
Why do you have to move on? The one disadvantage to Python as a beginning
language is that there are few strong motivations to move elsewhere...

~~~
_random_
Dynamic typing and it's consequences. It's handy when you start and want to
cut the amount of things you have to care (safety).

~~~
bayesianhorse
I don't care about "type safety" discussion. Hardly have I heard this argument
from serious Python users at all. You won't hear Python users bitching about
bugs that could have been caught by some compiler magic. I do hear programmers
bitching about other compilers and their anal retentiveness though...

For me type safety just isn't an issue in practice. Guido also says, and
rightly so, that every moderately large project, especially in a strongly
typed language, eventually implements all sorts of mechanisms for dynamic
typing, even if these mechanisms are then called something else.

~~~
_random_
Hardcore Python fans will always defend it. I am just asking to think out side
of the box.

[http://evanfarrer.blogspot.co.uk/2012/06/unit-testing-
isnt-e...](http://evanfarrer.blogspot.co.uk/2012/06/unit-testing-isnt-enough-
you-need.html)

~~~
bayesianhorse
Hardcore Fans of static typing will always attack our state of well being. We
shouldn't feel this good about Python because we are "clearly wrong". Is that
it?

------
bayesianhorse
How come most discussions about the merits of Python devolve into praising
Julia?

