In April 2001, Paul Graham wrote an article
“Beating the averages” (Orig) .
This post on why Go, following the article, is the very secret weapon every startup should have.
Secret weapon
Software is a very competitive business, with good ground for the emergence of monopolies. A company that writes its software faster and better, other things being equal, leaves its competitors out of business. In a startup, if you put on the wrong technology, your competitors will erase you from the face of the earth.
The quoted paragraph describes how important development speed is for a startup. And this is logical, because startups are always limited in time and money.
And achieving high productivity is exactly where Go shines.
Go is not a language full of features. There are no Generics in it (although you can use code generation to create custom data structures), its approach to inheritance varies greatly with what the majority is used to, it has only partial tail recursion optimization, etc. But this is exactly what makes Go great!
The compact specification of the language and excellent tools allow you to solve problems at a very high speed, and the code that usually results is:
')
1. Easy to write
- The standard Go library is very rich, easy to read, very good quality and speed. You will be surprised how much you can do without using third-party libraries. For example, did you know that database / sql gives you a pool of connections out of the box?
- go get is not perfect, but it allows you to connect third-party libraries without any configuration and this is incredibly important during the development phase.
- The type system is what I need. She removes a whole class of problems, with minimal ceremony.
2. Easy to understand
Thanks to
go fmt , most of the go code looks the same. This is a very important aspect, as your development department grows, beginners can pick up a project very quickly.
But what if the newbies don't know Go? No problem. Due to the minimum specification of the language, a good programmer can learn Go in 1-3 days, while mastering all of its features.
3. Simple for deployment
Nowadays, most startups use Rails or Django to quickly develop a prototype. It looks reasonable, but as soon as you need to deploy the code into production, what begins? This is what people usually do:
- Raise from 5 to 10 medium-instas on EC2
- They write difficult pipeline for deployment in cap or fab.
- They install Nginx / HAProxy before the application, because Unicorn or Gunicorn is not ready to receive direct traffic from the Internet.
- How about websockets? Oh, it will be a separate application on Node, with the same complex pipeline for deployment.
- How about background tasks? The same problem, separate applications with its deploy pipeline.
What if your startup can get rid of all this, and increase the speed even more:
- High performance and efficient use of the application's memory results in saving money, which in turn means greater maneuverability at the start.
- Due to the fact that the code is compiled into one binary, you are unlikely to think about the differences between the development environment and production.
- One binary makes the deployment procedure many times easier. In the simplest case, you need three commands - rsync, symlink and run. If you are versioning binaries, then rolling back to the previous version comes down to trite symlink substitution.
- One binary also makes setting up your Vagrant environment much easier and it allows you to do more cross-OS testing.
- You no longer need to install Nginx / HAProxy. The built-in net / http server works with large loads just to cheer.
- Web sockets? Thanks to Go design, you can safely use http handlers and websocket handlers in one application. Just plug in github.com/gorilla/websocket.
- Background tasks? For most tasks, just run a gorutina, and work with the queue inside the program using channels.
4. Ready for production
In most cases, Go's performance is similar to Java, and it consumes many times less memory.
The blub paradox (reference to the original article)
This whole part, about Lisp vs Blubs, prompted me to think about the Go-community.
There is no need to complain about the lack of those hypothetical Blub programmers looking down on Go, because there are no X features.
Should the Go community worry about them? I do not think.
Go conquers the startup community very quickly. This is not a complete, and constantly growing list of companies using Go: Bit.ly, Baidu, CloudFlare, CoreOS, DigitalOcean, Disqus, Docker, Dropbox, GitHub, Heroku, New York Times, Parse, Square, Twitch, Tumblr, Twitter, etc.
Soon enough, many of the opponents will switch to Go simply by following market trends.
Returning to the original thought
Given all the arguments above, the founders of startups, you should all consider Go very seriously.
There are too many pros and zero cons. Why wait? Call 1-800-SWITCH-GO and get all the benefits right now.