Live data from Hacker News

Why I push for Python

lorenabarba.com

51–60 of 129 posts

Re: Why I push for Python

#51
post #43
post #36

It seems the only argument for pushing Python is that it sidesteps the need to understand fundamental programming concepts. Sure Python is easy to read and easy to write, but that's not really the point. To teach somebody print "hello world" in Python is not really teaching them much at all... Teaching someone the C equivalent would cover functions ("what is 'void main()'?"), entry points and how programs are loaded…

This is like saying that when teaching people how to cook, you should start with chemistry lessons. Sure, at some point you have to have some understanding of chemistry in cooking, but does that really mean you have to start out there? Yes, every programmer should eventually learn about the things you're talking about. But C is a terrible first language.

I think it all depends of your goals, if you learn to cook in order to impress your friends, no you probably don't need chemistry lessons, but if you plan to win 3 Michelin stars for your restaurant, you probably need to. Same for programmation, if you just want to ease your work, compute quickly some math formulas, etc, you can start with Python. But if you plan to write the next big OS, you better start with C...

Re: Why I push for Python

#52
post #43

Earlier quoted context omitted.

This is like saying that when teaching people how to cook, you should start with chemistry lessons. Sure, at some point you have to have some understanding of chemistry in cooking, but does that really mean you have to start out there? Yes, every programmer should eventually learn about the things you're talking about. But C is a terrible first language.

I think it all depends of your goals, if you learn to cook in order to impress your friends, no you probably don't need chemistry lessons, but if you plan to win 3 Michelin stars for your restaurant, you probably need to. Same for programmation, if you just want to ease your work, compute quickly some math formulas, etc, you can start with Python. But if you plan to write the next big OS, you better start with C...

No, you absolutely don't need to start with C. You need to learn C (or some equivalently low-level language) eventually.

Re: Why I push for Python

#53
post #27
post #2

I'm a huge Python fan (90% of my code is Python, work and private), but I don't think any more it's still the language to push. I have not much experience but it seems Go, Ruby, and Scratch seem to be the one's people should be heading towards (which one depends on the level of skill required). But it's really just my feeling, I have no data to proof it.

> Go Requires curly braces and type declarations. These are easy for beginners to screw up. > Ruby Ruby's syntax makes me want to gouge my eyes out -- it's every bit as bad as Perl. I'm an expert and I hate Ruby. I wouldn't dream of exposing beginning CS students to that crap unless I wanted to convince them to change their major. > Scratch This is a toy language in a toy environment. I don't know the language well e…

I feel like you're placing way too much emphasis on syntax here.

From a non-superficial standpoint, you haven't brought up a single thing wrong with Ruby— or Go, aside from explicit typing.

The thing about syntax is that, to some extent, it's subjective. You say Ruby syntax is awful? OK. Personally, when I first started programming, I hated Python syntax¹ so much that I called it quits. It wasn't until later, when I started learning Ruby and its "eye-gouging" syntax, that I could get past that hurdle. So I wouldn't exactly describe its syntax as an argument against using Ruby as a teaching instrument.

¹I've since grown to love it, but as a beginner this was very much not the case.

Re: Why I push for Python

#54

I teach 11 to 18 year olds and I've stopped teaching them Python and started teaching them JavaScript. My main reason for the switch is to overcome the "What's the point of this?" questions that I used to receive. With JavaScript the kids instantly see a result on a platform they're familiar with - a browser. window.alert() is instantly recognisable to them and seems far more relevant than print"" where the output is…

My main problem with Javascript is the various truthiness rules as well as the numerous implicit conversions to strings.

Eg. > [2,1,3,10,6, 200].sort()

[1, 10, 2, 200, 3, 6]

is both unexpected, and is just one of many landmines that can completely derail beginners.

Re: Why I push for Python

#55
post #36

It seems the only argument for pushing Python is that it sidesteps the need to understand fundamental programming concepts. Sure Python is easy to read and easy to write, but that's not really the point. To teach somebody print "hello world" in Python is not really teaching them much at all... Teaching someone the C equivalent would cover functions ("what is 'void main()'?"), entry points and how programs are loaded…

Instead of teaching them about function composition, recursion, data abstraction, and all the interesting concepts of computer science you end up teaching them a bunch of incidental stuff about memory locations and syntax.

Python suffers from this less than C, but still much more than Scheme. I really can't imagine advocating for something other than some dialect of scheme (maybe racket) for an intro undergraduate course.

For kids I can see choosing something like Javascript (as terrible as it is) just for the immediate feedback that someone before me mentioned.

Re: Why I push for Python

#56
Agree with this article 100%. The reason I discarded programming (and went into Mechanical Engineering)sophomore year of college was because I was frustrated with the syntax issues with C++. Years later, once I learned Python, I started experimenting with other languages and learned to deal with the syntax. Syntax isn't a big deal for people who are used to it, but for people who are deciding whether to be interested in programming or not, syntax can but a huge turn-off.

Re: Why I push for Python

#57
post #54

I teach 11 to 18 year olds and I've stopped teaching them Python and started teaching them JavaScript. My main reason for the switch is to overcome the "What's the point of this?" questions that I used to receive. With JavaScript the kids instantly see a result on a platform they're familiar with - a browser. window.alert() is instantly recognisable to them and seems far more relevant than print"" where the output is…

My main problem with Javascript is the various truthiness rules as well as the numerous implicit conversions to strings. Eg. > [2,1,3,10,6, 200].sort() [1, 10, 2, 200, 3, 6] is both unexpected, and is just one of many landmines that can completely derail beginners.

JavaScript has numerous caveats and idiosyncrasies that result in strange and unexpected behavior. It's scoping rules are also pretty broken. While Python does have some of its own quirks, they're far fewer in number. There are two that bite people pretty often, using a mutable type as a default function parameter, and accidentally typing a comma after an expression subtly converting it to a tuple.

Re: Why I push for Python

#58
post #53
post #27

Earlier quoted context omitted.

> Go Requires curly braces and type declarations. These are easy for beginners to screw up. > Ruby Ruby's syntax makes me want to gouge my eyes out -- it's every bit as bad as Perl. I'm an expert and I hate Ruby. I wouldn't dream of exposing beginning CS students to that crap unless I wanted to convince them to change their major. > Scratch This is a toy language in a toy environment. I don't know the language well e…

I feel like you're placing way too much emphasis on syntax here. From a non-superficial standpoint, you haven't brought up a single thing wrong with Ruby— or Go, aside from explicit typing. The thing about syntax is that, to some extent, it's subjective . You say Ruby syntax is awful? OK. Personally, when I first started programming, I hated Python syntax¹ so much that I called it quits. It wasn't until later, when I…

Yes, it's pretty universal that people find it uncomfortable to force themselves to think in a language they don't fully understand yet. Whether that's Ruby, Haskell, or Japanese. There are plenty of valid things to compare languages on ( semantics, types, runtimes, etc ) but arguments about lexical syntax are really not that interesting since they're usually just throwing opinions back and forth about which lexical construct is more "readable", as if this term had some objective cross-language meaning.

Re: Why I push for Python

#59
post #43

Earlier quoted context omitted.

This is like saying that when teaching people how to cook, you should start with chemistry lessons. Sure, at some point you have to have some understanding of chemistry in cooking, but does that really mean you have to start out there? Yes, every programmer should eventually learn about the things you're talking about. But C is a terrible first language.

I think it all depends of your goals, if you learn to cook in order to impress your friends, no you probably don't need chemistry lessons, but if you plan to win 3 Michelin stars for your restaurant, you probably need to. Same for programmation, if you just want to ease your work, compute quickly some math formulas, etc, you can start with Python. But if you plan to write the next big OS, you better start with C...

My guess is that a lot of people who are getting an introduction to programming don't know what their future ambitions for programming are. "Oh, you want to learn the basics of programming, do you? Well okay, we have some different offerings; do you plan on programming micro controllers embedded in amphibious robots? Maybe you want to write an SMT solver? Or maybe writing software for caching HTTP responses for web servers is more in line with your ambitions..."

You might as well start with the stuff that is common to most of (contemporary) programming.

Re: Why I push for Python

#60
If I had to overly generalize, programmers tend to fall into the "builder" and "curiosity" camps.

I grew up using a Borland C++ compiler that didn't list which line numbers were missing semi-colons. I didn't mind going over my code to find the missing semi-colon, but plenty of my classmates were frustrated. They weren't interested in how compilers worked, how code was parsed and debugging information was lost in the transition. They just wanted to build a game, a web site, something.

At college I had a difficult time with Scheme and looked down at it. Where's the manual memory management? The pointers? The for loops? Scheme abstracted away a lot of plumbing and let users focus on algorithms.

Nowadays I think Python is the ideal first language followed by C and Haskell. It's starting in the middle, and then moving towards opposite ends of the programming spectrum: systems and functional programming.

Some make the argument that CS students should be dedicated enough to plow through an introductory course taught in Java / C++. I think that's an elitist attitude. CS is not growing in popularity despite increased demand[0], and new students should be welcomed instead of facing artificial filtering measures like "dedication". At the same time, this is not a proposal to water down the major--just a plea to ease students in instead of kicking them off a cliff and hoping they can fly.

Edit: Another front page article (https://news.ycombinator.com/item?id=7760790) discusses this issue:

> One might also argue that these tools are simple enough once you learn to use them. I would only point out that, emperically, that bar is too high. Despite the clear benefits, the vast majority of the world was chosen to remain illiterate. Even tools for which there is a clear need (eg version control) have largely failed to make a dent. Clearly there is a need for a less hostile programming environment.

[0] http://www.itworld.com/big-data/418701/american-college-stud...

Post reply on HN