Live data from Hacker News

Retiring Python as a Teaching Language

prog21.dadgum.com

101–110 of 238 posts

Re: Retiring Python as a Teaching Language

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

Re: Retiring Python as a Teaching Language

#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] 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/

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

Re: Retiring Python as a Teaching Language

#103

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…

Beginners that aren't in a formal class setting (and his description more closely describes mentoring someone outside of the classroom (son/daughter)) have not yet made the decision to invest in learning things from first-principles as a university student has already locked into doing. So, for these beginners there must be some kind of reward or immediate application for their efforts if we even expect them to continue past the stage of early burn out. This is what the post speaks to.

Re: Retiring Python as a Teaching Language

#104

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…

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.

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.

Re: Retiring Python as a Teaching Language

#105
post #91

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…

One of the first steps in teaching is motivation.

Beginners that aren't in a formal class setting (and his description more closely describes mentoring someone outside of the classroom (son/daughter)) have not yet made the decision to invest in learning things from first-principles as a university student has already locked into doing. So, for these beginners there must be some kind of reward or immediate application for their efforts if we even expect them to continue past the stage of early burn out. This is what the post speaks to.

Re: Retiring Python as a Teaching Language

#106

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

Interestingly, it's already the Sergeant At Arms in most US legislatures who deals with things like IT, certificates, etc.

Re: Retiring Python as a Teaching Language

#107

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…

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.

Re: Retiring Python as a Teaching Language

#108
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

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

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

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.

Re: Retiring Python as a Teaching Language

#109

Earlier quoted context omitted.

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.

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…

You are completely assuming that everyone who wants to program is intending to do so professionally, or that they won't be able to grow from a basic intro of "here is how to present your thoughts programmatically" and then cover the deeper subjects later, as they need to.

This is especially relevant as we start teaching programming at younger and younger ages. I hope it's obvious that when kids start programming in 4th grade, it's much more intuitive to start them on Logo than lambda calculus...

See, for example: https://neil.fraser.name/news/2013/03/16/

Also, if you look at the amount of money that "Flappy Bird" made, perhaps making brain-dead iPhone apps isn't such a bad deal...

Re: Retiring Python as a Teaching Language

#110
post #25
post #5

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

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

> I think a lot (over 50%) of JavaScript devs 5 years from now will still be using Funny, I'd make the opposite prediction... the JavaScript devs I've known have been among the most curious and open-minded developers about different ways of doing things, interested in experimenting with different idioms made available by the flexibility of the fundamental language, and quick to adopt them they found them useful (possibly too quick). They're people who figured out how to get many of the benefits of the language features you've listed above starting with the language features that were available years ago.

Which kindof makes sense: everybody else was too busy complaining about function scope instead of block scope or how they couldn't get their heads around Prototypes instead of Classes or having to reason about this scope or truthy/falsey values or whichever difference/wart scared them off to bother learning to use the tools at hand.

No, my bet would be that ES6 adoption will take up a lot quicker than, say, Python 3.

(and most of the lagging will probably happen around frameworks with imported paradigms -- Angular 1.x, I'm looking at you in particular -- and other aging codebases).

Post reply on HN