Live data from Hacker News

Why I Program in Go

tech.t9i.in

91–100 of 171 posts

Re: Why I Program in Go

#91
post #82
post #79

Earlier quoted context omitted.

> Go nails code [cut] documentation better than any other language I'm aware of. That's because you haven't seen PHP's documentation. Look at your Go's list example. It doesn't even show how to create a list and fill it with items. It doesn't have users' comments. It doesn't explain much about the data structure. Can it be a circular doubly link list, for instance? Is there a method to empty the list, or quickly inse…

That's a bit harsh. Library docs are for users of the language. I grant that the list package could use more docs (I personally find it a bad example) but for someone who knows Go, all the important stuff is there. Juba surprised that you rate the PHP docs so highly, particularly the user comments. Typically those comments contain terrible advice!

Users' comments are important to figure out unusual behaviors, bugs, edge cases, to clarify documentation in general, and to add code examples. Of course, some of them will be incorrect and bad advice, that's why I think PHP docs should add up/down voting on each post.

More than anything, it creates the sense of community. You always know there are people reading and writing stuff about a specific method, and, most of the time, it's helpful.

Considering how bad and inconsistent PHP is, their documentation is amazing.

Re: Why I Program in Go

#92
post #21

Earlier quoted context omitted.

How did you write a go script faster than a python script? That sounds intriguing.

edit script in vim. use :!go run % It will compile and run the script so fast you will swear it was an interpreted language except it runs way faster than an interpreted language.

You have to write it first for the Go example (:w | !go run %). For Python and most interpreted languages you can simply do :w !python.

Re: Why I Program in Go

#93
Thus far I feel that, if any language was ever going to replace C, it's probably Go. In a way I sympathize with Go. I like it for the compactness and simplicity. Those are two design decision which seem to be unique among modern languages and exactly the two things I like most about C.

Re: Why I Program in Go

#94
post #10

For the life of me I can't understand why anyone would give up the power (in terms of profiling, monitoring and ecosystem, and somewhat better performance, too) of the JVM, for a language marginally more convenient than Java, and arguably less expressive than other JVM languages. The only thing I could think of is a smaller RAM footprint, if you care about that sort of thing. Whenever Go is compared to Java, the argu…

For my day job I program in Java doing enterprise stuff, at home I enjoy dabbling in Go, D, Haskell and Clojure for personal projects.

Mainly because in my opinion it's a huge PITA to do command line stuff in Java and distributing class files/jars to other systems is a real pain especially when other instances have varying versions of the JVM running.

With Go I can just compile something on my machine and send the executable to another (running the same/similar OS) and I can be pretty sure it runs fine.

Java is great for large, long running applications like web apps and servers, but I don't think you can be as productive when knocking out one-off scripts/rough and ready prototypes.

Re: Why I Program in Go

#95
post #18

Earlier quoted context omitted.

My day job involves working with Java and C++ on 10+ year old systems. All of my hobby or side projects are in Go these days with occasional diversions into haskell, ML or various Lisps. So I'll try to impart some understanding of why I would switch to Go from Java or C++. First lets get some things out of the way. Go is fast enough and getting faster very quickly and it definitely has a smaller memory footprint. So…

You need to be commended for defending Go. I don't think the Go developers hide the fact that they mean go as a Systems level programming language. It has higher level features, but the developers don't really mind the fact that Go isn't going to be delivering a whole lot of high level features. Maybe if they come in the form of libraries... Funny thing about Go is that as a compiled language, folks often need to sen…

From my experience if you're running Linux on your local machine and Linux on your server then you can distribute a Go binary to your server and it will run fine. Even if they are different distros.

If you have differing operating systems then you have problems, but that's be a build process problem rather than a problem with Go.

Re: Why I Program in Go

#96

His second point is, to me, the most important for would-be language designers: Standardized formatting: A standard tool to enforce formatting rules that is not subject to change based on the team members' or leader's opinions is a welcome feature for lowering the "not my code" mental barrier. This is a godsend. The best thing to have happened to our industry since a very long time. But his first point is oversimplif…

If the biggest gain for the language is a formatting utility then that language is not worth learning.

The biggest gain is coroutines which are easy to add to your application. No imports, no convoluted thread initialisation just

    go myMethod()

Re: Why I Program in Go

#97

I am C and lisp fan and think OOP as non-sense. I used python a bit but hate its performance. Can I still get something from Go that can not be provided by C and lisp? Does go provide great flexibility by C and lisp? BTW, I think emacs is the best IDE so I do not care any tools/IDEs at all.

Go is a bit like C but it has GC so it depends on how much you value the fine degree of control of memory allocation that you get with C.

Personally I think Go has a lot cleaner syntax than C and the tools give a lot more "friendly" error messages when compiling your applications.

You do still get nullpointerexception runtime errors though but that's an inherent problem with the nil/null type.

Re: Why I Program in Go

#98
post #39
post #28

Earlier quoted context omitted.

The only reason you hear less "crazy" Go GC stories is because Go has never been tested as much as the JVM under different application requirements. And if high-profile companies have servers that spend 80% of the time in GC -- well, they must have really neglected their code. That's a result of poor software maintenance, and I doubt any language could help them.

> The only reason you hear less "crazy" Go GC stories is because Go has never been tested as much as the JVM under different application requirements. It is definitely true that the JVM had been thoroughly road tested compared to Go, but your conclusion is unsound. Go was designed to specifically avoid this pitfall.

Really? I remember reading all kinds of problems when trying to run go on 32-bit machines, like: http://news.ycombinator.com/item?id=3805302

Re: Why I Program in Go

#99
post #63
post #18

Earlier quoted context omitted.

My day job involves working with Java and C++ on 10+ year old systems. All of my hobby or side projects are in Go these days with occasional diversions into haskell, ML or various Lisps. So I'll try to impart some understanding of why I would switch to Go from Java or C++. First lets get some things out of the way. Go is fast enough and getting faster very quickly and it definitely has a smaller memory footprint. So…

I have a hard time believing anything can beat or even match the garbage collection performance of the JVM. Not that there is something special about the JVM, just that there have been _so_ many smart people working on the problem for so long now. And for good performance doing server tasks (ie, not computational tasks) exceptional GC is a must. Can a GO program handle a workload that creates tens/hundreds of thousan…

Remember Go doesn't have objects, it only has structs which are most likely (and should be, but I haven't verified) much lighter weight than the objects you might be used to in Java.

As far as the creating tens/hundreds of thousands of structs per second for weeks or months without leaking memory, I'll get back to you on that once my code has been active that long ;)

Re: Why I Program in Go

#100
post #67

Earlier quoted context omitted.

>> * I actually don't think immutability is as key to concurrency as it gets hyped to be. Clojure which I've used and enjoyed does tend to get in your way with the immutability by default.* I don't want to join into a language war, but I wanted to point out two things with this statement: 1- I can show you video lectures from 1985 that discuss mutability -vs- immutability in concurrent systems. Immutability won this…

My point is that Go gives you the option of immutability. Not immutability or something in between. I frequently send messages using non reference types which incurs a copy but means that I don't have to worry about who owns this code. It's easy since Go has pointer and non pointer types. Java has reference types and you have to design the object to be immutable by hiding fields behind methods and using annotations.…

Go can't do immutable updates efficiently (yet) because it doesn't have a persistent data structure implementation for vectors, maps, sets, etc.
Post reply on HN