TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Python Is a Bad Programming Language

26 点作者 igorzij超过 3 年前

17 条评论

57844743385超过 3 年前
Meh. Weak criticisms.<p>Google didn’t do anything to push pythons popularity in the community. If anything it held it back being so committed to version 2.<p>White space is a non issue. At best it ensures readability and consistent structure. At worst it’s unimportant.<p>The thing about version 2 versus version 3 is old news, everyone uses version 3, move in and shuddup about it.<p>Typing has received more significance recently with various languages like javascript moving towards typing. Python had mypy and it’s becoming more popular.<p>Pythons object orientation works just fine, and besides isn’t the industry trending away from OO?<p>None of these things make python “bad”. The author is making ridiculous claims and overreaching in his criticism and embarrassing himself.<p>A blog post that’s more hot air and bluster than substance.
评论 #28481449 未加载
评论 #28481601 未加载
fogof超过 3 年前
&gt; If you ask a Python developer about [private instance variables], they’ll respond with: “don’t access the instance variables of another class, lol”.<p>&gt; only in Python will the difference between tabs and spaces cause the interpreter to have a heart attack.<p>&gt; The question of making a variable constant came up on Stack Overflow and a Python developer’s advice was “just don’t change it”.<p>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&#x27;s sort of like asking &quot;why doesn&#x27;t Python have static types?&quot;.
评论 #28481880 未加载
anschwa超过 3 年前
Whitespace is definitely a legitimate critique of python.<p>The fact that people have learned to live with it or just ignore it is pretty irrelevant in my opinion.<p>Significant whitespace means I can&#x27;t copy+paste without introducing bugs or breaking the code. It means code formatting becomes more complex to automate. It&#x27;s seriously the dumbest language feature to defend and should be pretty acceptable to admit was a mistake.<p>I agree that having whitespace sensitive scoping isn&#x27;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 &quot;improves readability&quot;. To me that indicates an inexperienced developer who is unfamiliar with the alternatives.<p>I feel similarly for people who reject (or say they hate) static types and compilers.
评论 #28481730 未加载
评论 #28484821 未加载
评论 #28532895 未加载
eesmith超过 3 年前
&gt; the only reason it’s so popular today is because Google pushed it so hard in the first decade of the 2000s<p>I&#x27;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.<p>I struggle to think of what big influence Google had in the first decade of the 2000s. The &quot;abc&quot; 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?<p>&gt; They probably would have wanted to embrace Java, as they were already using it with Android,<p>Umm, but they were using Python from the beginning. Flash back to 1995 (!), quoting Scott Hassan at <a href="https:&#x2F;&#x2F;www.vanityfair.com&#x2F;news&#x2F;2018&#x2F;07&#x2F;valley-of-genius-excerpt-google" rel="nofollow">https:&#x2F;&#x2F;www.vanityfair.com&#x2F;news&#x2F;2018&#x2F;07&#x2F;valley-of-genius-exc...</a> :<p>] 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.<p>That&#x27;s why Python was already established at Google <i>long</i> before Android.<p>Anyway, this essay contains the usual criticisms about Python:<p>- 2 vs. 3 (a valid opinion a few years ago, IMO, but fading now)<p>- requires an explicit &#x27;self&#x27;<p>- no distinction between declaration and initialization<p>- no private variables<p>- whitespace indentation instead of braces<p>- dynamic typing<p>- no constants<p>Those seem like valid personal opinions, but little more than that.
neonihil超过 3 年前
Meaningless vent with very little substance.<p>White space issue: code needs to be well formatted. In Python, it can not be well formatted.<p>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.<p>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.
uniqueid超过 3 年前
I was going to defend Python with the obligatory &#x27;every language is least a little bad&#x27; but then I noticed<p><pre><code> Python sucks </code></pre> followed by...<p><pre><code> I’ll be mostly comparing it to Java and C# </code></pre> ...and it seems unnecessary to belabor the point.
reportgunner超过 3 年前
I honestly don&#x27;t get it. Why do people who don&#x27;t write in python mind that I write in python? I don&#x27;t mind that they don&#x27;t write in python.
评论 #28481979 未加载
评论 #28482755 未加载
评论 #28481825 未加载
karmakaze超过 3 年前
Hilarious how little of Python&#x27;s history is considered&#x2F;known in the post.<p>&gt; For a very long time, Python had two major versions running around in the wild. They are, of course, Python 2 and<p>Python was popular long before that, and the most recent explosion in popularity came with the rise in data science.
gorgoiler超过 3 年前
`self` is not a keyword. It is a variable.<p>You can use `this` or `banana` or `x` if you like!<p>…and it would be incomplete to point this out without, as the author suggests I should, an obligatory:<p>lol
raxxorrax超过 3 年前
I don&#x27;t like Python that much either but I disagree with a lot of points.<p>I agree with the indentation used for limiting blocks, but that is just subjective preference.<p>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.<p>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&#x27;t want to look at hundreds of files to retrace executions.<p>Dynamic typing has advantages and disadvantages. I cannot say it isn&#x27;t convenient, but it comes at a price.<p>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.<p>If we wouldn&#x27;t have Python, people would write more Javascript.
zyrafal超过 3 年前
I don&#x27;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.
Narann超过 3 年前
&gt; 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.<p>This article is full of anger against a language and the peoples using it. Like if liking Python is being a dumb programmer.
weedpeg超过 3 年前
<i>self -&gt; python is verbose</i> Really? Anyone who has written code in Java or C# knows python is much more succinct compared to them.<p><i>Whitespace cannot be seen hence do not use them</i> 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.<p><i>static typing &gt; Dynamic typing</i> 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.<p><i>No constants</i> I am not writing python for 10 years, and simple CONST_ prefix does the job.<p>And no i&#x27;m not being hostile or condescending while responding :P
SettembreNero超过 3 年前
I, too, think Python has some very bad &quot;design&quot; choices, but the article completely misses them. Whitespace, dynamic typing and stuff like that are almost completely a matter of taste &#x2F; 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.
wodenokoto超过 3 年前
Can someone explain to me what the problem with these things are?<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.<p>And what exactly is the problem with self? I’m a bit unsure what he is mad about.
tharne超过 3 年前
tl;dr &quot;I don&#x27;t like python because it doesn&#x27;t have the features I personally like&quot;<p>If you find a language you like better than Python, cool, use that language. In the meantime, don&#x27;t post rants posing as objective critiques, that&#x27;s just a waste of everyone&#x27;s time.
cprogrammer1994超过 3 年前
In short: Bitching about problems you don&#x27;t really have.