Live data from Hacker News

Retiring Python as a Teaching Language

prog21.dadgum.com

121–130 of 238 posts

Re: Retiring Python as a Teaching Language

#121

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 yea…

> Thus, I don't really think that learning Python offers solid programming foundations.

I agree. But there is a huge class of people that this argument tends to miss - all the people who learn programming as a tool and not a way of life, like scientists or engineers from other departments. For those, it's ideal to learn one language, and it's OK if they don't completely understand CS. For them it's better to know a language that has wide range of practical applications.

So unless you are absolutely sure that you're going to learn CS, I would still suggest Python as a first (and possibly only) language.

I would also say that doing GUI in like PyQt is really easy, but the documentation and tutorials are lacking.

Re: Retiring Python as a Teaching Language

#122

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 yea…

That's the approach Berkeley CS (and a lot of other CS programs, but I can only speak to UCB's coursework). The first CS course teaches fundamentals of computer science, using (mainly) python, but also Scheme and a declarative language to explore the concepts.The subsequent coursework exploring Data structures/Algorithms uses Java, and then system-level architecture uses C and MIPS.

Every professor is extremely careful to make sure nobody leaves the course believing "This was a python course" or "This course taught me Java"; rather they emphasize the topics covered, using whichever language as the tool for exploration. Python is a great choice in this regard BECAUSE of how rapidly prototyping happens, perfect for a course built for exploration.

Re: Retiring Python as a Teaching Language

#123
post #102

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…

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/

Re: Retiring Python as a Teaching Language

#124

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 yea…

> Thus, I don't really think that learning Python offers solid programming foundations. I agree. But there is a huge class of people that this argument tends to miss - all the people who learn programming as a tool and not a way of life, like scientists or engineers from other departments. For those, it's ideal to learn one language, and it's OK if they don't completely understand CS. For them it's better to know a l…

This is a really good point.

I am not a programmer at all, but did learn a little bit of ASP.NET at university. I never use it anymore, but I ended up teaching myself PHP.

I use PHP regularly, not to build anything grand - but it gets me by. I can write little scripts like working out who's unfollowed me on Twitter, small information systems, reminder applications, hack Wordpress plugins, etc.

I wish I was taught Python at uni right out of the blocks. I've tried to learn it a few times, but ended up forgetting to do lessons and just going back the the crutch that is PHP.

The theory of CS is way beyond me at this stage of life, but a little bit of programming knowledge is a very useful thing (even if it is only PHP)

Re: Retiring Python as a Teaching Language

#125

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" appea…

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.

Re: Retiring Python as a Teaching Language

#126

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 u…

Pretty much everybody I know that eventually went on to write code for a living starting hacking on little toy projects long before they got anywhere near a computer science course. JS in the browser is a great environment for people to start experimenting and dabbling in the same way that things like LOGO and Basic used to be in the early PC era.

Re: Retiring Python as a Teaching Language

#127

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 yea…

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

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

Could you explain what you mean by Racket lending itself to algorithm complexity, recursion, etc better than Python? I really don't see why one or the other is more conducive in this respect.

Re: Retiring Python as a Teaching Language

#128
post #98

Earlier quoted context omitted.

I'm sorry, your comment isn't making clear what teaching programming has to do with distributing graphical applications. Could you clarify what 'these reasons' are?

Teaching intro programming courses with "parse a CSV file" or "implement a text based calculator" is outdated. Modern students have grown up with smart phones and are used to being able to click around and have the computer react graphically. Students learning with C or Python have a large chasm of GUI libraries they have to cross before they can make anything like the UIs they are used to seeing. Being able to make…

That's exactly it. There's an argument for teaching programming from the top down, starting by modifying GUI programs, rather than from the bottom up, at the bit level. See: http://radar.oreilly.com/2014/03/a-concrete-approach-to-lear...

Javascript now has all the major language features Python does. It's not quite as ugly as it used to be. There's strict mode, which disables some of the worst legacy crap. You can use Javascript on servers, desktop clients, and phone clients. Try doing that with Python. Compilers for Javascript generate amazingly fast code today.

Javascript has a tradition of bad, obfuscated code with no comments, but that's not the fault of the language.

(I used Python for years, and prefer it to Javascript. But Python remains limited. Just distributing a Python program is a pain. Yes, there are several systems for making an installable executable from a Python program. They sort of work. It's not considered a standard operation.)

Re: Retiring Python as a Teaching Language

#129

Earlier quoted context omitted.

In case anyone hasn't heard of it, Asm.JS is basically trying to turn JavaScript into a similar standard. Combine that with sourcemaps in browser debugger tools and we're really close. I've been using clojurescript recently, and I can even connect a REPL to the browser and make on-the-fly changes just like we've always been able to do with JavaScript.

What I really wish someone would build is this: Create a platform-independent machine language which is designed to be translated into arbitrary other machine languages. Then put the equivalent of FX!32[1] in the browser to translate it to whatever architecture the client is running on. And have a compiler that will compile to both that and to asm.js, with asm.js being used (with consequent lower performance) for leg…

> Create a platform-independent machine language which is designed to be translated into arbitrary other machine languages.

> The point here is that it isn't a VM at all. It's just an intermediary platform-independent binary code.

PNaCl ?

Re: Retiring Python as a Teaching Language

#130
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.
Post reply on HN