Live data from Hacker News

Python should not be taught as a foundational language

thedropout.dev

31–40 of 82 posts

Re: Python should not be taught as a foundational language

#31

All I see is a list of complaints about warts that Python has, and no real foundational reasons for or against using Python, such as the ecosystem, long term cost of ownership, ease of iteration, or ability to manage a codebase at scale. I think this blog post is not named accurately.

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.

Re: Python should not be taught as a foundational language

#32
Reasons why Python is great to teach:

* Simplicity - you can write Hello world and have a 'that's cool' moment earlier than java

* General purpose - whether you're interested in web apps, data analysis, games, command line apps, you'll be able to do it with Python (the 'second best language for any problem' aspect)

* Community - a lot of people know it, it's easy to get questions answered. There are libraries, tutorials, etc

Reasons why Python is not great to teach:

* Horrible set up even with (or because of?) modern tooling and many options. Many beginners will get frustrated and lose interest after several hours of messing with configuration

* Too magic sometimes - easy to pick up bad habits by doing things that are 'allowed' in Python, but not in most languages

Overall I still think Python is one of the best first languages to show someone, but I'm glad I learned Java shortly afterwards followed by brief introductions to dozens more languages.

Re: Python should not be taught as a foundational language

#33
post #24
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…

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.

Re: Python should not be taught as a foundational language

#34

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…

As someone that enjoys learning by building from scratch sure. There's another huge group of us that like diving in and figuring things out as we go.

I too was intro'd with C and ended up coding 2x as much in python cause I just wanted to do stuff without the overhead of low level. I did appreciate my C knowledge when I wanted to do optimizations and better understand my Python code but I definitely think that I could've learned these things in the reverse order.

Re: Python should not be taught as a foundational language

#35
> In theory this might seem OK since you should already be properly indenting blocks of code, however in practice I find that it is much less legible and more kludgy to work with.

This pretty much indicates the author doesn't have much experience with newbies. It's enough to look at SO first questions queue to see how many people completely disregard indentation and are ok with no-indent, 4 levels deep control structures. Then the question is "why doesn't this [if] work". It doesn't because they're completely lost in the control flow.

For teaching, anything that either autoindents or forces indentation is amazing. Even Scratch does this right.

Re: Python should not be taught as a foundational language

#36
post #24
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…

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

An array by definition is fixed length and contiguous in memory. A list is variable length and not necessarily contiguous in memory.

Re: Python should not be taught as a foundational language

#37
I think Python is great, because it's a very comfortable language to write in.

My foundational language was C, and we had to roll out everything ourselves. Want dynamic lists? Better get down and write your own structure.

Now, while that may be a great experience for learning how things work on a bit micro level, it seemed like a complete nightmare for those with zero to no previous programming experience. Lots of people end up fighting the language, rather than focusing on the big picture.

Writing in Python feels like writing pseudo code. It's very comfortable. It makes beginners gain confidence, because they see quick results. They don't have to punch out code for 60 mins, hoping that it'll work once they hit compile and run.

Re: Python should not be taught as a foundational language

#38

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

Which is fine for the general populace, but not if you want to be a jockey, a cowboy or a horseback policeman, which is where the computer science student would fall into the analogy.

Re: Python should not be taught as a foundational language

#39
post #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 mov…

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 whitespace is the hardest to change.

Whitespace is good for readability and important. It should be an error if the whitespace is wrong. However there needs to be a simple start/end block marker so that programs can fix the whitespace correctly.

Re: Python should not be taught as a foundational language

#40
post #31

All I see is a list of complaints about warts that Python has, and no real foundational reasons for or against using Python, such as the ecosystem, long term cost of ownership, ease of iteration, or ability to manage a codebase at scale. I think this blog post is not named accurately.

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 software engineer by giving them a solid theoretical and applied foundation.

Part of being an engineer is learning how the quirks of the language evolved, the history of how it got to be that way, and what it means in terms of the long term evolution of the language and ecosystem as collectively reasoned through by the eyes of skilled practitioners. You get to see the decision making process of language design, and how the plan became a prototype became a battle hardened tool that can adequately work in a variety of real situations, well enough to gain a significant plurality (or mindshare) for a specific real world use case.

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. It doesn't change the fact that a) immersion is the best way to build fluency, and b) fluency is the goal, does it? What makes programming languages any different?

Post reply on HN