by voidlogic · 13y ago · 0 comments
1. runs fast
2. uses little memory
3. is easily made (or is) concurrent / parallel
4. is transparent (the intuitive run time complexity of operations is apparent, no hidden O(n..) operations, etc)
5. is easy to maintain
If this code happens to be more verbose than say Java, so be it, it is still beautiful. On an anecdotal note, most large C++, Java and node.js projects I have ported to Go have ended up being fewer LOC in Go.You can cross compile as well. IE compile for Linux from OS X.
http://dave.cheney.net/2012/09/08/an-introduction-to-cross-c...
Also, since there is no version management in Go packaging, you better hope that every program uses the API of the latest or fixed version.
Imagine that a shared library were upgraded, and it contained a new vulnerability. This vulnerability now automatically exposes any program that uses said said library.
Trade offs :-)
(Compiling Go is fast. Re-rolling a binary isn't a Big Deal.)
> Also, since there is no version management in Go packaging, you better hope that every program uses the API of the latest or fixed version.
Simplicity has a price. But there's no reason why an external tool cannot be made to handle versioning.
For general purpose use, this is a huge deficiency in Go.
I also don't really agree with the "fire-fighting" approach to security. Developers are constantly removing security bugs, but they're also constantly adding them. Result: the system is always vulnerable. Why should we copy a failed approach to security, when there are other approaches like sandboxing and process isolation? (By the way, these other approaches are a good idea in C/C++ as well.)
Shared libraries are also on the roadmap for Go so at some point that will be a possibility.
That said, it's certainly much cleaner to just build static binary executables like Go does.
I do believe the Go code is more maintainable and I like the fact it is statically typed.
Looking at the Benchmark Game Go vs Java7[0], why is Java 2x to 8x faster than Go for many benchmarks? Is the jvm that optimized these days or are those Java7 programs super tweaked for performance?
[0] http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t...
What is the basis for your claim? That it's impossible to build large projects without static typing, or what?
I work in enterprise projects done in multi-site context context, usually with teams that encompass more than 30 developers with multiple levels of experience.
Depending on the customer, sometimes it is very hard to force developers to write unit tests. If the customer does not care about them, the product manager will not enforce them.
Additionally given the lack of experiences of the junior developers, always chosen because they are cheaper to the customer, unit tests tend to be badly written.
So with static typing one has at least a guarantee that the product compiles and might eventually even run.
With dynamic typing and lack of tests, you can spend days getting the product back into a runnable state.