Live data from Hacker News

My Opinionated Guide To Go

blog.hackingthought.com

61–70 of 73 posts

Re: My Opinionated Guide To Go

#61
post #54

Earlier quoted context omitted.

It's a nonsense comparison anyway. E.g. with Java I don't have to care much about the hardware an operating system (e.g. we develop on Mac and deploy on Linux). And sure, you can use an application container. But you can also embed a webserver. E.g., we Jetty embedded and use a strict SecurityManager policy[1]. So it's more like: Code -> JVM (with security manager) [1] http://docs.oracle.com/javase/tutorial/essential…

Not sure I follow? With Go we develop on Mac and deploy on Linux. Just change the environment variable. Linux has some great built in tools for "security management".

You have to recompile for another platform. There may also be subtle differences in the platforms.

Re: My Opinionated Guide To Go

#62
post #57
post #5

Why does this article only compare Go with interpreted languages at the top? Go is a compiled language; wouldn't it be more fair to compare it with other languages that can be compiled, like C++, Rust, Haskell, or Lisp/Scheme? I mention this because the article acts as if getting rid of abstraction layers between the OS and the code is a new idea. No, that's how all compiled languages are... that's the point of compi…

Author here. I was comparing things that I have developed software in. It would seem unfair to compare things that I have not actively contributed production code and deploy. I mainly write web applications (services) of which C++, Rust, Haskell or Lisp/Scheme are not languages I find compelling to write web applications with. Would love to hear if you find this otherwise.

No, I honestly know next to nothing about web apps programming. I do know there exists decent-looking support for web apps for Rust, Haskell, and Scheme (Racket, but Racket isn't compiled to a binary), but I don't have the knowledge base to assess how good web programming is in these languages, if it's even good at all. I know this website is written in Arc (a Lisp). https://github.com/wting/hackernews

Re: My Opinionated Guide To Go

#63

Earlier quoted context omitted.

Exactly. I have vim handle it for me every time I save. No problemo.

Can you elaborate on how you are doing this? Would love to add this to Vim. Thanks!

Try https://github.com/fatih/vim-go. It adds seamless support for all the go tooling to vim, including go-imports.

Re: My Opinionated Guide To Go

#64
post #56
post #49

Earlier quoted context omitted.

It's actually a really great fit for C# and Java developers too... C# guys like it because it's cross platform and they get to stop the madness of worrying about what version of the .Net platform is installed. It's also nice to have a single executable and not 100 dlls to deploy... no more need for an installer to do everything for you, just drop an executable. I would imagine it's similar for the java guys, especial…

Specially when we know our eco-system well enough to beat Go on feature by feature.

I didn't really know what eco-system you were talking about, so I looked at your comment history, from that I assume you're talking about Java.

So, I really didn't mean to denigrate any communities or languages, there's definitely nothing intrinsically wrong with Java, and the ecosystem is at least an order of magnitude larger than the one for Go. Java guys have probably the least reason to switch to Go of all the languages I mentioned. I can certainly understand why a Java dev would look at Go and wonder why anyone would ever choose it over Java.

Go isn't likely to beat many languages on features, since it was purposely designed to have fewer features than most other languages. I do think it offers some advantages over Java, but Java also offers some advantages over Go. It's not a contest. No one has to "win". There's a time and a place for nearly every language.

Re: My Opinionated Guide To Go

#65
post #54

Earlier quoted context omitted.

Not sure I follow? With Go we develop on Mac and deploy on Linux. Just change the environment variable. Linux has some great built in tools for "security management".

You have to recompile for another platform. There may also be subtle differences in the platforms.

There are some subtle differences.... but these would likely be exposed in almost any language with or without a VM. For example, when porting some of our Linux Go code to Windows, we realized we were renaming a file while we held the file handle open. That works fine on Linux, and blows up on Windows. That's not really something a VM can manage for you. Similar things like "what's the canonical directory for storing your ssh configuration" is different per OS, and again, is not likely to be something that the VM will sort out for you.

I'm in the middle of porting Juju, a pretty huge Go program, from linux to linux and windows, and almost all the changes necessary are not things that a VM can help with, like "cloud init doesn't exist on windows" and "unix pipes don't exist on windows" etc.

For everything else, the Go runtime really does a pretty good job of abstracting away the differences.

Re: My Opinionated Guide To Go

#66
post #39

Earlier quoted context omitted.

Yeah, many of the ruby applications I've seen recommend RVM so that you can isolate yourself from the system-installed version of ruby. That's the nice thing about go - each application carries around everything it needs to run in total isolation from the rest of the machine.

Except for libc, of course. By the way, you can actually do the same for Python using cx_Freeze; it'll create a single executable with Python + libraries + you code. [1] http://cx-freeze.readthedocs.org/en/latest/script.html#scrip...

I should just stop making assumptions about python and assume that if there's anything you ever would like to do with python, that someone has already built it :)

Re: My Opinionated Guide To Go

#67
post #42

Earlier quoted context omitted.

Can you elaborate on how you are doing this? Would love to add this to Vim. Thanks!

There are some instructions in the docs for this: https://godoc.org/code.google.com/p/go.tools/cmd/goimports For sublime users, see here: http://michaelwhatcott.com/gosublime-goimports/ It's a great tool, very convenient.

One of the things I love most about Go is how everything you need comes with the language, unlike many language ecosystems where you have to depend on third parties for profilers, plugins, etc.

Re: My Opinionated Guide To Go

#68

Earlier quoted context omitted.

Maybe Go is trying to tell you that the "move fast and break things" methodology is not how it should be used?

I know right? I do feel a warm fuzzy feeling when things compile and I generally feel much safer than when building things in Ruby.

Me too. I don't mind working in a good C++ codebase. It feels a lot safer than working in Ruby where things suffer from bitrot due to a culture of new and shiny.

Re: My Opinionated Guide To Go

#69
post #64
post #56

Earlier quoted context omitted.

Specially when we know our eco-system well enough to beat Go on feature by feature.

I didn't really know what eco-system you were talking about, so I looked at your comment history, from that I assume you're talking about Java. So, I really didn't mean to denigrate any communities or languages, there's definitely nothing intrinsically wrong with Java, and the ecosystem is at least an order of magnitude larger than the one for Go. Java guys have probably the least reason to switch to Go of all the la…

You got it almost right, I also do know C++ and .NET quite well. My fault for not expressing myself correctly.

However I find both your answers quite faire.

My pet peeve is more with younger developers that promote Go vs other languages, without knowing how rich they actually are. Or the alternatives that came before, lost in the mist of time, with similar features.

Nowadays I do find that Go is a good and safer alternative, for C programmers doing applications that can live with a GC.

For other backgrounds in languages with native compilers available, I guess we have to agree to disagree. :)

Re: My Opinionated Guide To Go

#70
post #5

Why does this article only compare Go with interpreted languages at the top? Go is a compiled language; wouldn't it be more fair to compare it with other languages that can be compiled, like C++, Rust, Haskell, or Lisp/Scheme? I mention this because the article acts as if getting rid of abstraction layers between the OS and the code is a new idea. No, that's how all compiled languages are... that's the point of compi…

Because that is the trend of adoption. More people are using Go who also use Perl/Python/Ruby than C/C++/Java. It was originally targeted at the latter, but the actual result was from the scripting language set.

I am one of them - have used (and still use) Python since v1.52, but found Go an excellent option when performance / concurrency was needed.

Post reply on HN