3,297 karma · joined Nov 15, 2012 (14y ago) · 1,171 submissions
comment 13y ago · link · parent
You are supposed to use int when you don't care about its size (int = native word size). If you are writing a program where it matters you should explicitly use int32 or int64.
comment 13y ago · link · parent
P.S. Lots of people including me write lots of real world applications in Go...
comment 13y ago · link · parent
http://benchmarksgame.alioth.debian.org/u64/benchmark.php?te... (All the usual benchmark disclaimers apply, your mileage may very, your app is always the best bench, etc etc.)
comment 13y ago · link · parent
http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t...
Generally Scala appears to use less time, less memory and less code. I have not ever used either so I cannot anecdotally confirm this.
comment 13y ago · link · parent
In Go, having final in an embedded struct affect the containing struct seems wrong IMHO- this would allow embeded fields to dictate the behaviour of things that embed them. I don't think most programmers would be happy with adding a field to a struct and as a consequence be prevented from implementing a given method signature.
comment 13y ago · link · parent
You don't want to leave out the compression or block size however, so add those back in. Most WAN links are low bandwidth enough that compression will not slow things down (this is usually true even on 1 GBE LAN links for pigz) and in my experience the speed-up is substantial.
pigz is much faster than using ssh compression as it is multicore. apt-get it or http://zlib.net/pigz/comment 13y ago · link · parent
Yeah, I mentioned that at the bottom of my post. Using ssh or some other inline encryption would be a good idea if it is a system you care about. If you have a site to site VPN tunnel between your systems, you can skip adding the encryption.
comment 13y ago · link · parent
1. (offline) Boot new and old VM servers from live CD
2. old server: dd if=/dev/sda bs=8M | pbzip2 -c | netcat <newhost> <random high port>
3. new server: netcat -l <same port> | pbzip2 -cd | dd of=/dev/sda bs=8M
Compression: You can use something besides pbzip2, maybe pigz of if you only have a single core use bzip2 or gzip.
Security: You probably want to add encryption to this pipeline.comment 13y ago · link · parent
BUT what you might not realize is that any method defined on SuperClass (and only defined on SuperClass) can be called on SubClass, but it operates on SuperClass data. This allows SubClass to use SuperClass to help it fulfil an interface for example.
See it in action: http://play.golang.org/p/8kiwu1PlW_
comment 13y ago · link · parent
comment 13y ago · link · parent
"and from what I can see, the language is hardly every used outside Google as well."
3 Months ago Go was more popular on github by number of unique committers than Lua, Clojure, Haskell, Erlang, D, OCaml, Lisp/Scheme, Rust, Delphi, Prolog, F#, Ada etc [1]. Surely you consider some of those languages as being relevant? That is not a perfect metric, but those stats don't fit your narrative of Go being unused very well.
comment 13y ago · link · parent
comment 13y ago · link · parent
Of course it can be quantified. Some people use gzipped source code size to approximate this. I just meant that this is more subjective, has more variables and sometimes must be decided per organization or team.
"And yeah, kids today often don't learn C at school, it is a pity."
Most C-S programs I have interacted with still teach C, but yes that is a problem. I was more thinking of the "too cool for school" portion of the startup crowd, those who learn only learn scripting languages, etc
comment 13y ago · link · parent
That is a good question, but- Isn't that going to vary a lot by the person/team involved? Calculating "effort" is far more difficult than run-time or complexity characteristics.
Doesn't that question also assume that people writing in the scripting language can write (correct/decent/secure) C. Ironically, I have a strong feeling that many more Go developers can write C than say Ruby or PHP devs.
comment 13y ago · link · parent
Go vs. Ruby: http://benchmarksgame.alioth.debian.org/u64/benchmark.php?te...
Go vs. Python: http://benchmarksgame.alioth.debian.org/u64/benchmark.php?te...
Note: These results are from the 64-bit single core machine since it has already been updated to Go 1.1 beta 1. There is also a faster Go regex program (#7) that hopefully can be made to work again after 1.1 is released (in place of #1).
Although still using Go 1.0.X ,the recent TechEmpower benchmarks might be interesting if you have not seen them: http://www.techempower.com/blog/2013/03/28/framework-benchma... (It looks like Go 1.1 might be 3x faster: https://gist.github.com/errnoh/5320784)
P.S. As always your own program is always the best benchmark to use, your millage may very, take your gain of salt, etc etc.
comment 13y ago · link · parent
Since Go is >= version 1.0 and the crypo libraries in the standard library and not in go/exp, etc Go is implicitly endorsing them for some production use.
I found closed issues that might be the ones you mentioned. If you are aware of issues, you should file them: http://code.google.com/p/go/issues/list?can=2&q=crypto&#...
comment 13y ago · link · parent
But I hope you are not saying the server side JVM has never has security bugs..
comment 13y ago · link · parent
Javascript's dynamic typing, extensive use of callbacks, its approach to OO, inconsistent braces and semicolons, etc are all felt by a lot of people to be messy.
For me lack of something like gofmt and a compile time errors also greatly detract.
comment 13y ago · link · parent
Other people feel the JVM is highly targeted. Or has more security bugs than it should. Or is too bloated for the limited services they use it for and could be smaller and this present a smaller target. etc
I'm not saying these concerns are necessarily valid, but I have had customers who had no JVM rules...
comment 13y ago · link · parent
I think that a lot of developers that didn't start with front-end work find Javascript disgusting, maybe this team is in that group. When I worked at a consulting firm (that used a lot of C#) and we talked about node.js when it came out, everyone agreed they hated the idea of having to write more yucky JS than they had too. I think node.js was high on hype for a while and is less loved (esp outside of CA) than you might expect.
I've ported node.js apps to Go 1.0.1 and even back then the result was better performing, used less memory, about the same LOC and IMHO much cleaner, straight-forward and maintainable code.