Live data from Hacker News

Python should not be taught as a foundational language

thedropout.dev

71–80 of 82 posts

Re: Python should not be taught as a foundational language

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

> it's not a career problem at all

It can be a failure of education even if it's not a career problem. The article is about what should be taught in schools.

Most programmers self-report becoming more skilled as they learn languages with different paradigms, so there's evidence that there's career benefit to knowing a diversity of languages.

Re: Python should not be taught as a foundational language

#72
post #43
post #39

Earlier quoted context omitted.

Whitespace is a terrible idea. I'm not saying languages need to use the one true brace (which every brace you care to argue for, they are all the same, at least for this point), but there needs to be a start and end block, and white space is one of the worst choices you can make. The problem with whitespace is in real programs you eventually realize (often because of a new requirement) that you need a new block and w…

This makes no sense to me. The whitespace is controlling. There is no need to retroactively "fix" it because if it's wrong, the program won't work.

You might be able to spot the bug if you're lucky. Otherwise, it might go on undetected until it decides to show up at the "best" time.

Re: Python should not be taught as a foundational language

#73

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

Certainly x86 Assembly should be the only foundational language. People should first learn to manage their registers and memory addresses, 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 EU you can get a driver's license without ever touching the horse saddle, so you have this huge driver population than can only drive…

That was fun, but not entirely wrong.

A decent computer science major will have all of that. In my times we used MIPS though, to reduce the complexity a little bit.

Re: Python should not be taught as a foundational language

#74
post #10

Somewhat reasonable title but poorly written content. > For instance, what is called an "Array" in pretty much every mainstream language, is instead called a "List" in Python. Because it is a list rather than an array (as in C). > Another issue with Python is that it is essentially two different languages, there's Python 2.7 and Python 3+. It's 2020, you are not supposed to teach Python 2 to newbies. I was expecting…

[deleted]

Re: Python should not be taught as a foundational language

#75
post #63

Earlier quoted context omitted.

I'm GP in this thread but I'll give my opinion just in case you're interested. I'm a huge proponent of static typing and I've even gone so far as to argue on occasion that Haskell is simpler for beginners than Java. In programming pedagogy I think the most important goal for complete beginners is to get them confidently writing, running, and debugging programs as quickly as possible, to get the juices of programmatic…

What are your thoughts on handwaving away "public static void main(String[] args)"? It's been a while, but when I learned programming initially, I remember being told something along the lines of "This tells the program where to start. Copy and paste it for now, and we'll to what it means later on." If there was a way to get the best of both worlds, that would obviously be ideal, but IMO, this is a fine sacrifice for…

My CS prof taught Java similarly, even though I already knew it by the time I got to college.

The distinction between compiling and running is nontrivial to understand, and I’m not sure how important it is right at the start. Python will throw a type error at runtime, Java will throw a type error at compile time. You can talk about what sorts of things you can do with strings and so on in a loose way without getting too in depth, for example. It may even help to mention them as types. But having the overhead of learning them first can often be too much, I think.

Like I said, I don’t think this is the last word and I remain hopeful for better type-driven teaching strategies.

Re: Python should not be taught as a foundational language

#77

What a bad article. C++ shouldn't be taught either because C++-98 (1998) isn't compatible with C++-20 (2020).

You shouldn't write an article telling people not to use Python if you don't really understand Python in the first place. Lists are called Lists in Python because they are just that: lists of varying and dynamic length of heterogeneous datatypes. If you want an array with a homogeneous datatype packed efficiently sequentially in memory Python also has that: a=array('i').

Re: Python should not be taught as a foundational language

#78
post #43
post #39

Earlier quoted context omitted.

Whitespace is a terrible idea. I'm not saying languages need to use the one true brace (which every brace you care to argue for, they are all the same, at least for this point), but there needs to be a start and end block, and white space is one of the worst choices you can make. The problem with whitespace is in real programs you eventually realize (often because of a new requirement) that you need a new block and w…

This makes no sense to me. The whitespace is controlling. There is no need to retroactively "fix" it because if it's wrong, the program won't work.

In python the program may work wrong. I've removed an if before and when unindeting the nested blocks took something back one level too many. It still parsed as the levels were legal, but something that should have been in the nested loop was now outside of the loop.

Re: Python should not be taught as a foundational language

#79
post #31

Earlier quoted context omitted.

None of ecosystem, long term ownership, iteration, or codebases at scale are relevant to a foundational language (i.e. one that is being taught in order to teach the concepts of programming.) A simple, clear syntax that comes, as much as is reasonable, secondary to whatever the concept being taught is is most important to me.

> None of ecosystem, long term ownership, iteration, or codebases at scale are relevant to a foundational language (i.e. one that is being taught in order to teach the concepts of programming.) I cannot agree with this. Embedded in this argument is the idea that syntactic specialization towards pedagogy is a worthwhile goal rather than ramping up a pupil towards where they'd be able to function independently as a sof…

So, I'm thinking from an introduction in an academic setting, some people (in my limited teaching experience, most people) aren't planning to go on to become software developers - they just need some background for what they're actually studying. You're not being a strictly vocational trainer, and you're starting people from "this is a variable, this is an if" and getting them to "this is a sorting algorithm, this is a tree." I.e. the foundations of programming.

At this stage, keeping people away from excessive boilerplate ("public static void main" is confusing), libraries apart from something that makes the teaching process easier, version control, and so on all contributes to teaching the programming process, which is hard enough as it is.

By all means, introduce those things when they get to software engineering, but by that stage the need for a foundational language has passed and people should be able to pick and learn whatever languages or other tools suit their specific needs.

> Just because studying Latin is useful for understanding English at a deeper level doesn't mean it's a good idea to learn Latin before learning english.

The flaw with this analogy is that it's not about "at a deeper level", it's more like learning simple English and not getting bogged down with subjunctives and constructions like "I had had a hotdog", as those can come later and aren't important right now.

Re: Python should not be taught as a foundational language

#80
post #33
post #24

Earlier quoted context omitted.

What do you mean by that it is a "list"? It's certainly not a linked list.

List is pretty much an interface, and Python lists do support things you expect from a List type, but not from an Array (e.g. inserting/removing things at random positions). The interface doesn't say if it's an array, a linked list, a rope, ... underneath, and you don't need to care at this point.

This is wrong, the Python list supports random access and random access inserts and removals. It's a dynamic size array underneath, and contiguous, so it's pretty much the same as a std::vector of Python objects.

Also notably a Python list does NOT have an efficent pop operation at both ends, only on the far end.

Doc: https://docs.python.org/3/library/stdtypes.html#list

Post reply on HN