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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Why Python Is Terrible

58 点作者 thijser将近 2 年前

38 条评论

bragr将近 2 年前
I wish people could be honest and say they don&#x27;t care for some language or framework or OS for personal or aesthetic reasons, rather than having to round it up to being objectively bad, but then I suppose nobody probably would click on &quot;I don&#x27;t like Python and have got some nits to pick&quot;.<p>Oh and he just says what is supposed to be quiet part at the end:<p>&gt;And, not to put too fine a point on it, but if you can code Python but not Go (or another decent programming language), you probably have no business writing software for a living. I know it sounds harsh and I apologize for that, but writing software is a profession and hence you should have the knowledge, skill, and experience to use professional tools.<p>Hear that all data scientists, flask devs, systems engineers, and ML folks? Python is bad so you should quit. ;)
评论 #36972522 未加载
评论 #36972269 未加载
评论 #37057583 未加载
评论 #36972682 未加载
评论 #36972899 未加载
zffr将近 2 年前
&gt; And, not to put too fine a point on it, but if you can code Python but not Go (or another decent programming language), you probably have no business writing software for a living. I know it sounds harsh and I apologize for that, but writing software is a profession and hence you should have the knowledge, skill, and experience to use professional tools.<p>Part of the profession of software engineering is maintaining software that&#x27;s already written. Should the people who maintain python code, not be paid for their work?<p>Another part is choosing the right tool for the job. Python has its flaws, but it is better than Go in some ways. For example, it has a richer ecosystem of libraries.
评论 #36972331 未加载
pkoird将近 2 年前
Terrible is using a dynamic programming language and expecting static features from it. Besides, linters and type hinting have come a long way.
评论 #36973247 未加载
评论 #36972142 未加载
评论 #36972223 未加载
jerf将近 2 年前
There&#x27;s an evaporative cooling effect. Ten years ago it was obvious that Python was going to have a very hard time in the multicore world. People who needed that performance and knew they needed that performance left somewhere in the intervening years. It has been obvious for a while that Python was not going to be capable of a general solution to that problem no matter what it did. Now those people are no longer in the Python community.<p>What&#x27;s left are people who don&#x27;t need that performance, which is sometimes me and is when I still am happy to use Python for something, and people who do need that performance, but <i>don&#x27;t know it</i>. Those are the ones who get into trouble.<p>I do wish that the Python developer community would be more open about the fact that Python performance is really quite bad in many cases and that while there are some tools to peck around the edges, it is still fundamentally a low performance language, things like NumPy notwithstanding (it is, ultimately, still a &quot;peck around the edges&quot; tool, even if the particular edge it pecks it does <i>extremely</i> well, but that only makes the performance delta worse when you fall out of its accelerated code path). I feel like maybe back in the 200Xs the community as a whole was more open to that. Now &quot;Python is slow&quot; is perceived by the community as an attack. Maybe because the ones who did understand what that issue was are mostly gone.<p>But in the 2020s, yes, Python ought to be straight-up eliminated from many tasks people want to do today on straight-up performance grounds. Overcoming a ~40x disadvantage in the single core era was sometimes tough, but often doable. But nowadays basically that gets multiplied by each core on the system, and overcoming a multi-hundred-factor disadvantage is just not worth your time <i>IF</i> that is a level of performance you need. Python is nice, but not nice enough to pay for multiple-hundred-factor performance penalties. Static languages have come a long way since 1995.
评论 #36973501 未加载
melx将近 2 年前
&quot;there are only two kinds of languages: the ones people complain about and the ones nobody uses&quot;.
jrm4将近 2 年前
Every single &quot;This language is good&quot; or &quot;This language is bad&quot; take really needs to always come with a &quot;for what, exactly.&quot;<p>&quot;This wrench is really bad for hammering nails!&quot;
评论 #36973467 未加载
评论 #36974602 未加载
JohnFen将近 2 年前
Python is one of my least favorite languages and I avoid it wherever I can. I agree with several of the criticisms here, but I disagree with this part:<p>&gt; The problem with Python is of course that it is an interpreted language with lazy evaluation<p>That isn&#x27;t &quot;the problem&quot; with Python. There&#x27;s nothing wrong with these sorts of languages. However, it does limit the sorts of problems the language is suited for, and I do see places where Python was used where another language would have produced far better results.<p>Perhaps using Python inappropriately leads to some thinking that the fault is with the language?
评论 #36972132 未加载
cjfd将近 2 年前
Yes, pretty much agree with this word for word. It is very, very difficult to refactor a python application in any sort of reliable way. The standard way of error handling in python appears to be to present the user with a stack trace. Very user friendly (not!). Now people will say that, for instance, mypy can help with this. That is true but since projects can be started without type checking chances are that your project was started without type checking and that introducing mypy is somewhere on the backlog and when it comes off the backlog it will be enabled only partially because otherwise there will be too many errors and so on. It is such a garbage programming environment.
评论 #36972370 未加载
评论 #36972748 未加载
steve_adams_86将近 2 年前
A few weeks ago I was working on a small wildfire smoke and fire perimeter API, and I hit a few annoying snags due to tooling issues. I needed to process a lot of different formats of layered geographic datasets, and converting one thing to another, processing the data into various buckets, cleaning, aggregating, etc. all wound up being extremely cumbersome and verbose.<p>I write a lot of Go and I’m used to that. But when I hit snags in the less familiar territory of geographic data processing, it was a slog. Terrible documentation for the libraries was a major barrier, and otherwise it seemed as though essential features simply didn’t exist and I’d have to invent them.<p>I got the idea to explore Python for the project because people use it for data processing. I’ve used it in the past, though never for this. Whatever, I thought, at the very least I can validate that Go is a suitable tool.<p>Within a day I had rebuilt everything with Python. I built a flask app around the forecasting and fire perimeter tools, and had it deployed the same evening. It was mind blowing.<p>As an ecosystem I was absolutely blown away by Python. Do I like the language? Not really. I encountered so many cases where something could be so much faster and more efficient with Go. Deployment would be easier. I’d get more API from the same resources. Scaling would be ten times easier. Static typing tools kept blowing up my IDE because this library doesn’t support this, or the type tool is wrong about that. It was very janky at times.<p>Yet Python got it done. It’s live right now, and development is steady. Go was not steady and I didn’t see any solution to that in sight without reinventing countless wheels.
评论 #36979573 未加载
评论 #36972463 未加载
the_af将近 2 年前
My experience with Python can be summed up as: it&#x27;s tempting to start something with it, since it has such low (initial) friction and hey, &quot;this is just a small throwaway project anyway&quot;.<p>Months or years later, it&#x27;s a beast, hard to understand or refactor, full of holes and pitfalls, and Python&#x27;s terrible tooling doesn&#x27;t help either.<p>And I never learn the lesson!
评论 #36972721 未加载
guessbest将近 2 年前
The author of the post seems like an evangelist for the Go programming language.<p>&gt; And, not to put too fine a point on it, but if you can code Python but not Go (or another decent programming language), you probably have no business writing software for a living.
评论 #36972192 未加载
lvncelot将近 2 年前
&gt; And, not to put too fine a point on it, but if you can code Python but not Go (or another decent programming language), you probably have no business writing software for a living.<p>Come on man. There&#x27;s being opionated, and then there&#x27;s <i>this</i>.
skywhopper将近 2 年前
I’m not a fan of Python, but this article is insufferable in tone. If Python doesn’t meet your needs, don’t use it. There’s plenty of oddities to gripe about in Python, but this article doesn’t attempt to learn something or make a larger point beyond “my favored approach is the only valid approach”. Sorry, but that’s not an opinion worth considering.
评论 #36972486 未加载
variadix将近 2 年前
No enforced static typing and no proper debugger make Python painful for large code bases. It’s good for scripts, prototyping, and gluing libraries together to make utilities, but if something expands beyond a single file I stop wanting to use Python. Convincing my employer of this is another matter and why I would rather avoid it completely.
vore将近 2 年前
<p><pre><code> The problem with Python is of course that it is an interpreted language with lazy evaluation […] </code></pre> Huh?
评论 #36971954 未加载
mark_l_watson将近 2 年前
I have grown to like Python for small programs and scripts because of libraries like TensorFlow, PyTorch, LangChain, etc.<p>I agree with the author that there are better languages for large applications.
objektif将近 2 年前
I have developed insanely complicated software with Python that works pretty well.<p>If you expect to find Java or C in Python you are looking at the wrong place.
评论 #36972451 未加载
andrew_eu将近 2 年前
&gt; I once worked with a service in Python that forked worker processes to handle requests, ensuring that all cores could be used.<p>&gt; &gt; Unfortunately these workers ran out of memory quickly so we decided to have workers terminate themselves after a configurable number of requests had been handled so that Linux would do our memory management for us.<p>I once worked with a service in Python that was essentially an image server for a special biomedical image format. The decoder was a proprietary C library written by a vendor and, unsurprisingly, had tons of memory leak issues. This exact feature of Gunicorn [0] saved us months of going back and forth with the vendor to get the library to stop killing our servers.<p>Python has it&#x27;s flaws, but so does anything touched by humans.<p>[0] <a href="https:&#x2F;&#x2F;docs.gunicorn.org&#x2F;en&#x2F;stable&#x2F;settings.html#max-requests" rel="nofollow noreferrer">https:&#x2F;&#x2F;docs.gunicorn.org&#x2F;en&#x2F;stable&#x2F;settings.html#max-reques...</a>
whywhywhywhy将近 2 年前
Really for all the complaints about JS&#x2F;NPM&#x2F;Electron it looks absolutely genius next to Python tooling and PyInstall.<p>It&#x27;s extremely frustrating that you&#x27;re forced into using it to access technology that doesn&#x27;t even use Python really it&#x27;s just the composing glue sticking the native C++ or GPGPU code blobs together.
Rochus将近 2 年前
&gt; <i>Using Python for a large application is like building a nuclear reactor using Lego bricks</i><p>I like this comparison. Anyway, it&#x27;s interesting to note that it took the author &quot;many years of experience running large applications written in Python&quot; to come to his conclusions. The advantages of static typing and the disadvantages of dynamic or duck typing are well known since decades. The problem is less Python as a language, but the fly-by-night decisions to just use it for anything. To stick with the example: what prevents people from using &quot;Lego bricks&quot; (or a high-temperature proof version thereof) to build a reactor? Sound engineering decisions and, most importantly, safety regulations.
NovemberWhiskey将近 2 年前
&gt;<i>forked worker processes to handle requests</i><p>File this one under &quot;things that UNIX systems programmers think will work in principle but end up being massive black-holes of attempting to quiesce any non-trivial application in a way that results in a sensible post-fork state&quot;.
retrocryptid将近 2 年前
Python is a horrible language, but not for the reasons the author gives. Just because range() returns a generator doesn&#x27;t mean the whole language is lazy. Several Lisps allow something like duck typing and they&#x27;re not horrible. It <i>is</i> possible to reason about program behaviour in dynamic languages, but JavaScript certainly makes it hard.<p>Python is a horrible language because it is not a language. It is a family of languages that changes every October. Sure, 3.x doesn&#x27;t introduce as many backwards-incompatible changes per version as 2.x did, but that&#x27;s like saying World War I wasn&#x27;t horrible because towards the end fewer people seemed to be dying every week.
评论 #36972482 未加载
nine_zeros将近 2 年前
I used to love python. It made me productive.<p>Until it introduced the haphazard type system. Now I need to import types in every file, use IF to guard it in CI in every file, and use a powerful IDE to be able to use the benefits of typing.
评论 #36972365 未加载
评论 #36972288 未加载
Goofy_Coyote将近 2 年前
Can someone explain this part to me, please? I don&#x27;t follow what&#x27;s going on.<p>&gt; Python&#x27;s use of reference counting defeated copy-on-write because even memory blocks holding variables that were read-only were actually written to in order to manipulate the reference counts, thereby blowing up the combined physical memory footprint of the workers. We solved this by smurfing the interpreter to use a magic reference count number for all variables that were created by the master process and inherited by the workers, and then not touching reference counts that had the magic value.<p>Thanks
评论 #36973505 未加载
评论 #36973294 未加载
timw4mail将近 2 年前
It&#x27;s almost like curly braces make for better languages :-P<p>My problem with python is its package system, and the mess around the fact it was designed to be global. (I have a similar gripe with Ruby).
Turing_Machine将近 2 年前
&gt; because the value of a good programming language is that it will not allow you to write programs that are structurally deficient.<p>Ummm... okay.<p>I&#x27;m not going to cheerlead for Python here (in fact I do not like it at all and also avoid it whenever possible) but many of this author&#x27;s points seem to boil down down to &quot;screwdrivers are bad, here&#x27;s why you should always use hammers instead&quot;.<p>Different tools exist for different purposes.
dgan将近 2 年前
Python is a gravity pool attracting unexperienced programmers. And very often (in my experience) , it shows.<p>Lack of static typing is nothing in comparison with lack of common sense and unwillingness to learn (&quot;why force oneself ? The job market swallows everything anyway&quot;) .
评论 #36973089 未加载
评论 #36972740 未加载
beaviskhan将近 2 年前
Everything is terrible if you use it long enough. Some things are more terrible than others for certain use cases - a thoughtful developer understands the weak points of the tooling, and selects the proper tool for the job at hand.
jsight将近 2 年前
Interesting timing given the massive increase in Python for ML and data science applications lately.<p>Pytorch is a great library too. It is hard to imagine Python decreasing in usage any time soon.
dekhn将近 2 年前
Wow, saying python programmers are unprofessional.... that&#x27;s amazing. Just completely and totally out of touch with the real world.<p>I&#x27;m glad I never reported to him while at Google.
tamimio将近 2 年前
Problem with python, it introduced a whole bunch of people into the programming world who have the minimum idea about programming or computer (mostly data scientists), just like how computer science introduced a whole bunch of people into “engineering” world even though they know little about computers at a low level, let alone at an OS level, that’s why several SaaS like heroku tried to close that gap because those “engineers” can’t into an OS!
calyth2018将近 2 年前
It&#x27;s the same old, tired rant about how Python&#x27;s terrible.<p>The post is basically a surgeon complaining that a chef&#x27;s knife is terrible for surgery; or how the F-16 can&#x27;t loiter in the battlefield and deliver strafing fire; or how carbon fibre tubes don&#x27;t handle compressive strength under water; or using C to do string manipulation and complex regex.<p>You&#x27;re using the wrong tool for the job.
acheron将近 2 年前
I thought it was just the whitespace.
delbronski将近 2 年前
This {{insert_programming_tool_here}} has not worked well for me and the projects I’ve worked on so nobody should use it. And if you do use it you are not a real programmer and you should be ashamed. Because only someone who uses {{isnert_programming_tools_i_like}} can call themselves real programmers. The recipe of these articles.
PurpleRamen将近 2 年前
&gt; Of course Go is not perfect (hint: no programming language is)<p>This is the only relevant statement.
intellectronica将近 2 年前
Python was already the most popular language for carbon-based intelligence, but now it&#x27;s also becoming the one and only language for silicon-based intelligences.<p>The future is artificial intelligence programming Python and human programmers writing blog posts about how terrible Python is.
somecommit将近 2 年前
My problem with python is that it&#x27;s branded as cross-platform when at the end you are required to learn docker and run on a linux environment to really stop suffering.
评论 #36972426 未加载
kelsolaar将近 2 年前
It is 2023 and we have Ruff and Pyright.