Live data from Hacker News

Go 1.6 is Released

blog.golang.org

141–150 of 367 posts

Re: Go 1.6 is Released

#141
post #33

Earlier quoted context omitted.

Yes, I'd say modern Java is a good candidate too. However, the verbosity is a deal-killer for me. Go's error handling can be verbose, but while scanning the code, if I want/need to, I can easily skip through the error handling parts mentally. Java, though, is verbose everywhere. EDIT: Actually mtrn said it better: Java feels over-engineered.

Okay, ditch Java if it's too verbose and adopt one of Kotlin, Groovy (w/ @CompileStatic) or Scala.

> adopt one of Kotlin, Groovy (w/ @CompileStatic) or Scala

Scala's the only one of these three languages with any adoption right now. Groovy is virtually only used in its original dynamic mode from 2003 for things like scripting and Gradle build files, and very few people use the @CompileStatic mode introduced in 2012. Kotlin 1.0 has just been released, was subjected to stringent QA, and I expect JetBrains to use it more and more in its own products like IntelliJ, so it's a good bet it will become more popular with developers. So I'd say use Scala and Kotlin if you need static typing. Clojure, though it doesn't have static typing, has other features like syntactic macros for terseness, default immutability, and concurrency that would recommend it in many situations.

Re: Go 1.6 is Released

#142
post #5

Go checks a lot of boxes for my ideal language for developing web services: Static type, C derived, has garbage collection, generates a single binary, supports concurrency very well, is opinionated, is small/simple, its community prefers to just use standard lib for most work, etc. Yes, Generics is an issue and so is debugging. But, overall, I can't think of many other options that check so many boxes. EDIT: I must h…

Java SE and a fat jar... checks all the boxes and has generics and superior tooling. I still don't get the Go love.

Java also can't beat Go's concise syntax. Even compared to writing in IntelliJ, an awesome IDE for saving keystrokes, I relish the simplicity and brevity of Go code.

Re: Go 1.6 is Released

#143
post #20

Earlier quoted context omitted.

The way I see it: 1) Go produces 100% portable code. I absolutely suffered doing the same for a very basic C++ program that used C++11's std::regex. Compiled fine on clang-3.5 on OS X, fails on clang on Linux. It took me hours of searching online to find and install the exact version of GCC that actually fills in std::regex instead of just keeping it empty. Trust me, there are some versions that do that! No errors du…

Go programs can link the Qt library, specifically the GUI components, statically? ... it produces one output binary per target OS?

I have not tried Qt with Go to be honest, but in general yes compiled Go code produces a single statically linked binary on the target OS.

Re: Go 1.6 is Released

#144

Earlier quoted context omitted.

I don't like Oracle. I don't like the JVM. I refuse to learn Java because I personally have a strong bias for native, compiled code. In fact, I really dislike everything about the Java way of programming. The mental image of a huge ram sucking IDE with code completion for frameworks is simply incompatible with what I would consider the ideal creative process for me as programmer. That being said, if I were starting a…

For my money, Java is a pretty good language; there are only a couple of things that I think were real mistakes in the core language. And the JVM certainly performs. But the ecosystem around Java is very complex and hard to manage. Dealing with JVM configuration, webserver configuration, build system configuration, IDE configuration and God knows what else takes up all kinds of brain-space. And every so often the com…

> culture really needs to learn the value of the simple and explicit.

This is true for any programming community.

Re: Go 1.6 is Released

#145
post #100

Earlier quoted context omitted.

"Take interfaces. In Java you might start with them. In Go - in the best case - they emerge, when it's time for them." And it's a relatively subtle language feature that does this, the way that any struct that implements a given interface automatically conforms to that interface without having to be declared. Which means you can declare an interface that foreign packages already conform to, and then freely use them.…

> Which means you can declare an interface that foreign packages already conform to, and then freely use them. But you cannot do the reverse: you cannot make a type from a foreign package conform to your interface by adding new methods to it. This is because, with structural typing, it's not safe to add methods to types in other packages, since if packages B and C both were to add a conflicting method Foo to a type f…

> But you cannot do the reverse: you cannot make a type from a foreign package conform to your interface by adding new methods to it.

I thought you could.

You don't add the methods directly to it, but you can easily embed the foreign type into a new type that confirms to the interface you want.

  type FooWrapper struct {
    Foo
  }

  func (fw FooWrapper) SomeFunc() {
  ...
  }

Re: Go 1.6 is Released

#146
post #32

The reason I love Go is that every time I pull it out, I write a small amount of it and it runs beautifully. For example my company has a critical micro-service implemented in ~300 lines of Go, it's been running for six months now without a single hiccup, highly performant, very sexy. The reason I will almost never use Go for web apps is because interaction with databases is limited (almost entirely) to raw queries.…

Have you tried https://github.com/jinzhu/gorm?

Re: Go 1.6 is Released

#147
post #10

I can't wait to see what's new in 1.6! I really had a pleasure working with Go for my senior project last year. If I need to write either a server (HTTP or TCP/UDP), or a client application that must be easy to build and distribute, Go is my first choice. What Go is lacking at this moment in my opinion is: 1) A comprehensive and mature web framework. Play w/ Scala is my go-to choice now, with Django a very close seco…

> What Go is lacking at this moment in my opinion is: 1) A comprehensive and mature web framework. Play w/ Scala is my go-to choice now, with Django a very close second. I completely agree here. GIN is my fav framework so far, but it falls down sometimes on documentation and also on features. A lot of features. I know there are three viewpoints with Go. 1) Use net/http and just import libraries. 2) Use a "lightweight…

Have you looked at Revel?

https://revel.github.io/

Re: Go 1.6 is Released

#148

Earlier quoted context omitted.

Java SE and a fat jar... checks all the boxes and has generics and superior tooling. I still don't get the Go love.

Java also can't beat Go's concise syntax. Even compared to writing in IntelliJ, an awesome IDE for saving keystrokes, I relish the simplicity and brevity of Go code.

How can Go be concise when you can't do f(g(x)) without two if-statements to check for errors?

Re: Go 1.6 is Released

#149
post #125
post #115

Earlier quoted context omitted.

What is an alternate? I've never heard of that and Googling tells me nothing.

I'm guessing that means something more like "alternatives," but that's just a guess.

s/alternates/substitutes/g

yeah, basically type coercion/checking and interfaces have replaced generics in some (not all) use cases

Post reply on HN