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.
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.
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.
Add in automatic formatting and the amount of issues arising from indentation falls further; add in linting & it's really not an issue.
> 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?".
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.
No, it means it is both simpler to automate and less necessary, because syntactically correct code is already largely formatted.
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.
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.
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.
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’ll be mostly comparing it to Java and C#
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.
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.
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.
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.
> 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.
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:
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.
This article is full of anger against a language and the peoples using it. Like if liking Python is being a dumb programmer.
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.
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
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.
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.