Hacker News new | past | comments | ask | show | jobs | submit login
[flagged] Python Is a Bad Programming Language (medium.com/nerd-for-tech)
26 points by igorzij 14 days ago | hide | past | favorite | 30 comments



Meh. Weak criticisms.

Google didn’t do anything to push pythons popularity in the community. If anything it held it back being so committed to version 2.

White space is a non issue. At best it ensures readability and consistent structure. At worst it’s unimportant.

The thing about version 2 versus version 3 is old news, everyone uses version 3, move in and shuddup about it.

Typing has received more significance recently with various languages like javascript moving towards typing. Python had mypy and it’s becoming more popular.

Pythons object orientation works just fine, and besides isn’t the industry trending away from OO?

None of these things make python “bad”. The author is making ridiculous claims and overreaching in his criticism and embarrassing himself.

A blog post that’s more hot air and bluster than substance.


Message for future language critics: if you mention space versus brackets, no one is going to take you seriously.

I competely get why people hate self, or this in js for that matter, when they came from those main stream languages with implicit access. However, once you get used to it, you will actually prefer the explicity that make you more mindful and hopefully write better code that try to minimize states and context at all cost.


White space is definitely an issue. It was an issue for Guido from day one, and he brought that issue to the rest of us just because he could.


Agreed that whitespace requires an adjustment period, but editors from vanilla VI on servers, to your choice editor handle whitespace with very little issues.

Add in automatic formatting and the amount of issues arising from indentation falls further; add in linting & it's really not an issue.


> If you ask a Python developer about [private instance variables], they’ll respond with: “don’t access the instance variables of another class, lol”.

> only in Python will the difference between tabs and spaces cause the interpreter to have a heart attack.

> The question of making a variable constant came up on Stack Overflow and a Python developer’s advice was “just don’t change it”.

All of these critiques seem to amount to: If I do something dumb, then Python will break on me. While I respect that other languages have protections, it's sort of like asking "why doesn't Python have static types?".


none of those things are dumb, but I agree that they are minor


Whitespace is definitely a legitimate critique of python.

The fact that people have learned to live with it or just ignore it is pretty irrelevant in my opinion.

Significant whitespace means I can't copy+paste without introducing bugs or breaking the code. It means code formatting becomes more complex to automate. It's seriously the dumbest language feature to defend and should be pretty acceptable to admit was a mistake.

I agree that having whitespace sensitive scoping isn't a compelling enough reason in itself to avoid python, but it is hard for me to understand how python programmers insist on defending it as a great design choice that "improves readability". To me that indicates an inexperienced developer who is unfamiliar with the alternatives.

I feel similarly for people who reject (or say they hate) static types and compilers.


> It means code formatting becomes more complex to automate

No, it means it is both simpler to automate and less necessary, because syntactically correct code is already largely formatted.


I agree, as someone who likes a lot about Python (particularly its wide selection of libraries), the whitespace sensitivity is annoying.

However, it seems like part of the language that could conceivably be removed in future versions if defending it wasn't such a priority for many.


> I can't copy+paste without introducing bugs

What OS or clipboard manager are you using that strips out whitespace?

I've used Windows, macOS, and a whole host of Linux flavors. I haven't encountered this clipboard issue on any of them.


> the only reason it’s so popular today is because Google pushed it so hard in the first decade of the 2000s

I've been using Python since the 1990s and I remember the Python conference really growing because of Zope. Later was Django, and NumPy finally solidified the previous numarray, Numeric, etc. confusion, which helped with a lot of scientific and engineering projects.

I struggle to think of what big influence Google had in the first decade of the 2000s. The "abc" module? Getting people to use App Engine? van Rossum had 50% time to work on Python, and I believe Google employed a few other core developers?

> They probably would have wanted to embrace Java, as they were already using it with Android,

Umm, but they were using Python from the beginning. Flash back to 1995 (!), quoting Scott Hassan at https://www.vanityfair.com/news/2018/07/valley-of-genius-exc... :

] And I was fixing some of the bugs that he was having with Java .... And I remember thinking, Wow, this is insane!, because I was spending a lot of time fixing this underlying tool. And so one weekend, I just took all his code, I took his whole entire thing, and threw it all out, ... I knew I could get the thing working if I used a language I knew very well, called Python. ... So Larry went from barely downloading a 100, to doing 32,000 [pages] simultaneously on a single machine.

That's why Python was already established at Google long before Android.

Anyway, this essay contains the usual criticisms about Python:

- 2 vs. 3 (a valid opinion a few years ago, IMO, but fading now)

- requires an explicit 'self'

- no distinction between declaration and initialization

- no private variables

- whitespace indentation instead of braces

- dynamic typing

- no constants

Those seem like valid personal opinions, but little more than that.


Meaningless vent with very little substance.

White space issue: code needs to be well formatted. In Python, it can not be well formatted.

Self: the author hasn’t heard of class or static methods, apparently. Explicit scoping is very welcome. Especially when implementing metaclasses or descriptors. By the way: the name “self” is convention. The “self pointer” (khm, that’s why it’s called self) is passed as the first positional argument. If you call it rabbit, then you can use rabbit.foobar in your code.

Object orientation: “Ugly” is not an argument. Python has the most comprehensive and complete OOP implementation. (It even supports multiple inheritance with diamond bases), yet it has the simplest syntax ever. Not sure what the fuss is about.


I was going to defend Python with the obligatory 'every language is least a little bad' but then I noticed

  Python sucks
followed by...

  I’ll be mostly comparing it to Java and C#
...and it seems unnecessary to belabor the point.


I honestly don't get it. Why do people who don't write in python mind that I write in python? I don't mind that they don't write in python.


AMEN. You can write terrible code in any programming language. I know because I’ve done it. You can write kickass code in any* programming language. I know because I’ve done it.

Language elitism is a useful metric in that it can serve to indicate an inexperienced and/or arrogant developer. I used to do this when I was younger and less experienced, but when you really start seeing the larger world and all the stuff out there, good and bad, you start to realize the language is almost never the problem. It’s nearly always your own ignorance. And that should humble you enough to realize that doing things in a different way than your preference isn’t necessarily bad or wrong, and there’s almost always context behind bad code you’re unaware of (usually business/political pressures). Under the same circumstances, you’d probably make similar mistakes and trade offs - maybe even worse.

Humility is the gateway to knowledge.

* Except brainfuck. The name tells you all you need to know.


> I honestly don't get it. Why do people who don't write in python mind that I write in python?

Marketability of skills tied to particular technology (e.g., specific progranming language) is directly tied to the relative demand for the technology. They don't care if you program in Python, they care if decision makers choose Python for companies. A whole lot of the debate over the merits of technologies isn't really about technical merit, its about people promoting their own employability.


I agree. I don't think there is a such a thing as a bad programming language, only bad programmers.


> I don't think there is a such a thing as a bad programming language, only bad programmers.

Bollocks. A programming language is a thing that is created/engineered. As such it can be evaluated as well fitting for its purpose (aka being a good programming language) or being bad fitting for its purpose (aka a bad programming language).

This reply makes no judgment on the validity of the arguments present in the article, only about the existence of bad/good programming languages.


To me programming is more of an art than a science. To find a corollary what are some bad artistic mediums? What is a bad human language to write poetry in, or a novel?


>programming is more of an art than a science

Yes, that is a problem and one of the reasons why so much of the tooling is crap and so many projects fail.

If we are still here half a millennium from now, hopefully professional programming will start looking more like actual engineering.


Hilarious how little of Python's history is considered/known in the post.

> For a very long time, Python had two major versions running around in the wild. They are, of course, Python 2 and

Python was popular long before that, and the most recent explosion in popularity came with the rise in data science.


`self` is not a keyword. It is a variable.

You can use `this` or `banana` or `x` if you like!

…and it would be incomplete to point this out without, as the author suggests I should, an obligatory:

lol


I don't like Python that much either but I disagree with a lot of points.

I agree with the indentation used for limiting blocks, but that is just subjective preference.

Not really fond of access modifiers, I think some form of naming convention can achieve the same without restricting possibilities, from the development side at least.

Object orientation is quite awesome if you use it when it makes sense. As someone who develops a lot of C, the motivation behind it was understandable. I still think a language should give options here, not have restriction like they exist in Java. I don't want to look at hundreds of files to retrace executions.

Dynamic typing has advantages and disadvantages. I cannot say it isn't convenient, but it comes at a price.

That said, learning Python seems like quite a good idea. It can be used for system administration to high level machine learning and is a tool that can be employed almost everywhere for any problem without too much hassle.

If we wouldn't have Python, people would write more Javascript.


I don't know, it works great for me. I just launch python and write my code without any obstacles. It could be because i know the language really well, but still.


> Python is a case study in how people will try to live with something, adapt to it, and rationalize their love of it, warts and all, instead of throwing it out and finding something better.

This article is full of anger against a language and the peoples using it. Like if liking Python is being a dumb programmer.


self -> python is verbose Really? Anyone who has written code in Java or C# knows python is much more succinct compared to them.

Whitespace cannot be seen hence do not use them You are not expected to see them. you are expected to view the indentation and make sure it is consistent. This forces programs to be easier to read.

static typing > Dynamic typing OK, i agree that as programs grow large, static typing allows to catch many bugs early enough. But nowadays void * casting of pointer in C is considered bad, earlier it was ok. The point is languages improve over time (JS looking at you) and with typing support in python 3.5+, this problem is very much fixed.

No constants I am not writing python for 10 years, and simple CONST_ prefix does the job.

And no i'm not being hostile or condescending while responding :P


I, too, think Python has some very bad "design" choices, but the article completely misses them. Whitespace, dynamic typing and stuff like that are almost completely a matter of taste / use case, while patchwork-y and mostly incoherent data collections, convoluted functional support, messy package dependencies, frequent breakages between versions and so on are what often makes python development a PITA.


Can someone explain to me what the problem with these things are?

Like, why is he complaining that he has to add a value to a variable? If he doesn’t want the variable created during init of an object then don’t create it.

And what exactly is the problem with self? I’m a bit unsure what he is mad about.


tl;dr "I don't like python because it doesn't have the features I personally like"

If you find a language you like better than Python, cool, use that language. In the meantime, don't post rants posing as objective critiques, that's just a waste of everyone's time.


In short: Bitching about problems you don't really have.



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

Search: