Live data from Hacker News

Python is now the most popular introductory language at top U.S. universities

cacm.acm.org

331–340 of 375 posts

Re: Python is now the most popular introductory language at top U.S. universities

#331

Python was heavily based on ABC, a language which targeted new programers and made syntax choices based on user testing: http://python-history.blogspot.ca/2009/02/early-language-design-and-development.html It says a lot about our understanding of our field that new languages generally do not formally test their syntaxes (and other "mental model" features) for usability.

But there is some weird stuff in Python syntax. Like, why do you create a dict with {} but access it with []? It always felt to me like an organic language, not one that was planned with consistency in mind (which is fine, of course).

Re: Python is now the most popular introductory language at top U.S. universities

#332
post #331

Python was heavily based on ABC, a language which targeted new programers and made syntax choices based on user testing: http://python-history.blogspot.ca/2009/02/early-language-design-and-development.html It says a lot about our understanding of our field that new languages generally do not formally test their syntaxes (and other "mental model" features) for usability.

But there is some weird stuff in Python syntax. Like, why do you create a dict with {} but access it with []? It always felt to me like an organic language, not one that was planned with consistency in mind (which is fine, of course).

It's also used for creating lists, but [] is syntax for retrieving a value from a container:

https://docs.python.org/2/reference/datamodel.html#emulating...

Or, the earliest I could quickly find:

https://docs.python.org/release/1.5/ref/ref-5.html#HEADING5-...

The access pattern is probably the right aspect to make consistent (at least in the context of duck typing). If the access isn't generalized across various types they might as well use named methods.

edit: I corrected the anchor in the second link.

Re: Python is now the most popular introductory language at top U.S. universities

#333

Earlier quoted context omitted.

Iagree100%.Therereallyisnoreasontoattributetheattributeofseman ticallysignificanttowhitepsace.Justasineverydaylanguage,comput erprogrammersshouldhavethefreedomtonotusewhitespaceastheyseefi t,justasmusicshouldnothaverests;it'sonlythenotesthathavemeanin g.Finally,gentlepeople,Iimploreyouthatwallsinhousesshouldbemad einfinitesimallythin,too,becauseIseenoneedtoseparateanything.

You know what man, FUCK YOU. You broke the layout of the discussion for everyone and it's next to impossible to follow the conversation without a ton of horizontal scrolling. Take your trolling elsewhere, it's not welcome here.

Whoa, please don't. This comment would be fine if it were just the second sentence.

Re: Python is now the most popular introductory language at top U.S. universities

#334

Earlier quoted context omitted.

I've taught both, and IMHO, the Ruby is less suited for the job of an introductory language because a block (i.e. an anonymous function) is a hard concept for a beginner to grasp and a core part of idiomatic Ruby. Python's syntax simply has "less magic" and is more regular. Ruby's syntax seems to be suited for either folks who don't really want to know what's going on (just give me a DSL and leave me alone) or studen…

A block is not an anonymous function. Try using `return`, `next`, etc... in an anonymous functions. Ruby has anonymous functions, they are called lambdas. I'd say that blocks might be easier to grasp for a true beginner that hasn't been "contaminated" by the notion of anonymous functions as fundamental objects.

You are, of course, technically correct. However, I'd argue that at the level of a CS1 course, it's all just semantics. True beginners don't even understand the concept of a function, let alone an anonymous function. For a student that's struggling to understand what's happening (not just type and have faith), blocks turn into one of those 'down the rabbit hole' pieces of syntax that requires a bunch of hand waving and earnest assertions of eventual understanding.

If you've got an explanation that would work in week 2 or 3 of a CS1 course, I'd love to hear it. I never found one better than "It's shorthand for a function."

Re: Python is now the most popular introductory language at top U.S. universities

#335

Earlier quoted context omitted.

It depends who you are. People who have the recursion muscle tend not to appreciate what an obstacle it is for people without it. Basic use of scheme requires you to think recursively. If you have that, scheme gives enormous power for a small investment of learning, thinking and typing. If you don't have that, you need to deal with that before you can use scheme. You could take a group of elite students with a math/p…

There is a really useful criticism of Scheme implied by your comment. Idiomatic Lisp is difficult to write, and there is a willingness in Scheme based Curricula to infuse it from the beginning. Unlike implementing objects in Java, use recursion and an aversion to mutation is a stylistic choice in Scheme. Iterative looping and state variables are viable alternatives and Scheme and other Lisps do mutation really well.…

Also, chances are, if something is difficult to write, it is at least as difficult to read.

Re: Python is now the most popular introductory language at top U.S. universities

#337

I know, I know, what I'm about to say is just an artifact of the Language Wars and will cost me karma. I can't help myself. We should not be teaching impressionable students that whitespace has semantic significance. This is a fundamental design flaw of Python, and it's just a Bad Idea. Sorry, Guido.

> This is a fundamental design flaw of Python, and it's just a Bad Idea. That sounds like a gut reaction and not a reasoned argument. I was skeptical of it at first, but after coding some Python I decided all my reasons for hating it weren't valid. Turns out it's very practical and makes the code prettier. I don't like the language for other reasons, but the significant whitespace never gave me any problems, headache…

I was bit by haskell's whitespace - but I think that was connected to a bug with the do-notation or some such syntactic sugar. In general I think significant whitespace is a great way to deliniate blocks

Re: Python is now the most popular introductory language at top U.S. universities

#338
post #71
post #50

Earlier quoted context omitted.

For reference, the ranking used by the author is from US News & World Report[1]. While it's far from objective, it certainly holds enough merit such that UC Davis being the last school you would attend for CS sounds ridiculous. [1]: http://grad-schools.usnews.rankingsandreviews.com/best-gradu...

You linked to Grad School rankings -- hardly what anyone would consider "beginner programming courses".

No one in their right mind "ranks" beginner programming courses.

Re: Python is now the most popular introductory language at top U.S. universities

#339
post #329
post #295

Earlier quoted context omitted.

Most of that article is rendered moot with this section: " Now, I freely admit that programming with pointers is not needed in 90% of the code written today, and in fact, it's downright dangerous in production code. OK. That's fine. And functional programming is just not used much in practice. Agreed. But it's still important for some of the most exciting programming jobs. " Pretty much saying that everything he just…

Yes it's funny, these places are teaching Python for the same reason they taught Java: it's "easy" and will get you a job. Yet we slate Java-schools, and cheer Python because it's trendy. The truth is, universities shouldn't care what industry does, because "real-world" computing is more about fashion than it is about any sort of science. And if you do it right people can learn any language they need (case in point,…

Yes it's funny, these places are teaching Python for the same reason they taught Java

That's not what I'm seeing at all. What I'm seeing is discussion of specific traits about Python that make it especially suited for a beginner language. And I'm seeing these arguments made over and over and over again, convincingly, in a way that was NEVER done for Java.

Re: Python is now the most popular introductory language at top U.S. universities

#340
post #327

Earlier quoted context omitted.

I do not know any Python (yet) - and my comment is probably off-topic. I spent a fall semester at Northeastern U, Boston in '97 and took a graduate course in Data Structures which was taught in C. I loved this course and finished top of the class (It helped that I was already familiar with C from an undergrad engg course). I fell in love with C. Implementing dequeues, linked lists, trees etc. with C was a pleasure -…

"we have ten weeks to take people who may have never programmed by typing text into an editor and teach them enough CS and programming that they can implement their own hashmap in Python" that seems utterly pointless to me.

Maybe, I'd have to see the actual class.

Remember that if this is a 4-year curriculum, they may eventually be expected to write code for a hashmap in C or some other low-level language as part of a data structures or algorithms class. And often, a class like that will spend time on analysis and algorithm design tradeoffs. The best way to understand why accessing a hashmap can be done in O(1) time is to actually code one for yourself.

This may simply be a preview.

Post reply on HN