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.

Ask HN: Go or Python? Expanding my toolbelt

11 pointsby MTemerover 8 years ago
I have no desire to learn JavaScript, and by elimination I&#x27;m between Go and Python 3 (CPython?).<p>I&#x27;m talking about <i>really</i> learning the language. Not just doing some quick side project.<p>What would you choose? The deciding factors for me are: being future proof so my knowledge could be used in the next 5 years, cross platform, and has a solid, consistent standard lib. I&#x27;m looking for a &quot;can do several things with it&quot; language that can also help me to be a better developer (by exposing me to new stuff). I might use it for scripting or cli tooling but (ba)sh and powershell served me well so far.<p>I&#x27;m not considering mobile since I&#x27;m tired of Java and I have no desire to use the Apple ecosystem. But of course that it would be a plus.<p>I was also considering C# (is there a TL;DR? so many keywords and revisions that I already lost any desire to learn it) but Microsoft worries me. My tools and workflows are Linux based.<p>Python being slow worries me and maybe most of my effort would be spent in learning to produce pythonic code instead of learning deeper concepts.

11 comments

gh1over 8 years ago
I think you should go for Python.<p>1. Python is definitely future proof. It is most likely going to be THE language in the near future. Machine learning and AI is most likely where most new breakthroughs will happen, and Python is well positioned to leverage this. Read more here <a href="http:&#x2F;&#x2F;blog.hackerrank.com&#x2F;emerging-languages-still-overshadowed-by-incumbents-java-python-in-coding-interviews&#x2F;" rel="nofollow">http:&#x2F;&#x2F;blog.hackerrank.com&#x2F;emerging-languages-still-overshad...</a><p>2. Python has a good standard library. It has been around for a while now, so it also has a huge number of high quality third party libraries.<p>3. Python is slow and this is a serious disadvantage. However writing Pythonic code is an aspect of Python that I absolutely love. I think Guido&#x27;s guiding principle &quot;code is read more often than it is written&quot; is quite true and writing beautiful code is a thing worth learning. Other people will love you for it.
评论 #12714335 未加载
holografixover 8 years ago
Given some of your comments here about learning a new language to experiment without a clear direction I couldn&#x27;t possibly recommend Python more strongly.<p>Wanna build a web app? Wanna dabble in Datascience? Oh you wanna do Machine Learning? How about a desktop app? Game? Yep Some powerful scripting?<p>Just so easy to get productive.
kixpanganibanover 8 years ago
My work is primarily Python, and only a few months ago I started learning Go. Both of them have their own weak and strong points, and I can&#x27;t definitively say you should go for one over the other, but these may help you consider:<p>- If you want to get sh!t done, and quickly, go for Python. It&#x27;s really easy to build things from scratch with Python because of how concise, clean, and clear the language is. Plus, the Python community is huge so there&#x27;s practically a package for any advanced functionality you need (and it&#x27;s easy to write one yourself). There&#x27;s a reason why research giants such as Google, NASA, and the LIGO project use Python -- it&#x27;s because you get to spend less time getting your code to work and more time actually designing the underlying models. TL;DR: Write and ship code faster, at the cost of actual runtime performance (but PyPy and Python 3.x with asyncio, makes Python more competitive in performance as well).<p>- If performance is your focus, go for Go. It&#x27;s a lot stricter than Python because it&#x27;s a compiled language and therefore you&#x27;ll get a lot more compile-time errors with regards to variable typing and conventions (reminiscent to, but arguably even stricter than, C++ and Java). On the upside, you&#x27;ll undoubtedly incur less technical debt, at the cost of spending a lot of time cleaning your code and getting it to work. Go is pretty young, but it&#x27;s gaining a lot of traction (spawning the likes of Hugo, Docker, and Kubernetes), so if you need your program to be more performant and highly concurrent, go for Go. TL;DR: Spend more time writing code, in exchange for your program being easily concurrent and performant.<p>Personally, unless I&#x27;m writing OS-level programs that require fine-tuning of things such as memory management, I&#x27;d go for Python. Some of Go practices and conventions got tedious and old pretty fast.
cbanekover 8 years ago
I&#x27;ve written production projects in both go and python. My choice would be python.<p>Python has a great standard lib which is mature, and not changing a huge amount. It also has a lot of modules that you can pip install.<p>If you are really worried about performance, you can pick Go, although you might as well just do C++ if you&#x27;re super hardcore about performance. While the garbage collector has gotten a lot better, it&#x27;s still a perf hit.<p>That being said, for most of the code I write, it&#x27;s only slow in python if I&#x27;m doing something stupid. The threading and pool primitives are also very useful.<p>For simple web services, there are also a number of mature python frameworks (flask, django) that have more features than some of the basic go http server stuff.<p>It&#x27;s also a fair bit faster to bootstrap simple CLI programs with python. Argparse is also great.
gigatexalover 8 years ago
Python since it&#x27;s stable and mature. Or if you&#x27;re deadset on supposedly easy (at the cost of memory) concurrency, Go makes more sense and it&#x27;s newer and all you&#x27;ll get e-peen points for being on the cutting edge. Python&#x27;s been around 20-years.
评论 #12712509 未加载
grok2over 8 years ago
Both! Python has a fantastic eco-system and you can build lots of things using existing libraries. Go is new and different and useful for server type applications and easy to learn and you can finally figure you what everyone is bitching about when they claim Go is not a good-enough language because it doesn&#x27;t support generics ;-).
sethammonsover 8 years ago
I think Go matches your criteria. I&#x27;ve put more eggs into my Go basket than my Python one. For myself, I focus on building networked distributed systems. Go helps me do that (and build useful cli tools). I mostly resort to Python for scripting.<p>What type of programming do you want to do? I don&#x27;t think I would recommend Go for game development or embedded systems (though people do it).
评论 #12712747 未加载
EthanBradyover 8 years ago
One factor I would consider is how different a language is from what you already know. For example, learning something like Haskell, Elixir, or Elm (Elm is fantastic) might help you grow more as a developer because you&#x27;ll be introduced to entirely new ways of reasoning about and solving problems.
评论 #12712534 未加载
vmorgulisover 8 years ago
&gt; I have no desire to learn JavaScript... &gt; ... and I have no desire to use the Apple ecosystem.<p>I would recommend to take a look at Typescript and Swift.<p>Typescript is a better JS and Swift runs on Linux too.
tedyoungover 8 years ago
I had a similar desire to learn another language (after 20 years of Java and JavaScript), and Python was definitely on the list. What helped me decide was to look at the projects and tools that I used or wanted to use (and potentially contribute to) and then see what language they&#x27;re written in. In my case, I&#x27;d been doing a lot of Docker and Kubernetes work, so Go was a natural choice.<p>If I&#x27;d been more interested in &quot;Big Data&quot;, then Python (or, if I wanted to stay in the JVM world, Scala) would have been my choice.<p>Either way, Python and Go will be around for many years to come.
diggernautover 8 years ago
It actually depends on what you going to do with your knowledge, Go is definitely more efficient and faster than Python, on other hand Python is more popular, easier to use, has bigger set of available libraries.