Hacker News new | past | comments | ask | show | jobs | submit login
[flagged] Python should not be taught as a foundational language (thedropout.dev)
16 points by illuminated 8 days ago | hide | past | web | favorite | 79 comments





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.


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.


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


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.


> 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!


Instead, you have to insert a '{', move to the end of the block and insert a '}'. Or 'begin' and 'end' (or whatever delimiter is used). Some IDEs also support selecting the new block region and hitting a shortcut.

None of these are any less onerous than selecting and hitting tab.


I've had editors or git merges mess with whitespace. I've never had editors remove braces or begin..end blocks, and merges have rarely caused issues with begin..end blocks or braces. apples and oranges , in this case.

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.

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.

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

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 more in-depth discussion, and the whole article is just way too superficial.


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.

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


None of what you say seems to contradict what I said, so what exactly in my comment is wrong?

I read that the list:

> but not from an Array (e.g. inserting/removing things at random positions)

But it does support those operations


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 a few languages in the same syntax family.


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


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.

None of these things are specifically related to teaching programming. This is just the author's personal list of things they hate about Python, and they're using "what language should we teach newbies?" as an attempt to make it seem like more.

There's nothing wrong with having an opinion about Python, but for this to really be a valuable insight into teaching Python, there needs to be some introspection into why dynamic typing is bad as a foundational language, etc, and also needs to analyze the other side of the coin: the many things that do make Python attractive as a first language. Without it, this is just a rant #34929865 about Python's lack of typing and curly braces.


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?


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.


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.


> There is value in all 3 approaches but don't make the mistake of thinking they're all the same.

I respectfully disagree, and would gladly take the counterpoint to that argument. You will find the intersection of the three inside of many real world engineering problems. On the contrary, I am skeptical of the idea that applications in any one particular area don't have corresponding mirror images in the other two. Based on achievements in all three (research, engineering and trade), it is my opinionated belief that a focus on the intersection is where you create compounding value. I would love to hear a compelling counter-argument.


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


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 default teaching language at many universities.

Beginning programmers don't care about any of this stuff about the version split or strings, and the syntax and semantics argument is completely subjective.


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

What do you consider as the content present in a beginners class? I'm not personally involved in teaching (possibly changing in the future!), but I can definitely imagine a student accidentally writing a function that returns different types based on the input, and having an incredibly difficult time of it.

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 thinking flowing. DrRacket is ideal for this.

To me the problem with statically typed languages is the amount of "stuff" that needs to be hidden or glossed over for beginners. You're not going to be teaching newbies all of what "public static void main(String[] args)" means right off the bat because you're going to bore them to tears and they won't understand why they should care about any of that yet. Similarly with Haskell any interesting program is going to have "main :: IO ()" at the top of it, and explaining all of what that means involves discussing monads as well.

With Python or Racket, there are fewer of these things. You can say "this is a function" and "this is a value" and even explain how those are kind of the same thing, without having to discuss types. In dynamic languages, there is really only one type. In static languages, there are many.

I would love to see an intro CS curriculum that was type-driven, but as an educator my experience is that people want to get their hands dirty ASAP, and I want to harness that energy. If I could figure out how to discuss types in a way that gave a solid basic understanding without getting lost in the weeds I would do it, but I haven't yet, and until then the simpler, dynamic languages are better to begin with.


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 students being deliberate about the types of their variables.

Clearly new students shouldn't get crazy on types etc early on, but I'd definitely see someone trying '5' + 5 early on, or end up in a hard to debug situation like that. For example, returning a string from a function in one instance, and an integer in another. Instead of getting a failed addition at runtime later out and outside of function that causes the issue, the compiler can tell the student that they're returning a string, in a function that the student has explicitly stated returns an integer.


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.


Beginner means never wrote a program before (or maybe one in a computer class taught by a teacher with no computer science background and thus suspect ability to program). I can't imagine a beginner getting into that problem because they can't handle programs complex enough to get there.

Now the next semester... They better be moving on to bigger things where that can happen. However they have moved beyond beginner.


I could see an intro python student running into this issue with something like the following. I think we have different views on how far a beginner class would go, but I think doing basic functions and comparisons would be included.

  def foo(input_val):
     if some condition:
         return '5'
     else:
         return 6

  print(foo(some_val) + 1)

The author seems to make a circular argument: foundational languages look like C++/Java, Python doesn't look like C++/Java, ergo Python is not a foundational language.

There are no foundational languages, what is foundational is CS theory itself. C++ and Java are just part of the ALGOL tradition, which syntactically relies on a bunch of arbitrary choices (curly braces vs indentation is an arbitrary symbolic choice and any preference is personal and subjective), and furthermore were highly influenced by 70s computer architecture that doesn't really exist anymore. In other words: just a bunch of legacy choices.

Python is the best general-purpose language there is at the moment, because of its popularity, ubiquity, actual use in a wide diversity of domains and availability of libraries for almost anything you can think of. Furthermore, the syntax is simple enough for one to be able to keep it all in one's head and not having to constantly refer to documentation. If you learn Python today, it will likely be useful to you for the rest of your life in a variety of situations.

Getting used to curly braces in ALGOL-like languages is a minor intellectual challenge compared to what awaits someone taking a Computer Science or Engineering degree.


Nothing in this article is foundational, just stuff the author doesn't like or understand (such as the differences between arrays and lists) and it all happened to be superficial as hell. There are valid reasons to not teach python as a foundational language (and valid reasons for it as a good intro language), but none of them are in this article. As another commenter put it, it reads more like "why isn't Python C?" and still somehow misses the important teaching aspects of the C family of languages.

Python works for a large swath of issues, and is much easier to learn. That's the point of it. With Python, you can more easily move from a purely syntactical focus to actually programming.

If you need to go into lower level programming languages in the future, that's cool. You can go deeper into stuff like variable types, constant variables, block scope, garbage collection.. whatever you want. You already have a grasp what a string is, how to use a for loop, etc.

In reading the article, it seems like the author is saying essentially "Programming is supposed to be hard. Python makes it easier. So don't teach Python." But shouldn't we be teaching people the easy stuff first? That way they can get, y'know, programming?

The version split is about the only reasonable argument. And how you teach that is the following: Python 2 and Python 3 are different languages for all intents and purposes. Use Python 3.

But what do I know; I'm just a self-taught coder.


While I share plenty of the annoyances this author has with Python, and I’m sympathetic to the argument, they never quite manage to spell out why Python’s choices are somehow worse than any other language other than that Python does things differently.

Why is having constant variables so important when learning? Why are curly braces important? The author never says.

Meanwhile, while I agree Python’s strings are overcomplex and often frustrating, the weird digression about how “most languages” have char and char[] and String is a fancy wrapper, is actually just incorrect at this point and reveals just how narrow the author’s experience actually is.

In the meantime, my kid learned to program using Python and then went on to do very well picking up Java In subsequent classes. In my opinion, she’s far better off for being exposed to two very different languages early on rather than coming up thinking everything needs to look like C to be a “real” language.


Absence of clear types is what driven me mad (and my ex), when my ex tried to learn python via interactive online courses. Constant questions like: "why this thing named a is a number and this one thing named "b" is now a list and this other thing does stuff". Switched to java, all problems immediately disappeared.

"I'm just adding numbers, why do I need 'public static void main'?"

apologies but that sounds like a poor course you guys picked. types should not be a concern for a beginner. i started programming with BASIC and even though it had rudimentary types it wasn't until later that i really learned about types.

worrying about types means you already knew about them.


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.


Not sure how this post reached the HN front page since the arguments are extremely weak. This is like a complain about things a Java programmer don't like about Python or alike. Disclaimer: I don't use Python.

Article: "Why is Python not C++? It should be C++."

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.


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


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

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.


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.


I got intro'd with C. Enjoyed learning the low level concepts but I aint managing my own memory anytime soon unless I need that heap blazing fast.

Python was my vehicle to prototyping and implementing educative programs, I can hardly recommend anything else for a beginner. And arguments like other langs call this X are poor IMO.

The world of programming languages isn't 1 dimensional and no one should honor this notion of implied consistency that pleases your (and a student's) limited understanding of this ecosystem. I'd rather have students question and not critique such choices, and form their own educated opinions on what language fits them for what task.


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.


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.


People should start with a pile of sand from which they extract pure silicone, then design a cpu with whatever they want. Registers are cool, but you can design a cpu without them if you want. Then the rest of the computer and an Io system (Io is not required, but the instructor needs some way to validate your cpu)

The next step is to design your own language for your cpu, but so far human life isn't long enough.


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.


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.


That's why I started my kids off reading James Joyce. Once they learn to manage their vocabulary and really grasp how grammar is supposed to work, then they can read Dr. Seuss without picking up any bad habits.

Sure my kids are teenagers and have never finished reading a book, but they'll be great authors once they do.


Here is an article that I would be completely ready to agree with the premise, but then the author completely botches it by using only wrong reasons to make his argument: scoping, list-vs-array and map-vs-dict, whitespace?!

Really? 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.


I started with Java originally, but the school where I learned has since switched to Python.

For those who learned Python as a first language, how well did you do with typing? My guess is that learning Java for me enforced thinking about the types for everything, and the compiler gave me useful errors, rather than at runtime. I could see a student getting frustrated with runtime type errors, especially for things returned from their own functions, which can snowball easily into a mess.


My spouse expressed interest in learning to program and I thought the best way to start would be with Python as it would be the code structure without all that extra boilerplate, and doing simply things in Python is easy. I'm coming to realize that the boilerplate is important. She's struggled a bit with a lot of the things that are explicit in other languages. Variables are just magic in Python - in other languages there's a structure for their creation. I think that structure is important to understand and helps to formalize how things work - it helps build up mental models that just doesn't exist in Python.

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


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


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.


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.


> however in practice I find that it is much less legible and more kludgy to work with.

Can just stop reading here. I have seen many say this only the first few hours of trying Python, and that's it. So, this "kludgy to work with" indicates almost zero actual work with the language.


To my mind, it boils down to whether you think static types and memory management are foundational skills that a programmer is well served to learn early and build upon, or merely cognitive overhead that distract from what the programmer is trying to do. If the former, then obviously a language that ignores those is detrimental to long term development. If the latter, then clearly you want something like Python as your introductory language. I think either stance is defensible.

Actually, I wonder if the right conclusion isn't one side or the other, but that separate tracks for systems programming vs web dev (or whatever dichotomy you prefer) should be introduced earlier on in education, maybe separate specializations within a CS degree.


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.


Ok. Had to stop reading after the first paragraph. Python is not dynamically typed. Try doing print("Answer is:"+42) and the interpreter will not try to save you. Dynamic assignment != dynamic typing.

It is dynamically typed, because the typing is checked at runtime. Unlike a lot of other dynamically typed languages though it is strongly typed, because it does enforce type rules as you pointed out. That's not to say there's not a whole heap of other issues with this article though.

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').

I stopped reading after "constant variable".

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.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: