Live data from Hacker News

Retiring Python as a Teaching Language

prog21.dadgum.com

211–220 of 238 posts

Re: Retiring Python as a Teaching Language

#211
post #112

Earlier quoted context omitted.

It's important to ask "teach what?" There are a lot of foundations that simply aren't going to be relevant to large subsets of students. Teaching C, for instance, is nearly useless if you're trying to convey FP concepts or object-orientation. I certainly support including C as a core part of any university's Computer Science curriculum. But such a curriculum should include as many languages as possible, each delibera…

> Teaching C, for instance, is nearly useless if you're trying to convey FP concepts or object-orientation. C is superb for teaching how to manually implement polymorphic behavior in the absence of object-oriented features. Using it to demonstrate how (class-based) OO languages work should be standard in any course that has CS in its title. (Using it to demonstrate how to implement prototype-based inheritance would b…

> Using it to demonstrate how (class-based) OO languages work should be standard in any course that has CS in its title.

I'm not sure if you meant to put it that way, but that is a horrible standard for "any course that has CS in its title". I would not like to walk into a course on, say, intro to AI, and have a session demonstrating how class-based OO languages work using C.

For the general thrust of your point, cbd1984 pretty much covered everything I would have said in response.

Re: Retiring Python as a Teaching Language

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

Re: Retiring Python as a Teaching Language

#213

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…

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

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

This presumes that the people reviewing the book are a random sampling of the population, rather than being significantly skewed toward a subpopulation in which the "the one person in 50 who has this strange way of thinking that makes a programmer" was overrepresented compared to the population at large.

People who have enough interest in programming to pick up a text on it, enough concern about programming texts to bother to write give feedback on one, and -- more importantly -- all that for one with SICPs reputation for rigor and focus on a language that isn't the currently-industrially-popular language-du-jour are going to include people who have the "strange way of thinking that makes a programmer" at, one would expect, a much higher rate than the general population.

> what should we optimize for in a intro to CS class and why?

That depends, among other things, on the role of CS in the broader curriculum. There's more than one right answer: SICP has one focus, HtDP has another -- and both are appropriate focuses for an intro to CS course. SICP represents a focus that is appropriate for a first course for majors in an environment where CS isn't part of the "core", HtDP has a focus that is appropriate for a first course in CS as part of the core curriculum.

Re: Retiring Python as a Teaching Language

#214

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 ?

https://sites.google.com/a/trinity.edu/csci1320-f14/

Re: Retiring Python as a Teaching Language

#215
post #129

Earlier quoted context omitted.

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 ?

Basically, yeah -- just add a target for asm.js so the same code can run in browsers that don't support PNaCl.

Re: Retiring Python as a Teaching Language

#216

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.

You can 'fake' real lambdas in Python, exploiting the things that it does allow. My approach uses continuation-passing style: https://github.com/yawaramin/lambdak

Re: Retiring Python as a Teaching Language

#217
post #71
post #26

Earlier quoted context omitted.

Optional gc is not something I've seen work in practice. Apple abandoned their attempt because of the difficulty getting gc'd and non-gc'd code to play together nicely. Rust has (and may again) offer something like optional GC, but it will operate at the value level rather than the program level and thus doesn't really solve the library problem. Programming languages are designed in a huge, multi-dimensional space. S…

> Optional gc is not something I've seen work in practice. Apple abandoned their attempt because of the difficulty getting gc'd and non-gc'd code to play together nicely. Rust has (and may again) offer something like optional GC, but it will operate at the value level rather than the program level and thus doesn't really solve the library problem. Well, you could make 2 compilers for languages with the same syntax, a…

I think Rust attempted to do a much more conservative version of this (same language, different sigils on pointers depending on whether pointers were refcounted or ownership-transferred) and determined that it didn't work in practice. Libraries have to use one scheme or the other, nobody made APIs that exposed both schemes, and calling between them was too much of a hurdle. So in practice people ended up settling on a single pointer type, which was -- somewhat surprisingly for the language designers -- the non-refcounted one. And the language got rid of syntax for the refcounted one, and everything became more usable.

I could believe that with more money and resources everything would have been rosy, but my understanding of the facts doesn't particularly support this.

Re: Retiring Python as a Teaching Language

#219
post #11
post #2

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

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

A well-designed type-inferred statically-typed language either cannot support the following (which is valid Python), or can only do so with tradeoffs that either stretch the definition of "statically-typed", stretch the definition of "well-designed", or would make the language even more intimidating than monads make Haskell:

    def fizzbuzz(i):
        if i % 3 == 0:
            return "fizz"
        else if i % 5 == 0:
            return "buzz"
        else:
            return i

    for i in range(100):
        print(fizzbuzz(i))
Now you might argue that it's a good thing for people to care about proper typing for large, maintainable codebases, and I would agree; in some of the better Python code I've seen, it's social convention to add type signatures in a comment (I once worked at a place where people added Haskell type signatures) and enforce proper typing. And yes, there are a few Python APIs that return either a single item or a list, instead of a one-item list, and they're annoying.

But it's a thing people do, it's especially a thing that's useful in a teaching language or in a scripting language that's trying to fill PHP's niche, and I don't think a language that refuses to type-check such a thing will fit every conceivable need. Sometimes the goal is just to get something done quickly, not be large or maintainable.

Re: Retiring Python as a Teaching Language

#220
post #180

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…

Home computers used to boot to a BASIC interpreter. To do anything you needed to use a little bit of BASIC. Looking at HN threads we see many people who claim this one thing created very many programmers. But back when it was happening we had teachers giving remedial classes to force BASIC users to "unlearn" bad habits. (There's probably a "BASIC considered harmful" somewhere). What language would you recommend for 8…

I agree with the article that JavaScript is a good choice. Nothing to install. No way (or there should be no way) to accidentally wipe the disk. Easy to share your code.

Now, JavaScript certainly has some ugly parts, but the difference between it and the old-school BASICs is that it's possible (with care) to avoid most of the ugly parts in JavaScript. That wasn't possible with BASIC.

Post reply on HN