Live data from Hacker News

Python should not be taught as a foundational language

thedropout.dev

11–20 of 82 posts

Re: Python should not be taught as a foundational language

#11
Terrible article.

Looks like it's written in 2004? I've been using Python 3+ for the past few years, never looked back.

> Python decided it would be a fun idea to govern blocks using whitespace, instead of wrapping everything in braces.

Yeah, because using braces was a stupid idea in the first place. Just because C++ / JavaScript etc. are stuck with backwards compatibility, doesn't mean that other languages can't move to something better.

> For instance, what is called an "Array" in pretty much every mainstream language, is instead called a "List" in Python. Key-Value stores that are usually called a "Map" or a "HashMap" are instead referred to as a "Dictionary".

Yeah, except in C++, where it's called "Vector" (which makes even less sense, from a mathematical point of view). Also, The problem with "Map" (the data structure) is that it conflicts with "map" (the function). I prefer what Python is doing.

> When creating a string in most mainstream languages you can usually just do something along the lines of var s = "string" or for a char you usually use single quotes var c = 'c'

And most mainstream languages are wrong. In practice, there's no meaningful difference between (Unicode multi-byte multi-codepoint) characters and strings; Python just makes it more obvious.

Re: Python should not be taught as a foundational language

#12
i agree that significant-whitespace is a bad idea.

It's bad in things like yaml, coffeescript or haml where mis-indentation can dramatically change semantics. Of course brackets or other delimiters are also susceptible, but they're much easier to spot, especially for syntax highlighters, linters, etc.

And whitespace can actually be part of how you communicate your thinking to other developers.

Re: Python should not be taught as a foundational language

#13
post #4
post #2

I loathe Python, but I still disagree. Python is important learn, for one thing. I don't know of anyone using Java or JavaScript for statistics. For another, being unlike C is a strength . I would modify the argument to be, "Python should be taught as a foundational language, along with [insert C-like, non-GC language here] and something in the OCaml family." No one should learn CS or programming as a trade with only…

"No one should learn CS or programming as a trade with only a few languages in the same syntax family." This is a fine ideal, but I bet there are tons of professional programmers who only know a couple of languages all from the syntax family set of { C, C++, Java, JavaScript, PHP, Swift } and it's not a career problem at all.

I'm not sure I would put Swift in that syntax family. It doesn't have C-style for loops and most of it is pretty different from C aside from curly-brace delimited blocks. First-class functions, lots of Smalltalk- and Objective-C-isms, some ML stuff, etc.

Re: Python should not be taught as a foundational language

#15
The author mostly argues that Python does not work the way they are used to. While I can understand that Python being different may pose a difficulty to someone who is used to JavaScript, C, C++, Java, and so on, there are many different languages that one can learn from.

To me, a foundational language allows the learner to understand how computers work, and how calculations can be performed. In this light, SICP has proved that LISP can be a foundational language.

I strongly suspect the author's notion of "foundational" is very different than mine, and that they see programming as something very different than I do. Without knowing how the author sees it, I miss the point of the article.

Re: Python should not be taught as a foundational language

#16
post #5

Python is far simpler than Java in its essence; you aren't required to write class and access control boilerplate if you don't want to, you don't have to explain type systems, and the syntax is much cleaner. I would personally recommend Racket/Scheme as the foundational language for computer science and software engineering over Python as it is even simpler, but I can understand why Python has displaced Java as the d…

> you don't have to explain type systems

Is that a feature though? Beginning programmers are still going to hit type errors, and having things be explicit and static I think would help, IMO.

Re: Python should not be taught as a foundational language

#17
C should be the only foundational language.

People should first learn to manage their memory, ensure their typing and the boundaries of their variable allocations before having someone do that for them.

It's a little bit like driving: in the US you can get a driver's license without ever touching a stick shift car, so you have this huge driver population than can only drive automatics.

Which is fine for the general populace, but not if you want to be a race car driver, a machine operator or a mechanic, which is where the computer science student would fall into the analogy.

Re: Python should not be taught as a foundational language

#18
I've TA'd several intro courses, some involving Python and some don't, and in my experience these issues are not as big as the author makes them out to be, and especially the REPL and the ability to explore are really nice benefits of Python for absolute beginners.

There's many ways of structuring an introduction, so I'll not say "You have to use Python", but I strongly disagree with "You should not teach with Python". IMHO the best approaches show the students multiple languages, and Python is a fine pick as the first of those. In contrast, Java in contrast brings a lot of overheads that a beginner doesn't need, and thus I'd recommend teaching it later if at all.

Re: Python should not be taught as a foundational language

#20
Why do people still talk about Python deprecated version..? For me it doesn't make any sense to criticize Python based on Python 2.7 when this version should NOT be used anymore.

Still, Python is sufficiently known, used and the syntax is easily accessible to claim to be a useful programming language for novices to learn and have an introduction to CS.

Post reply on HN