TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Why We switched from Python To Go

78 pointsby olliecoabout 8 years ago

16 comments

ra7about 8 years ago
&gt; #2 Static Type System<p>It&#x27;s really weird to see one of the reasons for their switch to Go was because it&#x27;s a statically typed language. If you want static typing, you don&#x27;t choose Python in the first place. You know it beforehand and it shouldn&#x27;t come as a surprise for you.<p>&gt; For example it has http, json, html templating built in language natively<p>So does Python with urllib and json modules. I don&#x27;t know if it has HTML templating in the standard library, but you can always use jinja2.<p>&gt; Great IDE support and debugging<p>Not even a mention for the excellent PyCharm or so many of the useful Python vim plugins?
评论 #14071702 未加载
评论 #14072232 未加载
评论 #14071467 未加载
评论 #14071464 未加载
评论 #14071646 未加载
评论 #14072094 未加载
评论 #14071745 未加载
评论 #14090310 未加载
lewisjoeabout 8 years ago
I&#x27;ve tried moving one of my projects from Django to Go before. I must accept that I had to wire a lot of stuff in Go, that Django handled for me like a cake. I&#x27;m talking about configuration, patterns and common features.<p>Others who&#x27;ve been where I was: how did you cope up with this? Would you be ready to move another project from Django to Go, without the mental fatigue?
评论 #14072172 未加载
banachtarskiabout 8 years ago
Point 3<p>Goroutines are more performant than python threads if you don&#x27;t understand the difference between a thread and a routine.
评论 #14071428 未加载
agounarisabout 8 years ago
Got you something faster than go, in python... switch back to python :P<p><a href="https:&#x2F;&#x2F;magic.io&#x2F;blog&#x2F;uvloop-blazing-fast-python-networking&#x2F;" rel="nofollow">https:&#x2F;&#x2F;magic.io&#x2F;blog&#x2F;uvloop-blazing-fast-python-networking&#x2F;</a>
justin_vanwabout 8 years ago
So this lists the usual stuff that people who aren&#x27;t experts in any system think are good reasons to pick one or the other for.<p>1. The single binary is attractive, but with modern virtualenv and wheel and anylinux wheel files this is far far less important than it would have been 10 years ago. I count this as irrelevant but probably python&#x27;s library packaging is confusing to a beginner.<p>2. Static types don&#x27;t really help you here, yes you can run into some issues where you have an object that is a different type than what you thought it was, but this is not common and your tests will catch it for you. I&#x27;m not sure why django&#x27;s orm will fail on the wrong type since SQL is loosely typed anyway, but everything django is garbage so don&#x27;t use django.<p>3. Performance in python can be pretty awful. Not going to argue. It&#x27;s usually not too slow and you should focus on algorithms first, if you agorithm is efficient then you should be able to do whatever computation you need to render html or json for your service in plenty of time. But Python is slow sadly.<p>4. You don&#x27;t need a web framework for Python either, Werkzeug is a great toolkit to roll your own micro framework. So I&#x27;ll just count this as lack of experience and knowledge, plus confusion.<p>5. Great IDE support. I guess this is a thing people like to have, personally I think if you are being slowed down by how fast you can type or remember method names something is horribly wrong. The other things IDE&#x27;s do are usually pretty pointless, at least for me, but if you feel like you need it then I agree IDE support for python is usually pretty weak because python is very hard to statically analyze. None of the more productive programmers I&#x27;ve known through the years used IDE&#x27;s, they all used Vim or Emacs. If you feel like you need hand holding I guess IDE support would be important for you though.
评论 #14072410 未加载
forgottenacc57about 8 years ago
As with all &quot;why we changed from technology X to technology Y&quot;, the story is that there was this or that perceived shortcoming in technology X and technology Y will be our savior and fix all our problems, or conform to our software ideology&#x2F;dogma.<p>I used to read these things but given that I&#x27;ve read one, I&#x27;ve read em all.<p>The only reason people keep writing these things is blog filler to promote their company or do indirect recruiting. Surely cannot be cause anyone cares why you use a blue pen instead of a black pen.
评论 #14072354 未加载
leshowabout 8 years ago
This article of full of fluff. Citing a static type system as a point for Go? Go&#x27;s type system is about the weakest of any popular, statically typed language being written today. It&#x27;s full of escape hatches.
评论 #14072882 未加载
throwaway_374about 8 years ago
As an aside, the greatest thing about Python is StackOverflow one-liner solutions to common problems. How do you find your developer productivity fares in Go? To take a simple example, I was experimenting with C++ and had the simple task of &quot;reading in a CSV&quot;. This simple C++ task does not have a nicely formatted, pre-approved, community rubber-stamped, best practice 500 green ticks StackOverflow top accepted answer (sometimes by Core Python &#x2F; prominent PyCon developers) that I can just copy and paste.
评论 #14071490 未加载
评论 #14072393 未加载
sametmaxabout 8 years ago
&quot;How we rationalized after the fact that we wanted a new toy&quot;<p>There are many good reasons to switch from Python to Go, but that article misses them all.
评论 #14071609 未加载
jwezelabout 8 years ago
If someone switches away from Python he never used the unprecedented expressiveness of it, which is tens of orders of magnitude higher than the next best language.<p>One line in Python is worth several screens in the next best language.<p>Python can be as fast as C++ if you use all its features.<p>Development time is around 20 to 50 times faster than Java.
popol12about 8 years ago
That&#x27;s a dumb article. Take point 5 for instance: You can code in Go with Jetbrain&#x27;s IDE. Well guess what, Python has a dedicated IDE made by JetBrain: PyCharm. How is this an advantage ?
skynodeabout 8 years ago
A copious amount of misinformation in this article. Another <i>honest?</i> effort from the stable of individuals with a shallow understanding of elementary CS.
zelphir_kaltabout 8 years ago
&gt; Python is great and fun language but sometimes you are just getting unusual exceptions because trying to use variable as an integer but it turning out that it’s a string.<p>Oh why would I get an unusual exception, if I tried doing that _without even a try except block_ <i>hust</i>, I wonder ... must be because of the language itself and how it works.<p>&gt; [static typing]<p>Why would you have started with Python, if you did not like dynamic typing? Also I doubt that static typing saves any time at all. It might also depend on what you are used to.<p>&gt; [performance]<p>I am not sure what the application is for what Go is used in this case, so one cannot really talk about the necessity of speed in the authors use case.<p>However, the static typing example was a Django thing, so might be it is about some web app. Web apps are typically not the most performance needy things around.<p>Before bringing up the performance argument, one should check whether the performance of the language is the bottleneck or rather some I&#x2F;O, like reading from disk, database or network (for which the appropriate libraries are responsible, like a database driver, which is likely to have similar performance across libraries).<p>If it is really about some calculation being done in the language itself, there are many high performance libraries available for Python, which are implemented in Fortran and C, so I doubt that in a proper setting using Go instead of Python and its libraries would have much of a lead in terms of performance. If you are doing massive matrix operations in the language itself, then it is sort of your own fault. Python is a language, which lives from its rich ecosystem. If you don&#x27;t use it and look out for stuff, which could help you, then yeah ...<p>&gt; [built-in http json ...]<p>Many of those Python has as well and since when is built-in automatically better than an available library, if the source code of the library is properly checked, before going to the official repositories? From a minimalistic point of view, one could even argue, that it should not be part of the language and that one can &quot;customize&quot; ones setup depending on the task at hand. If looking at the time needed for setup, it is only once a creation of some virtual environment (virtualenv, anaconda, whatever else there is) and you are done.<p>What happens, when there is an update to Go or a series of updates, which add a new feature, for example like Python&#x27;s `async` and you want that in your application? You&#x27;d need to update your language compiler. But what if some of the so nicely built-in libraries changed as well and is now incompatible with what you wrote before? Maybe some function had a bad name and got renamed. Bam! You cannot update your language compiler&#x2F;interpreter without breaking things. And why is that? Because the built-in library is not decoupled from the language itself. If it was not built-in, you could have it tell you, that it is only compatible with some version of Go. That&#x27;s how it works with Python&#x27;s libraries in anaconda environments and it is all automatically taken care of for you.<p>&gt; [IDE]<p>Meh, Python got those too. I am still using Emacs amd Vim instead of an IDE. It didn&#x27;t make me any less productive.
dom0about 8 years ago
Next up from The Author:<p>5 Reasons Why We Switched from MySQL to Postgres<p>Why We Switched from Postgres to Oracle<p>11 Reasons For Switching From Oracle To KDB<p>7 Reasons Why We Switched from Go to Fortran-77<p>Grammar errors are provided for free by The Author.
评论 #14072005 未加载
评论 #14071926 未加载
评论 #14071412 未加载
jwilkabout 8 years ago
From the HN guidelines:<p><i>If the original title begins with a number or number + gratuitous adjective, we&#x27;d appreciate it if you&#x27;d crop it. E.g. translate &quot;10 Ways To Do X&quot; to &quot;How To Do X,&quot; and &quot;14 Amazing Ys&quot; to &quot;Ys.&quot;</i>
apathyabout 8 years ago
His grammar is atrocious, yet this is one of the clearest and most persuasive things I&#x27;ve ever seen on medium.<p>I learned an important lesson about writing from this author.