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.
Python should not be taught as a foundational language
41–50 of 82 posts
Re: Python should not be taught as a foundational language
#42Terrible 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 w…
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.
Re: Python should not be taught as a foundational language
#43Terrible 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 w…
Re: Python should not be taught as a foundational language
#44Really? Python is not a good foundational language because it is meant to be practical. When you are learning the foundations of things, you should be exposed to the damn thing you are learning. Python's main strength is that it abstracts all of this fundamental things away from the application developers and let's you be productive on the application side. When you are studying the fundamentals of Computer Science, though, your focus should be on the basics. For those, there are so many better choices than Python.
Python fails to teach lambda calculus like Scheme or Common Lisp, so you shouldn't be use it to learn functional programming. It does not have any interesting constructs for declarative programming like Prolog. It hides all of the hardware complexity under its VM, so you can't learn about data structures, file structures or algorithm analysis like you would with C, Pascal or any Algol-like language.
So, yeah, of course it should not be used as a language to teach Computer Engineers and CS majors. But scoping, naming conventions and fucking whitespace are completely irrelevant.
Re: Python should not be taught as a foundational language
#45I don't agree with the article on a lot of thing - I think the string criticisms are splitting hairs (and aren't all string in 3+ unicode by default?), naming quirks are in every language, and the version split can be treated as a non-issue (just learn 3.8 and if you have to learn the quirks for 2.x to support that version). I do agree with the scope - I think curly braces are easier to visualize and less magic. It's the magic that's kills the beginner experience.
Re: Python should not be taught as a foundational language
#46Reasons 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…
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.
Re: Python should not be taught as a foundational language
#47C 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…
The next step is to design your own language for your cpu, but so far human life isn't long enough.
Re: Python should not be taught as a foundational language
#48There's also a lot of fun tutorials out there which make learning the language feel fulfilling and enjoyable. And it can be hugely helpful in the job market.
However, I'd say I didn't really start leveling up as a developer till I spent time learning a statically typed language. In my particular case, I think it was partially because C++/Rust developers spent a lot of time discussing performance implications in podcasts/forums/lectures, which inevitably lead me down rabbit hole of how software interacts with hardware. I think that's harder to do in languages which abstract away some of the complexity.
Re: Python should not be taught as a foundational language
#49Terrible 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 w…
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! IDEs help a lot, the worst are REPL-like tools (Python's command line interface, or Jupyter) that fail to automatically remove leading whitespace in copy-pasted lines.
Python goes a long way to helping tools by having the `:` (colon) as "new block" signal. I personally think that's superfluous, and it should be done away with.
The broader point is, there are (or should be) techniques that eliminate these problems altogether; copy-pasting text is the problem - we should be copy-pasting AST instead. Same issues would happen e.g. in C++ if you copy-paste on `{` too much or too little... Copying AST instead of text would solve that as well.
Re: Python should not be taught as a foundational language
#50Earlier quoted context omitted.
> 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.
They will, but that is an intermediate topic that can be deferred out of the beginners class. Beginners can write many interesting programs without hitting those type problems.