5 ms·
I've worked with Python for years, and Go (golang) turned out to be everything I wanted Python to be. Admittedly, Go doesn't have enforced whitespace, but it h
by bheadmaster 4y ago
I've worked with Python for years, and Go (golang) turned out to be everything I wanted Python to be.
Admittedly, Go doesn't have enforced whitespace, but it has standardized code format, enforced by the `gofmt` tool, so in 99% of cases it looks as good as Python. The syntax is somewhat similar - there is a lot of type inference and duck typing, yet the type system is still static (which removes a majority of type errors), with opt-in dynamic typing through `interface{}` (the empty interface, which is implicitly implemented by every type) and type switches.
Go is compiled to native code, and can be statically linked, making it perfect for containerization, since you don't need any dependencies whatsoever - just copy the executable into a scratch container and be done with it.
It's also very fast, and incorporates an async-by-default runtime which is scalable to an arbitrary number of CPU cores out of the box. Imagine asyncio, but multithreaded, and without the async/await keyword littering - that's Go runtime.
My favorite feature of all - the `select` keyword, which waits for a fixed set of channels (similar to queues, but lightweight), and receives/sends a value from/to the first channel that has another goroutine (similar to thread, but lightweight) sending/receiving a value to/from it. It's a very useful feature for building event-driven systems.
Sorry for the sales pitch. I just really like Go :)
- Sohcahtoa82 4y agoGo also has something other language lack... An adorable mascot. ;-)
- bheadmaster 4y agoTrue. I love that lil guy like you wouldn't believe :)
- adastra22 4y agoWhat Linux had but MINIX lacked.