Live data from Hacker News

Python should not be taught as a foundational language

thedropout.dev

51–60 of 82 posts

Re: Python should not be taught as a foundational language

#52
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…

It's short enough on content that it looks like low-effort resume SEO.

Re: Python should not be taught as a foundational language

#53
post #48

I think languages like Python (and IMO Javascript) are perfectly fine as first languages, since it's easy to setup and the basics are easy to learn which is important in not discouraging people from hating coding. That's what I recommend to people who are interested in programming but have little to no experience doing so. There's also a lot of fun tutorials out there which make learning the language feel fulfilling…

My first language was C++ back in 1998, and that was possibly the worst language you could choose outside ASM for a newbie. In addition to basic programming concepts like variables, loops and conditionals, I also had to contend with types, pointers, memory management, memory leaks, compiling, command line, .h files, typedef, magic main function, char * instead of real strings, etc. The list goes on. It’s like learning triathlons before you can even crawl.

I struggled for a long time not quite understanding and just copy and pasting. My coding fluency jumped dramatically when I learned JS and Python a few months later.

Once I finally mastered C++, everyone switched to Java as the teaching language which I think is almost as bad.

Re: Python should not be taught as a foundational language

#54

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, tutori…

I'd add multi-paradigm. It's really powerful that you compare teach/compare/mix OO, FP, and others without leaving the language.

Re: Python should not be taught as a foundational language

#55
post #49
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…

I disagree, but in any case this is a better criticism than what's written in the original article. First of all, whitespace is the reality. The only relevant choice is for the compiler to consider it, or ignore it. You're arguing "wrong whitespace is error" so I guess we agree there. My main job is Python, and there's not a lot of work I need to do to fix the whitespace. It's literally a few Tabs / Shift+Tabs away!…

It's easy to argue in favor of something if you can use hypotheticals that are unlikely to every come to pass.

I agree with you that significant whitespace in Python is much less of an issue than many make it out to be, but arguing that using braces (or def..end, or whatever) is a stupid idea is going a bit far in the other direction. For me, at least, my dislike of Python's significant whitespace does put a bit of weight on the scale when I choose my language. Not much, but something.

Re: Python should not be taught as a foundational language

#56
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…

> whitespace is hard to change What text editor are you using? Select region, Tab or Shift-Tab, and move on. > Whitespace is a terrible idea. That’s like, just your opinion man. The only time I’ve had issues with blocks and whitespace is when some monster mixed in tabs. Thankfully every decent editor can make whitespace characters visible, and a quick find/replace fixed the heinous action.

> The only time I’ve had issues with blocks and whitespace is when some monster mixed in tabs. Thankfully every decent editor can make whitespace characters visible, and a quick find/replace fixed the heinous action.

Sure, but in the non-Python languages that I use, that's not necessary, and in most cases, these days anyways, simply saving the file will fix indentation!

Re: Python should not be taught as a foundational language

#57

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, tutori…

> Horrible set up For the purposes of teaching, there’s very few reasons to go beyond the standard library (‘Requests’ is why I qualify this). Restricting yourself to that means that python is, most times, already set up for you. It only gets confusing when you start to use shared libraries.

This is not true on Windows and in general even for beginners I would not recommend the default install of Python on mac.

Re: Python should not be taught as a foundational language

#58
It's a poorly written post. I think mostly written for SEO and traffic.

One thing that I didn't notice others here didn't comment about:

In the section where they write about xrange vs range in python 2 vs 3, they reference a piece of code supposedly written for py3 which isn't there.

xrange was fast in python 2 because it allows you to evaluate lazily, which is what range does in python 3.

So whatever benefits you got out of xrange is there in range.

Re: Python should not be taught as a foundational language

#59
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…

In an educational setting you need to be clear whether you're talking about Computer _Science_, _Engineering_ or trade. There is value in all 3 approaches but don't make the mistake of thinking they're all the same.

Using the term "foundational language" makes me think Science, which has very little overlap with the trade approach. An engineering approach stands somewhere in between, but still has very different objectives than science.

Re: Python should not be taught as a foundational language

#60

Earlier quoted context omitted.

> Horrible set up For the purposes of teaching, there’s very few reasons to go beyond the standard library (‘Requests’ is why I qualify this). Restricting yourself to that means that python is, most times, already set up for you. It only gets confusing when you start to use shared libraries.

This is not true on Windows and in general even for beginners I would not recommend the default install of Python on mac.

WSL gives you Python 3 with an apt install, and homebrew can replace the default 2.7 with Python 3. Using Python on Windows without WSL is a bit harder, but it's really just a package install and explicit `python file.py` call in a command window.

I don't believe that any of these are onerous enough to justify calling them "Horrible [to] set up".

Post reply on HN