News for hackers. Stuff that matters.
Re:Go 1.6 is Released by sinatra on Wednesday February 17, 2016 @05:03PM (#11121820)
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 highlight the point about checking lot of boxes. In many discussions about features of programming languages, we get responses like, "language Y does that too. Why not choose that language?" Well, because we don't pick languages for one specific feature. We pick them for the combination of features.

Re:Go 1.6 is Released by meddlepal on Wednesday February 17, 2016 @05:10PM (#11121869)
Java SE and a fat jar... checks all the boxes and has generics and superior tooling.

I still don't get the Go love.

Re:Go 1.6 is Released by autoreleasepool on Wednesday February 17, 2016 @05:31PM (#11122058)
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 web service as a business today, it would be very hard to persuade me to not choose Java. It's simply the best platform from a business perspective. For better or worse, CS departments across the US produce Java programmers more than anything else. This makes it very easy to hire Java developers. Java has stability, Java has concurrency, Java has hot reloading, Java has a good track record, Java scales, Java has really nice functional programming support, and Java is very popular with the everyday programmer. It Java has so many benefits outside of it's technical or philosophical specifications, that it's almost an obvious choice to me for web.

What's funny is that Erlang is the ideal platform for me from an idealist perspective, but I don't think I have the luck or experience it takes to successfully start an internet company with Erlang.

Re:Go 1.6 is Released by johan_larson on Wednesday February 17, 2016 @05:50PM (#11122186)
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 community goes off on some crusade. Everything must be Design Patterns. Everything must be specified in XML. Everything must be a Bean. No, everything must be Injection. No, no, everything must be Annotation.

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

Re:Go 1.6 is Released by joelg236 on Wednesday February 17, 2016 @06:27PM (#11122419)
> And every so often the community goes off on some crusade. Everything must be Design Patterns. Everything must be specified in XML. Everything must be a Bean. No, everything must be Injection. No, no, everything must be Annotation.

You couldn't have described this better for me. This is my exact frustration with the ecosystem, and it's the only thing that keeps me from using Java as my default language of choice. The language itself can be used very well, just wish the tooling was more concise and functional.

Re:Go 1.6 is Released by pjmlp on Thursday February 18, 2016 @12:32AM (#11123913)
Just wait when Go EE becomes a thing.

Then you will get testing frameworks, libraries each with its own generics workaround and cool interface spaghetti that looks beautiful in UML diagrams at the scrum wall room.

People don't really get that before Java there was C EE and C++ EE, all with similar sins.

One can change the language of the enterprise, but not what those architects do with them.

Re:Go 1.6 is Released by johan_larson on Thursday February 18, 2016 @05:59PM (#11130067)
I fear you are right. Go's simplicity, its pattern of having one and only one way of doing anything, is likely a product of its youth and unpopularity. As the years pass and its following grows, people will come along who want to do things differently, and the ecosystem will become richer but also more confusing.

Perhaps the best thing for the language would be for it not to become too popular.

Re:Go 1.6 is Released by pjmlp on Friday February 19, 2016 @02:08AM (#11132090)
Avoid success at all cost.

-- Haskell

Re:Go 1.6 is Released by codygman on Friday February 19, 2016 @09:12AM (#11133511)
It should be read:

Avoid (success at all cost)

Rather than what you might be (others do at least) implying:

(Avoid success at all cost)

Re:Go 1.6 is Released by teh64 on Thursday February 18, 2016 @07:05AM (#11125164)
> JVM configuration

This is the mother of all premature optimization. Other than maybe modifying heap size or setting client vs. server, most of the default JVM configurations work for almost everything.

> build system configuration

I actually find maven pretty easy to use, but maybe it's just that I am used to it.

> IDE configuration

I don't know what crazy IDE you are using, but both Intellij and Netbeans need very little, if any, configuration out of the box.

> [Java] community goes off on some crusade

As opposed to everyone else? /s

Re:Go 1.6 is Released by randallsquared on Thursday February 18, 2016 @10:10AM (#11126248)
To combine the JVM configuration and IDE configuration points, out of the box on a new 16GB Macbook Pro Retina, Intellij (at least, as PHPStorm) will spend an enormous amount of time unresponsive at startup and periodically thereafter. Why? Because of two things: the default JVM settings it ships with starve it of resources, and the default validation settings have it trying to check everything under the sun.

There's also the initial indexing, but I can live with that, since it enables beautifully fast jump-to-definition, which is hard to live without.

Re:Go 1.6 is Released by iofj on Wednesday February 17, 2016 @10:39PM (#11123550)
Why would you configure a webserver for a java process ? Just have every process include a webserver. At what address ? Well simple : any free address, then register the address you've started up on in zookeeper. Likewise, contact your dependencies by resolving them on zookeeper (this can be done using DNS if you want minimal changes. Protip: SRV records have both ip and port).

Having the webserver is useful for reasons beyond just being independant of the webserver itself, like exporting metrics. Making the logs inspectable. Getting thread dump, inspecting current state, ...

Re:Go 1.6 is Released by stcredzero on Wednesday February 17, 2016 @07:15PM (#11122675)
> 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 by dcposch on Thursday February 18, 2016 @01:37AM (#11124085)
This is my favorite thing about Go.

All language arguments aside, Go coders are usually pragmatic and humble and Go code is usually simple and explicit.

Re:Go 1.6 is Released by paulddraper on Wednesday February 17, 2016 @09:18PM (#11123215)
"Compile times must be fast"
Re:Go 1.6 is Released by jimmaswell on Thursday February 18, 2016 @12:56AM (#11123971)
>there are only a couple of things that I think were real mistakes in the core language.

Type erasure was a pretty big one that I've felt the impact of a few times in the small amount of Java code I've written (99% being school assignments). One of the reasons I strongly prefer C#/.NET as a language/environment. What I've tried of ASP.NET coding seemed nice.

Re:Go 1.6 is Released by epalmer on Wednesday February 17, 2016 @09:52PM (#11123332)
I'm lucky that I develop Java CLI apps that only I need to maintain and one other person. But damn there are days in which I scratch my head and wonder why I have to write so much code to do simple things. But on the other hand my best work has been writing Java apps.

I have a love hate relationship with Java. I do have Java apps that runs 24x7, day after day without failure.

I think I protest too much.

Re:Go 1.6 is Released by curun1r on Wednesday February 17, 2016 @09:59PM (#11123359)
> it would be very hard to persuade me to not choose Java...For better or worse, CS departments across the US produce Java programmers more than anything else.

This is actually the reason I would not choose Java. I started programming Java in the 90s and spent the better part of 2 decades writing code in it. The last 8 years of that time, I was a lead developer, so I've interviewed hundreds of Java developers. The most kind way to describe them, as a whole, is uninspired. If I were more honest, I'd say that the vast majority of Java programmers are completely unqualified. There are very few Java programmers who write code because they have a passion for it and it shows...most just learned Java to make lots of money.

On the other hand, if you were to choose a language like Go or Erlang, you'd get less than one tenth of the resumes for your open position, but the majority of those resumes would be highly qualified. The reason is that each of those candidates was motivated to learn a new language solely out of curiosity. You'd be automatically selecting for intellectual curiosity and that's a powerful tool that will save you hours upon hours sifting through Java candidates who are simply a waste of your time.

This isn't an indictment of the Java platform...it's no longer my favorite programming target, but there's nothing fundamentally wrong with it from a technical perspective. It's just a recognition that more != better when it comes to language ecosystem. Quality matters.

Re:Go 1.6 is Released by pjmlp on Thursday February 18, 2016 @01:41AM (#11124094)
I have a similar experience with interviewing Java developers in offshoring projects, and I started to think like that, until I was involved into similar projects done in other languages and came to the conclusion any mass market programming language suffers from the same sins.
Re:Go 1.6 is Released by jhh on Thursday February 18, 2016 @12:56AM (#11123972)
Do you know this essay http://paulgraham.com/pypar.html? Almost exactly your points.
Re:Go 1.6 is Released by StevePerkins on Wednesday February 17, 2016 @06:03PM (#11122273)
> 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.

Java has long been my primary professional language, and over the past few years Go has taken on a strong secondary niche at my job. I'm big fan of both, and tend to play Switzerland in arguments between them.

That being said, the best Go IDE out there right now is the official Go plugin for IntelliJ... which again, happens to be the best Java IDE out there. If you are doing modern software development in ANY language, then you are probably traveling one of three paths:

(1) Using an IDE based on JetBrains or Eclipse.

(2) Using a variant of Microsoft Visual Studio, which is about an order of magnitude more bloated than #1.

(3) Using a plain text editor, which for a typesafe language is a bit daft.

Re:Go 1.6 is Released by logicchains on Wednesday February 17, 2016 @06:20PM (#11122371)
What does the Go plugin for IntelliJ offer that Go plugins for Emacs don't? My setup right now has live error checking (highlights errors as they occur), gofmt on save, safe refactoring via gorename, jump-to-definition, proper autocomplete, and Go Oracle integration, for e.g. finding all callers of a method. Due to being Emacs it also has much better support for Vim keybindings via Evil mode.
Re:Go 1.6 is Released by dlsniper on Wednesday February 17, 2016 @06:32PM (#11122451)
Debugging, cross-platform, integration with a lot of other languages, and databases, local history, out of the box configuration for everything you've just mention (including the Vim key working mode, via a plugin) so that people don't spend time in doing all of that and so much more :)
Re:Go 1.6 is Released by logicchains on Wednesday February 17, 2016 @09:56PM (#11123352)
In what way is IntelliJ more cross-platform than Emacs?
Re:Go 1.6 is Released by twistedpair on Wednesday February 17, 2016 @10:44PM (#11123567)
It's written in Java ;)
Re:Go 1.6 is Released by geoka9 on Wednesday February 17, 2016 @10:02PM (#11123377)
Are using go-projectile for all of that? If not, what did you use for gorename integration?
Re:Go 1.6 is Released by logicchains on Thursday February 18, 2016 @02:24AM (#11124231)
Re:Go 1.6 is Released by ilek on Thursday February 18, 2016 @05:34AM (#11124853)
Visual Studio is more bloated than IntelliJ or Eclipse? Absolutely not.

When I had the displeasure of using IntelliJ it would use 1.2GB RAM for a fucking 5 file project. Debugging would then use another 1GB RAM.

Visual Studio uses 1GB RAM with a 150 project solution open, and it opens said solution about as fast as IntelliJ opened that tiny project.

Adding something like Resharper (by your beloved Jetbrains) will make Visual Studio bloated and slow.

Re:Go 1.6 is Released by Manishearth on Wednesday February 17, 2016 @11:15PM (#11123685)
> (3) Using a plain text editor, which for a typesafe language is a bit daft.

What's wrong with using Vim, Emacs, or Sublime? There are plugins out there which get you a lot of the IDE magic (including jump to definition, autocomplete, autofmt, and there probably is something for inline errors)

Re:Go 1.6 is Released by iainmerrick on Wednesday February 17, 2016 @06:18PM (#11122363)
(4) Xcode? There are lots of iOS programmers out there.
Re:Go 1.6 is Released by shopkins on Wednesday February 17, 2016 @11:32PM (#11123745)
Still in camp #1 (AppCode). As someone who also does development outside of iOS, you couldn't pay me enough to solely use Xcode.
Re:Go 1.6 is Released by mwcampbell on Wednesday February 17, 2016 @08:45PM (#11123084)
Can you explain why using a plain text editor for a typesafe language is a bit daft?
Re:Go 1.6 is Released by paulddraper on Wednesday February 17, 2016 @09:22PM (#11123229)
That may be stated too strongly, but the argument is in a statically typed language you go to all the trouble to provide the compiler with sufficient amounts of information, but then don't leverage that in your editor.

E.g. if you call a statically resolved function, your IDE should be able to take you to the function's definition.

Re:Go 1.6 is Released by krakensden on Thursday February 18, 2016 @11:23AM (#11126855)
Go was designed to make tooling easy, and that tooling has been written: https://github.com/nsf/gocode/blob/master/README.md

And it's pretty trivial to get Vim super integrated with go: https://github.com/fatih/vim-go/blob/master/README.md

Re:Go 1.6 is Released by paulddraper on Thursday February 18, 2016 @07:23PM (#11130539)
And you consider that an IDE, right?

An Integrated Development Environment?

Re:Go 1.6 is Released by krakensden on Saturday February 20, 2016 @09:13PM (#11142970)
No, and nobody else does. There's a lot more baggage and feature check-boxes tied up in that name.
Re:Go 1.6 is Released by alkonaut on Thursday February 18, 2016 @03:19AM (#11124414)
Because if it's a text editor it doesn't have all the info and functionality you have available in an IDE. Run tests for your current function, navigate to definition, manage large projects, configure builds, see test coverage, step with interactive debuggers, REPLs, vcs integration, symbolic refactorings, autocomplete, etc.

Most of this can be added to emacs too. Then it's an IDE.

Re:Go 1.6 is Released by voidlogic on Wednesday February 17, 2016 @11:50PM (#11123798)
(4) Use LiteIDE, simple IDE written for Go.
Re:Go 1.6 is Released by fithisux on Thursday February 18, 2016 @03:54AM (#11124506)
The best ide for golang. It is not Netbeans or Eclipse but

it is lightweight, enough features and gets the job done.

Re:Go 1.6 is Released by kmch on Thursday February 18, 2016 @04:50AM (#11124696)
VS is much faster than the JetBrains IDE without any plug ins. Adding JetBrains' products makes it slow.
Re:Go 1.6 is Released by charlieflowers on Wednesday February 17, 2016 @11:59PM (#11123825)
A huge percentage of those doing #2 are using Resharper (a JetBrains plugin for Visual Studio).
Re:Go 1.6 is Released by zenlikethat on Wednesday February 17, 2016 @06:18PM (#11122358)
I agree Erlang is probably not the correct fit for the average startup, but for some areas it is essentially unparalleled (and businesses have had great success with it). Consider the online advertising industry, for instance -- in order to guarantee the kind of uptime and debuggability that real-time bidding and decision making on ads requires, Erlang is an excellent choice (cf. https://www.youtube.com/watch?v=qURhXHbxbDU).
Re:Go 1.6 is Released by poooogles on Wednesday February 17, 2016 @06:24PM (#11122398)
Go is great for RTB as well. Easy concurrency that scales very well. Anecdotally it seems a lot easier to hire for than Erlang/functional languages.
Re:Go 1.6 is Released by davidw on Wednesday February 17, 2016 @08:00PM (#11122888)
If it's just concurrency and scaling, things are a toss-up. Where Erlang really comes into its own are all the fault tolerant and distributed things that Erlang adds, like the supervision tree.
Re:Go 1.6 is Released by mayhew on Wednesday February 17, 2016 @08:58PM (#11123129)
Go is such a simple language that I believe any decent developer could be productive with it within a week. I'm not sure the hiring argument is all that great.
Re:Go 1.6 is Released by pjmlp on Thursday February 18, 2016 @01:45AM (#11124111)
> For better or worse, CS departments across the US produce Java programmers more than anything else.

That is real a problem of quality of those CS departments.

My humble Portuguese CS department teached me about Pascal, C++, C, Prolog, Caml Light, Smalltalk, Java, Lisp, MIPS and x86 Assembly.

Having a quick look at their current curriculum, now around 25 years later, they seem to still provide a good mix.

Re:Go 1.6 is Released by autoreleasepool on Thursday February 18, 2016 @08:53AM (#11125693)
I have to admit I'm jealous you had such a diverse exposure to programming paradigms.

I agree it's a problem. I've always found it odd that the AP test is in Java for example. I would imagine pseudo code would be a better choice for a conceptual test.

Re:Go 1.6 is Released by pjmlp on Thursday February 18, 2016 @09:28AM (#11125918)
And I only listed the official ones.

Those of us, like myself, that opted into the compiler design classes had a quite a few more to play with.

I guess the problem are those universities that tend to be more focused on "languages to get a job" than doing the real work of an university.

Re:Go 1.6 is Released by pjmlp on Thursday February 18, 2016 @12:26AM (#11123896)
>I refuse to learn Java because I personally have a strong bias for native, compiled code.

All commercial JVMs support AOT compilation to native code.

Yes even some of the Oracle ones, e.g. Java Embedded.

Re:Go 1.6 is Released by d4rkph1b3r on Wednesday February 17, 2016 @11:10PM (#11123672)
>For better or worse, CS departments across the US produce Java programmers more than anything else.

Do you think this large pool of programmers are good?

>This makes it very easy to hire Java developers.

Yes, if you are looking for sub-par developers. I don't think Google thinks to itself "oh man we're so glad we use java, otherwise hiring would be challenging". No, they have just as much difficultly hiring as anyone else. I'd even say that considering it's the 'blub' language to use PG speak, it makes hiring harder for them.

>Java has stability, Java has concurrency, Java has hot reloading, Java has a good track record, Java scales,

No, those are things the JVM has.

>Java has really nice functional programming support,

You can't honestly believe this. How much functional programming experience do you have?

Re:Go 1.6 is Released by autoreleasepool on Thursday February 18, 2016 @08:28AM (#11125550)
> Do you think this large pool of programmers are good?

Yes, why not? I have yet to see evidence that Java programmers are not good. Seems like a discriminatory mindset. The large pool also makes them easy to replace. I think Facebook has had an ad for an Erlang developer for a few months now. I don't think a startup needs that kind of stress.

Also, I'm sure there are Java Devi who are absolutely fantastic. That is, I think the idea of the meme "real passionate programmers use less mainstream languages" is entirely unsubstantiated. This line of thinking comes from immaturity, elitism, and a desire for validation by association.

It's just like the "the best lawyers were on the debate team" meme that's also very untrue. It sounds nice if your kid is on the debate team, though

>No those are the things the JVM has.

I meant Java as a platform. Funny, you were the only one who didn't know what it was what I meant here.

> You honestly can't believe this. How much functional programming experience do you have?

I've dabbled with Erlang and Haskell. I don't have as much functional programming experience as I would like. Also, I've only heard good things about Scala and Clojure. What was so ridiculous to you about what I said? Or are you unable to forgive an accidental conflation of Java and the JVM?

Your criticism come across as nothing more than unreasonably pedantic expectations for terminology. They either reflect your inability to use context clues effectively or your lack of common sense.

> It's the 'blub' language to us PG speak

This is a poor reason to think Java developers are incompetent. I hope this isn't the premise that led you to that inherently false conclusion.

Re:Go 1.6 is Released by d4rkph1b3r on Thursday February 18, 2016 @01:52PM (#11128219)
Eh, most of my post was an emotional response because of my hatred of the java language. Your reasoning I mostly agree with.

I do agree, the JVM is a solid language choice. I also don't think going with too esoteric of a language is a good thing. Probably a little early to bet a company on Idris or Ceylon.

Still, I apologize for my tone. Let me give you purely anecdotal information about me, so you can at least see where I'm coming from with regards to my anti-java stance.

After doing java/C# for many many years, I will not do it again. I'm much more productive in Scala/F#/ML, it's more pleasant to use, and I believe the average programmer using those languages ends up being a different caliber than the java programmers.

There are absolutely good Java programmers. They just probably work at Google or Facebook and you'll be competing with Google. I would take less money (and have, though not too much less) to not work at Google because I get to use a functional language.

shrug

If a startup is using java, I think to myself 'why java? why not Scala, F#, or C# at the very least?'. Usually the answer is 'scala/F# programmers are too hard to find', but that's not really true, what they mean is they're not willing to pay the 20% premium for them. That's a strong indicator that a start up doesn't value talent.

Re:Go 1.6 is Released by autoreleasepool on Thursday February 18, 2016 @07:19PM (#11130520)
> Still, I apologize for my tone.

It's all good! I've had the same heat of the moment responses on here, so I get it. But thanks anyways.

> If a startup is using java, I think to myself 'why java? why not Scala, F#, or C# at the very least?'. Usually the answer is 'scala/F# programmers are too hard to find', but that's not really true, what they mean is they're not willing to pay the 20% premium for them. That's a strong indicator that a start up doesn't value talent.

Definitely. If I chose the JVM or (blanking) the Microsoft VM I would not limit myself to the object oriented languages for those platforms. I was under the impression that using multiple languages was a given, but apparently not? I wouldn't know, I'm doing iOS right now (hence the username). I graduated fairly recently, so I can only go off of what I've read.

So, I would probably do Java and Scala together if that was possible. I really haven't looked into it. My startup was completely hypothetical.

Re:Go 1.6 is Released by lowmagnet on Monday February 22, 2016 @07:42PM (#11155561)
Might I suggest starting with Java, but moving into Kotlin after getting the basic syntax of Java down? I have a good feeling about the language after translating a system of classes to it recently. About 60% of the code vanished, and working in it let me free up a few concepts for the resulting java code after doing my thinking in Kotlin.

Most of the stuff Kotlin does, absent much nicer functional syntaxes, I can do in Java 8 already. I think Kotlin does a better job at expressing it. I especially like the first-class nature of functions, and I know I'm just in the early days of understanding it.

Re:Go 1.6 is Released by d4rkph1b3r on Thursday March 03, 2016 @06:42PM (#11220935)
Why kotlin and not scala? Kotlin is like Scala--, in addition to not really having a job market.
Re:Go 1.6 is Released by foxylion on Thursday February 18, 2016 @12:33PM (#11127548)
Some true words.

The programming language has really nothing to do with the quality of a developer. A new language is learned quickly, software engineering skills not.

Re:Go 1.6 is Released by serge2k on Wednesday February 17, 2016 @10:51PM (#11123587)
> I refuse to learn Java

So you willfully ignorant but will continue to spout off opinions anyway?

Re:Go 1.6 is Released by autoreleasepool on Thursday February 18, 2016 @08:38AM (#11125608)
I've read a lot about Java. I just don't want to learn it on my free time. My opinions were based off what I read
[dead]
Re:Go 1.6 is Released by hans0l074 on Wednesday February 17, 2016 @06:16PM (#11122351)
Your comment is quite cryptic imho, and there is no need to respond in this fashion. Can you elaborate?
Re:Go 1.6 is Released by mtrn on Wednesday February 17, 2016 @05:23PM (#11121984)
I am reading and writing Go and Java almost daily. Java has a tendency to be written in an over-engineered way. The Go community has an inclination towards cautious abstractions.

Take interfaces. In Java you might start with them. In Go - in the best case - they emerge, when it's time for them. Java has more mature tooling, but then, I cannot remember gathering runtime insights with Java quicker than with Go pprof[1].

Java is rock solid and more and more libraries are written in lightweight and clean way. Go has more momentum and also a growing number of curious users, who explore the language in creative ways[2].

[1] Google image search for "go pprof": https://goo.gl/6l7t1b

[2] Just discovered this amazing guy recently, https://github.com/fogleman/ln, https://github.com/fogleman/nes

Re:Go 1.6 is Released by jerf on Wednesday February 17, 2016 @06:18PM (#11122356)
"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 that you can code freely with concrete structs to start with, and then trivially drop in interfaces to your code later, without having to go modify any other packages, which you may not even own.

I completely agree that on paper Java and Go look virtually identical. But the compounding effect of all those little differences makes them substantially different to work with. Good Go code does not look like good Java code. You'd never confuse them.

Re:Go 1.6 is Released by pcwalton on Wednesday February 17, 2016 @06:44PM (#11122518)
> 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 from package A, B and C could not be linked together. This is a major downside of structural typing for interfaces. Swift, for example, has the "extension" feature, and Java's design allows for it in principle, but it's fundamentally incompatible with Go's design.

Re:Go 1.6 is Released by jerf on Wednesday February 17, 2016 @09:00PM (#11123139)
The list of languages that permit that in a principled way is short, and the list of languages where it's a good idea is even shorter. I've come to the conclusion that it's generally not a good idea. (And it's not Go making me say that, it's more Haskell.) Keeping dependencies flowing in one direction seems to be a good plan.
Re:Go 1.6 is Released by pcwalton on Wednesday February 17, 2016 @09:05PM (#11123160)
I totally disagree. It's not only a good idea, it's essential for certain core functionality to work at all. Take serialization, for example: without this feature it's impossible to write a good serializer as a library without code generation (messy and brittle) or reflection (very slow). To give another example, try writing a linear algebra library that's generic over the data type without this feature (and such libraries are essential for high performance graphics programming). The only way I can think of to make it work is to make callers explictly box their numbers into wrapper types you create, which is really ugly and causes various other problems.

I don't understand the idea that not having this feature somehow helps enforce dependency order either. Extension implementations of traits don't give you any more abstraction-breaking power than downcasting interface{} to a concrete type not defined in your package does. In fact, they're pretty much strictly less powerful.

Re:Go 1.6 is Released by aktau on Thursday February 18, 2016 @02:18AM (#11124206)
> To give another example, try writing a linear algebra library that's generic over the data type without this feature (and such libraries are essential for high performance graphics programming).

I disagree. My best, fastest to compile code has always focused on just one type. You mention graphics programming: for 99.999% of the cases you want to pick a type. Usually, this will be float, and thus for SIMD a 4 or 8-vector of these, like https://github.com/aktau/threedee-simd/blob/master/include/t.... Despite the support of recent graphics cards for doubles, the fact is that they are usually quite a bit slower. Even when precision bound, there are usually tricks that will let one keep using floats (esp. wrt to Z-buffers).

Re:Go 1.6 is Released by pcwalton on Thursday February 18, 2016 @02:56AM (#11124350)
It's very useful to use different types (for example, fixed point) in VBOs in order to save space and/or reduce CPU side processing.
Re:Go 1.6 is Released by jerf on Thursday February 18, 2016 @08:42AM (#11125633)
Are we talking about the same thing? That is the most full-throated defense of orphan instances I've ever heard. The reaction to such things is generally... less positive... to put it lightly.
Re:Go 1.6 is Released by pcwalton on Thursday February 18, 2016 @01:10PM (#11127834)
Orphan instances arise when the implementation of the interface is in neither the same package as the package that defines the type nor the package that defines the interface. I'm defending the latter (which Go's rules rule out), not orphan instances.
Re:Go 1.6 is Released by justinsaccount on Wednesday February 17, 2016 @07:15PM (#11122676)
> 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 by pcwalton on Wednesday February 17, 2016 @07:29PM (#11122749)
That's making a new type, which causes a lot of friction. For example, a []Foo array is not castable to a []FooWrapper array without recreating the entire thing.
Re:Go 1.6 is Released by kasey_junk on Wednesday February 17, 2016 @06:31PM (#11122446)
There is a big downside to structural typing as golang implements it though. Refactoring tools. They quite simply cannot do the same kinds of safe refactoring something like a Java refactoring tool can do, because you can't be sure if the function you are trying to rename, add parameter too, etc. is actually the same function in question.

There are times when I love the structural typing aspects of golang (trivial dependency inversion) and there are times when I hate it (nontrivial renames), its one of many trade-offs you have to be prepared for in golang.

Re:Go 1.6 is Released by nulltype on Thursday February 18, 2016 @03:52AM (#11124500)
I believe you can do renames with the oracle tool
Re:Go 1.6 is Released by azth on Thursday February 18, 2016 @09:00PM (#11131019)
> Which means you can declare an interface that foreign packages already conform to, and then freely use them.

Except that it is very difficult to find out which struct implements what interface, you'd have to go look through the code. Not to mention there is always the possibility of accidentally implementing an interface. This has already caused real issues it seems (there was a blog post about it).

There already exists a solution for this issue, via typeclasses.

But golang doesn't have generics.

Re:Go 1.6 is Released by lobster_johnson on Wednesday February 17, 2016 @05:44PM (#11122152)
For me, I like Go's slim profile. Native compilation, aggressive allocation, low memory usage, static compilation.

JVM suffers from slow startup times and tends to eat a lot of RAM, even when the app doesn't technically need it around. It has an object model that spawns a bazillion tiny objects, and much of the JVM's GC design exists to cancel out those tiny object allocations.

JVM has many upsides (the portability and pluggable nature of JAR files is a huge one), but I think a lot of people are attracted to Go's bare-bones approach. Closer to the metal, a "better C", smaller overhead.

Re:Go 1.6 is Released by mahmoudimus on Thursday February 18, 2016 @01:42AM (#11124097)
Startup times are largely going to be a thing of the past in Java9. Improved code cache, out of the box optional AOT compilation, and the modularization work is going to be great.

I am running several (albeit Kotlin) daemons right now that are using less than 256MB of ram on my machine. Everything on the JVM is configurable.

At some point, I think it's just simply a matter of taste. If you want to be closer to the metal, then Java (and I'd even argue Go) isn't really the right language for that.

Re:Go 1.6 is Released by jdcarr on Wednesday February 17, 2016 @06:11PM (#11122325)
What's your use cases where you've found startup time to be a significant issue?
Re:Go 1.6 is Released by lobster_johnson on Wednesday February 17, 2016 @06:15PM (#11122346)
Command-line programs.
Re:Go 1.6 is Released by jahewson on Wednesday February 17, 2016 @06:58PM (#11122597)
Short-lived processes are an issue, because while startup time can be ok, code won't perform well until it's hot enough to be JITed.
Re:Go 1.6 is Released by pjmlp on Thursday February 18, 2016 @01:49AM (#11124117)
You can set the JIT threshold to 0, assuming the impact would still be worthwhile.

The alternative is a commercial JDK, almost all of them do support AOT compilation.

Re:Go 1.6 is Released by kasey_junk on Wednesday February 17, 2016 @06:24PM (#11122401)
Long running processes without a lot of events can also deal with "startup issues", in that they won't trigger JIT.
Re:Go 1.6 is Released by pjmlp on Thursday February 18, 2016 @01:48AM (#11124114)
You can set the JIT threshold to 0, then it will JIT the full bytecode on startup, but it might perform worse.
Re:Go 1.6 is Released by fpoling on Thursday February 18, 2016 @02:26AM (#11124243)
Fast compilation and minimal startup time in Go allows for very fast development feedback similar to what one gets with interpreted languages.
Re:Go 1.6 is Released by taf2 on Wednesday February 17, 2016 @05:14PM (#11121903)
Go starts very fast compared to jvm. Go compiles into a binary that does not require a jvm to be installed... Go does not require an IDE to develop in... Go is also less verbose
Re:Go 1.6 is Released by pjmlp on Thursday February 18, 2016 @01:54AM (#11124128)
> Go compiles into a binary that does not require a jvm to be installed.

Java also does not need a JVM to installed.

1 - Use a fat jar

2 - Use the upcoming Java 9 linker which bundles everything together

3 - Spend some money and get a commercial JDK with AOT compilation to native code. All the major ones support it.

4 - Eventually Java 10 Oracle JDK will support AOT compilation to native code, but it remains to be seen if will remain commercial only

Re:Go 1.6 is Released by cgh on Wednesday February 17, 2016 @05:20PM (#11121958)
1. Not an issue for web services, which is what the OP was referring to.

2. See #1.

3. Neither does Java, although of course it can be helpful.

4. Error handling is certainly not less verbose.

None of the above overcome the lack of tooling, libraries and generics, at least for me.

Re:Go 1.6 is Released by fomojola on Wednesday February 17, 2016 @05:21PM (#11121967)
Java doesn't require an IDE either: emacs/Ant/Maven is all I've ever used. Barring specialized platform-specific toolsets (like Android Studio) you don't NEED anything else (you might WANT something else, but that's a separate issue...)
Re:Go 1.6 is Released by abc_lisper on Wednesday February 17, 2016 @05:45PM (#11122162)
Either you are very good, or you are working on small projects. Can't say which!

Java is 100-ton dinosaur to be working with using a simple editor. Spring, it dependencies, hibernate, junit alone make you want to work with an IDE.

Re:Go 1.6 is Released by groovy2shoes on Thursday February 18, 2016 @07:56PM (#11130720)
I once wrote a forest fire simulator based on a cellular automaton in Java using nothing but a terminal and Leafpad. It's doable, I promise.
Re:Go 1.6 is Released by abc_lisper on Thursday February 18, 2016 @11:33PM (#11131559)
Yeah, I can believe that. However webapps(in your average startup) are far more complex, in the tools, libraries they use.
Re:Go 1.6 is Released by placeybordeaux on Wednesday February 17, 2016 @07:50PM (#11122839)
I try to use CLI editors for everything (for me it's vim, but lets not make that a big deal :P), but I have never been successful in doing so with java.
Re:Go 1.6 is Released by xiaoma on Wednesday February 17, 2016 @05:31PM (#11122060)
emacs is an IDE wrapped inside half an OS
Re:Go 1.6 is Released by AnimalMuppet on Wednesday February 17, 2016 @06:09PM (#11122304)
Don't forget the psychotherapist!
Re:Go 1.6 is Released by Cyph0n on Wednesday February 17, 2016 @05:45PM (#11122155)
Whoops, seems like you pissed some people off :D
Re:Go 1.6 is Released by znpy on Wednesday February 17, 2016 @06:35PM (#11122472)
I would like people that keep saying stupid stuff like this to try and compare the size of GNU Emacs to the size of, say, NetBeans, Eclipse or Visual Studio.

There is an enormous amount of stuff that "conventional" IDEs to and emacs does not do.

Consider NetBeans: there are a lot of people that use the NetBeans platform to create stuff that have nothing to do with programming, the very same way emacs users create modes that have nothing to do with programming: https://platform.netbeans.org/screenshots.html

Seriously guys, grow the fk up.

Re:Go 1.6 is Released by xiaoma on Wednesday February 17, 2016 @06:58PM (#11122595)
I'll set your less civil commentary to one side and simply ask this:

In what programming language could Emacs possibly not be feasible option for a seasoned Emacs user?

Re:Go 1.6 is Released by tokenizerrr on Thursday February 18, 2016 @05:26AM (#11124820)
Anything that there aren't plugins for. Same as for Netbeans, Eclipse, IntelliJ, and yes, even notepad. They're all just glorified text editors with plugin/scripting support.
Re:Go 1.6 is Released by duaneb on Wednesday February 17, 2016 @05:33PM (#11122074)
Green threads are awkward to express with the JVM threading/memory/io model. The runtime is massive (contrasting to the go model of statically linking deployment binaries). Some semantics (such as unsigned 64-bit integers) are difficult to express. Java's JNI is a PITA. I don't believe go's c bindings are much better, but the JVM definitely has its sore points.

Finally, the object-oriented nature of the JVM is sometimes a pain. This can be worked around, but there is something to be said for preferring the typing of Go.

Re:Go 1.6 is Released by alblue on Wednesday February 17, 2016 @06:18PM (#11122360)
FWIW there have been methods added to the Math class that perform math operations on unsigned integers, allowing a Java int to be treated as an unsigned int (cf long). In addition there have been other libraries such as JFFR and JNA that make it more sane to inter operate with C libraries in a much less painful way. There's even a future enhancement request to add this info a future release of Java.
Re:Go 1.6 is Released by duaneb on Wednesday February 17, 2016 @06:29PM (#11122427)
Yea, I wouldn't read my above list as a list of roadblocks. The JVM is a serious work horse and every year the list of complaints I have shrinks. Go certainly has its own problems as well, and the performance profiles that pain java are probably not going to fare much better under Go. The major win is probably goroutines.
Re:Go 1.6 is Released by kasey_junk on Wednesday February 17, 2016 @06:56PM (#11122583)
It's not even goroutines. Its the scheduler. I am continuously impressed by the amount of quasi-generic performance they can get out of something so simple. You can understand the entirety of the golang scheduler in minutes, and it works out of the box for most of my golang use cases.

That said, the JVM scheduling is pluggable, so I have options for a much bigger variety of use cases. With go if the default scheduler doesn't do what I want, I'm stuck.

Re:Go 1.6 is Released by merb on Thursday February 18, 2016 @03:20AM (#11124419)
Actually JNA is actually way better than Go or JNI. And if you are looking at Kotlin / Scala you won't find yourself inside the object-oriented pain. The JVM is actually not that bad.
Re:Go 1.6 is Released by fithisux on Thursday February 18, 2016 @03:59AM (#11124523)
I agree with you. But this code, does not compile

List<Integer>[] j=new List<Integer>[10];

and this is a a serious problem. If generics are correctly implemented, then it should compile.

Re:Go 1.6 is Released by Nutomic on Thursday February 18, 2016 @06:35PM (#11130295)
That's because List is an interface, not a class. FYI this works in Scala:

val j = List(1, 2, 3)

Re:Go 1.6 is Released by duaneb on Friday February 19, 2016 @02:41AM (#11132208)
It doesn't work for all scala interfaces, and when it is like that, it's often frustrating to find the underlying implementation.

But that's beside the point—OP was pointing out that you can't have generic allocation.

Re:Go 1.6 is Released by merb on Friday February 19, 2016 @08:36AM (#11133340)
However there are mostly alternatives for Java8 something like that: Collections.singletonList(1, 2, 3) which actually gives a List<Int> by the end it all comes down to syntactic sugar.
Re:Go 1.6 is Released by Manishearth on Wednesday February 17, 2016 @11:19PM (#11123695)
Re:Go 1.6 is Released by kasey_junk on Wednesday February 17, 2016 @05:39PM (#11122115)
There are less options in golang so its easier to get started or to jump into the middle of a project. For certain classes of problems the golang standard library is dramatically better than the java ones so you don't have to spend as much energy researching alternatives. It tends to perform well by default for web service and/or cli applications. Compared to java it is more terse (though not compared to some jvm alternate languages, but that is a whole different barrel of fish). The TLS stack in golang is finicky but I trust it. And gofmt. No really, the best part of golang is gofmt.

For those benefits you trade off vs the jvm a) abysmal tooling b) extremely primitive concurrency support c) a more primitive type system and d) a much smaller ecosystem.

I very much like golang for 2 classes of problem 1) http/s based microservices and 2) command line programs that are a touch more complex than bash. I would never choose golang for a system that I thought was going to have a high LoC count or had a complex domain to model.

Re:Go 1.6 is Released by cdelsolar on Thursday February 18, 2016 @01:24AM (#11124044)
abysmal tooling? ... extremely primitive concurrency support?? Are you talking about Go?
Re:Go 1.6 is Released by tptacek on Friday February 19, 2016 @10:34AM (#11134009)
No fully-functional debugger. Minimal instrumentation. No good code transformation or refactoring tools. No concurrent data structures.
Re:Go 1.6 is Released by mahmoudimus on Thursday February 18, 2016 @01:46AM (#11124112)
It is pretty much an undisputed fact that modern Java tooling beats mostly everything else out there for any other language. If you're coming from a more modern JVM background, yes, the first thing I have felt was that most plang tooling is abysmal ... relative to the JVM.
Re:Go 1.6 is Released by sinatra on Wednesday February 17, 2016 @05:26PM (#11122020)
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.
Re:Go 1.6 is Released by meddlepal on Wednesday February 17, 2016 @05:29PM (#11122044)
Okay, ditch Java if it's too verbose and adopt one of Kotlin, Groovy (w/ @CompileStatic) or Scala.
Re:Go 1.6 is Released by vorg on Wednesday February 17, 2016 @07:09PM (#11122656)
> 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 by pjmlp on Thursday February 18, 2016 @02:09AM (#11124175)
I would forget about Groovy and focus in Scala, Clojure, Kotlin instead.

Here in Germany you almost don't hear about Groovy anymore in any JUG event.

If it wasn't for Gradle and Android adopting Gradle, I bet we would hear even less about it.

Re:Go 1.6 is Released by jug on Thursday February 18, 2016 @04:54AM (#11124712)
I've heard complaints about Scala and binary compatibility often breaking, and it remains to be seen if Kotlin will even be successful enough to catch on.
Re:Go 1.6 is Released by jimbokun on Wednesday February 17, 2016 @06:46PM (#11122524)
Or Clojure.
Re:Go 1.6 is Released by thebaer on Wednesday February 17, 2016 @07:10PM (#11122661)
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 by prodigal_erik on Wednesday February 17, 2016 @07:20PM (#11122707)
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 by eggnet on Wednesday February 17, 2016 @07:48PM (#11122834)
Couldn't f check for g's errors?
Re:Go 1.6 is Released by anant on Wednesday February 17, 2016 @08:21PM (#11122976)
Sure it can, http://play.golang.org/p/T6WIcT_8q5 works just fine!
Re:Go 1.6 is Released by kasey_junk on Wednesday February 17, 2016 @08:17PM (#11122952)
No because you can't easily pass multiple return values as parameters. So annoying...
Re:Go 1.6 is Released by thebaer on Wednesday February 17, 2016 @08:22PM (#11122984)
Re:Go 1.6 is Released by kasey_junk on Wednesday February 17, 2016 @08:37PM (#11123042)
Oh my god...is that new? I swear I've tried that and it didn't work. You are my new hero.

[edit]

Though maybe I was thinking of adding parameters like https://play.golang.org/p/FKUMlQzCI5

In any case 'thebaer continues to be my hero.

Re:Go 1.6 is Released by tptacek on Wednesday February 17, 2016 @09:43PM (#11123302)
It's how html/template.Must works, isn't it?

We have a small library of functions for sweeping up error returns, and for collecting errors from multiple functions and checking them all at once. It helps a lot.

Golang is very much on to something with it's "errors are values" philosophy, but I'd be the first to acknowledge that it's not a fully baked philosophy. It is weird to discover fundamental things about how to structure basic code several years into writing in a language, but that happens somewhat regularly with Go.

Re:Go 1.6 is Released by kasey_junk on Wednesday February 17, 2016 @11:49PM (#11123795)
I could justify my ignorance by pointing out that for all the time I've spent using Go with http, I've not had occasion to use it for html. But, that would only mask my utter embarrassment at missing a core language feature, and worse yet something I complain about as a weakness of Go.

I'll be over here muttering to myself about monadic error values...don't mind me.

Re:Go 1.6 is Released by pa7ch on Wednesday February 17, 2016 @10:19PM (#11123462)
Would you, by chance, be able to link or share that error lib? I'd love to see more solutions for error handling to get a better grasp.
Re:Go 1.6 is Released by thebaer on Wednesday February 17, 2016 @09:21PM (#11123222)
Haha, I'll take it. Go forth and wield your new power! I'm not able to find anywhere official documenting it, but yeah I don't believe it's new.

Edit: prodigal_erik found it: https://golang.org/ref/spec#Calls

Re:Go 1.6 is Released by prodigal_erik on Wednesday February 17, 2016 @09:11PM (#11123193)
Thanks, I've never seen that used and didn't know they special-cased it until I found https://golang.org/ref/spec#Calls. I wonder why it's not more common...
Re:Go 1.6 is Released by thebaer on Wednesday February 17, 2016 @09:45PM (#11123308)
I'm sure there are good uses for it, but I personally haven't found one yet. I mostly use Go's multiple return values to also return errors -- and that's really like using checked exceptions in Java. So whether it's a try/catch or an if statement, you have to code for these things one way or another.
Re:Go 1.6 is Released by prodigal_erik on Thursday February 18, 2016 @10:51AM (#11126581)
A try-catch block can cover many complex statements and pushes the recovery code down where you aren't forced to continually reread it. Even if it's possible to write concise Go, nobody seems to be interested in trying, it always seems to become a mess that spends 2/3 of its time on errors.
Re:Go 1.6 is Released by thebaer on Friday February 19, 2016 @05:08PM (#11137033)
¯\_(ツ)_/¯ I'm personally a fan of the style, and like explicitly seeing where the fault points in functions are, rather than having to memorize what exceptions might get thrown by what. But it can definitely cover many complex situations.

That sucks to see people making a mess with error handling code, but there are examples of good uses out there. This [0] is one I quickly found.

[0] https://github.com/schachmat/wego/blob/master/we.go

Re:Go 1.6 is Released by bmurphy1976 on Wednesday February 17, 2016 @05:30PM (#11122056)
You don't have to "get" anything. If Java works for you, great!!

Go just works better for some of us, and that's all the justification we need.

Re:Go 1.6 is Released by Myrmornis on Wednesday February 17, 2016 @09:09PM (#11123187)
This type of comment is common, but specious. It sounds nice: "what works for you; great! this works for me" but it undermines a large category of important discussions: e.g. analyzing which, out of several competing discussions, is a better fit for large classes of people, or on average. In other words, I think this sort of comment strays too far in the direction of niceness, and tends to undermine simple, and desirable, notions of better vs. worse, etc.

TL;DR being nice and polite is over-rated. Some things are wrong and it is helpful to say so.

Re:Go 1.6 is Released by bmurphy1976 on Wednesday February 17, 2016 @09:21PM (#11123225)
> TL;DR being nice and polite is over-rated. Some things are wrong and it is helpful to say so.

And thus continues the never ending cycle of "You're wrong! No you're wrong!"

Re:Go 1.6 is Released by krylon on Thursday February 18, 2016 @06:21AM (#11125033)
The problem, I think, or at least part of the problem, is that it is hard to discuss the relative merits and problems of languages (frameworks, operating systems, ...) without feeling like somebody is trying to push his/her favorite piece of tech on somebody else.

If we discuss what e.g. Java does better than Go and vice versa for purely technical interest, there is little emotional pressure. But if I feel that somebody is trying to make me use Java (or Rust, or C++, or Visual Basic) over whatever I prefer and feel comfortable with, I get defensive. When people get defensive, they become unwilling to admit shortcoming in their preferred language/framework/OS/..., and so the debate devolves into "You're wrong! - No, you're wrong!" and namecalling.

Re:Go 1.6 is Released by bmurphy1976 on Thursday February 18, 2016 @06:40AM (#11125092)
I agree 100%. Also, a lot of good devs have poured their heart and soul into golang. They are a part of this community, like it or not. They find go news interesting, but I totally feel for them that every conversation feels like somebody kicking their sandcastle down because "theirs is better.". Same goes for nodejs. Same goes for PHP. Same goes for every language actually.

A person may have the best of intentions, but they need to realize that their words can have unintended consequences. There are places times and ways to properly discuss go's shortcomings, but there are also times when it is wildly inappropriate.

This is a good event for a very hardworking and capable part of oyr community. They deserve a little respect.

Re:Go 1.6 is Released by autoreleasepool on Thursday February 18, 2016 @09:33AM (#11125952)
I didn't even interpret that as politie. That's the kind of "polite" comment I would make if I thought you were being an an aggressive idiot and I didn't care to help you.

i.e. You think Andoid apps have the same revenue potential as iOS apps? That swell! Good for you buddy, whatever works for you is fine with me :) (Now go back to your cubicle and stop bothering me me.)

Re:Go 1.6 is Released by bmurphy1976 on Thursday February 18, 2016 @10:27AM (#11126394)
Well that's certainly not what I intended. Only further proves my point that our words can have unintended consequences.
Re:Go 1.6 is Released by vidoc on Wednesday February 17, 2016 @06:00PM (#11122253)
Java doesn't exactly check the box of a community that prefers the use of standard libraries for most work. Java community is all about Frameworks with a Big, MVC, F where you need only 200 lines of code and XML for an hello world :P
Re:Go 1.6 is Released by fixxer on Wednesday February 17, 2016 @06:06PM (#11122288)
Depends on the usecase. I deal with java in the hadoop/big data space and I constantly wonder how much better the ecosystem would have been had it been implemented in a solid systems language.

I also find the tooling for go vastly superior out of the box compared to what i end up using with java/Scala. XML?! Wtf?!

Re:Go 1.6 is Released by matt_wulfeck on Wednesday February 17, 2016 @06:44PM (#11122520)
If I may also chime in with one idea as to why someone might prefer Go: Java simply is not opinionated enough. Compare two developers Java code and it looks, flows, feels completely different.

Go forces people more into boxes and leaves a lot less up to discussion. This is annoying for the individual contributor, but I believe is a net plus for a team of contributors.

Re:Go 1.6 is Released by bsg75 on Wednesday February 17, 2016 @05:28PM (#11122037)
When different code needs different JVMs, it gets to be a pain. The Go advantage is a fat binary, no dependencies.
Re:Go 1.6 is Released by meddlepal on Wednesday February 17, 2016 @05:33PM (#11122069)
Embed the JRE then. You have to build packages for each platform you want to support, but that's no different than Go.

Besides that, different JVM's? Very rarely does code depend on a specific JRE unless we're talking between versions (say 7 vs. 8), but you would have the same problem in Go if significant language changes were made between releases.

Re:Go 1.6 is Released by twistedpair on Thursday February 18, 2016 @08:51AM (#11125680)
> When different code needs different JVMs

With the JVM you can use HotSpot, Dalvik, WebSphere, or OpenJDK. The JVM is just a spec. With Go, you've only got one runtime to choose from. That said, if you code to the JVM spec, then you don't care what implementation you run on.

Re:Go 1.6 is Released by loudmax on Thursday February 18, 2016 @09:19AM (#11125864)
> With Go, you've only got one runtime to choose from.

Since Go compiles to a binary, the concept of a runtime doesn't apply the same way it does for Java. You can compile a Go program with the Go project's compiler or with the GCC. The GCC Go compiler uses different optimizations and may produce faster binaries in some circumstances. Since the Go language is also a spec, other compilers may arise if there's a demand.

Re:Go 1.6 is Released by twistedpair on Thursday February 18, 2016 @09:55AM (#11126117)
Correct. With Java I've got at least 4 compilers (JDK's) to choose from.
Re:Go 1.6 is Released by omginternets on Thursday February 18, 2016 @04:01AM (#11124531)
Setting up a Java ecosystem is an enormous pain in the ass, and the language is anything but simple/minimal.

Much of the Go love comes from doing (almost) everything Java does with a lower cognitive load... and goroutines are really useful, too.

Re:Go 1.6 is Released by farawayea on Thursday February 18, 2016 @05:57AM (#11124955)
Oh, wait, Java 7 is no longer the one you need, you've got to use Java 8 because nobody uses 7 now. BAM, not so easy any more.
Re:Go 1.6 is Released by zphds on Wednesday February 17, 2016 @06:01PM (#11122261)
The JVM is awesome. Not a big fan of Java as a language. The 'less is more' is lost on most Java programmers I know of.

Golang fits in nicely in such cases. If I want the JVM, I rather build a clojure'ified uberjar.

Re:Go 1.6 is Released by aacanakin on Wednesday February 17, 2016 @06:24PM (#11122396)
Re:Go 1.6 is Released by geodel on Wednesday February 17, 2016 @05:25PM (#11121999)
I have hundreds of jar in my Java project. I am not even sure which one are used. How does Java handle this scenario?
Re:Go 1.6 is Released by Nullabillity on Wednesday February 17, 2016 @05:49PM (#11122175)
If you use Maven/Ivy then your transitive dependencies are automatically managed based on your direct dependencies. If you don't, or if that's not enough, use ProGuard to get rid of all the classes that you aren't actually using.
Re:Go 1.6 is Released by kasey_junk on Wednesday February 17, 2016 @05:41PM (#11122125)
Depends on your build system. In maven http://maven.apache.org/plugins/maven-dependency-plugin/ is the way to go.
Re:Go 1.6 is Released by fithisux on Thursday February 18, 2016 @03:53AM (#11124501)
You don't have too.
Re:Go 1.6 is Released by jbeja on Wednesday February 17, 2016 @06:06PM (#11122293)
Thank you, I don't get it neither. The delusion in this thread is hard to believe.
Re:Go 1.6 is Released by bigdubs on Wednesday February 17, 2016 @05:08PM (#11121857)
The more I dig into type coercion and interfaces the less I miss generics. Still not 100% there, but for day to day the things I used to use generics for have been replaced by alternates. I still wish I never had to write `interface{}` though.

Debugging absolutely needs work though.

Re:Go 1.6 is Released by fleshweasel on Wednesday February 17, 2016 @05:28PM (#11122039)
Is "alternates" a euphemism for "code duplication?"
Re:Go 1.6 is Released by Others on Wednesday February 17, 2016 @09:40PM (#11123294)
Or code generation?
Re:Go 1.6 is Released by iofj on Wednesday February 17, 2016 @10:16PM (#11123451)
I'm getting furstrated by code generation. I have a big project with has 3 files with (only) generated code. It's essentially repeating the same 15 lines about 50 times with slightly different types.

And yet I far prefer all of them over an interface{} solution. Works so much better. But the files are just so ugly, and changing them is rather hard.

Worst of it all, I've been thinking about generating other pieces of the code. For instance, I hate the http handlers and structure surrounding them being the same thing all the time.

Http handlers = decode and basic argument validation, then authentication and CSRF protection, and then conversion (to be done ad-hoc because no types in http parameters), some using strconv, some using json encoding, all with "error handling" (essentially if error then bailout 502), followed by calling the actual method. All of them are the same (save for small bugs due to me not paying attention).

I'm thinking of replacing it with generated code.

Re:Go 1.6 is Released by iends on Wednesday February 17, 2016 @10:25PM (#11123486)
Have you looked at http://goa.design/ which kinda describes what you are talking about a bit (for REST apis).
Re:Go 1.6 is Released by grey-area on Thursday February 18, 2016 @07:48AM (#11125342)
What are you using generated code with lots of types for out of interest? I haven't felt the need as yet but would like to try it out.

Re handlers, you really don't have to use the http handler. I use one which accepts a context, and returns an error (for rendering), which simplifies the boilerplate somewhat as errors are rendered by the router. I'd look into using your own interfaces before generating standard http handlers.

The other thing to bear in mind is that if you try to make things all implicit rather than explicit in order to avoid repetition, it's very easy to be unaware of what's happening behind the scenes (auto-auth, or auto-render as in rails), and get stuck when you want to do something off the beaten path. I rather like Go's more verbose but very explicit style. It's a trade-off.

Auth, CSRF, parameter parsing should definitely be in a separate pkg you're using, not repeated each time IMO, so there should be minimal boilerplate for those.

Using text template is a really nice way to generate http handlers if you typically set up resources in a similar way, so I'd definitely recommend trying that out. I haven't looked into go generate as that came out after I started this approach.

The approach I take is to generate actions with all the normal code in them as scaffold (for CRUD actions) - so for each one auth, then setup, then business logic, then render, and then edit those as necessary, as often as an app grows each action diverges from the standard (say it doesn't do auth, or processes parameters differently etc). This is easy, explicit, and very clear when returning to code after 6 months at the cost of some verbosity.

Re:Go 1.6 is Released by iofj on Thursday February 18, 2016 @12:45PM (#11127638)
> What are you using generated code with lots of types for out of interest

Firstly, for data access methods (think load struct type X from offline storage). It's like gobs or encoding/*, but it blasts those away when it comes to speed.

Secondly, for searching through data (given a list of struct type X, and some number of indexes of the data (essentially listing what the sorting order is according to one of the fields), search for the record that satisfies condition X, fast.

It's very handy that after generation, my vim editor will actually autocomplete all the available methods, and adding an extra method or struct to either the datastore or the in-memory searchable index is adding a line to a file and pressing a shortcut.

And the one I've started to write, given function X with named input params a,b,c and named output params d, e and f, accept an http request extracting these parameters, validating authenticated user, check CSRF, all with appropriate error handling, call function X with the parsed parameters, encode it's outputs as a json struct and return the response. Well, I'm working on this one, I guess, so this one might still change. Maybe also write a javascript interface that calls these methods to a typescript file.

And they're writing tests for a lot of these autogenerated methods. Because we do code reviews and they insist on testable code. I think this is unnecessary, but I've been seriously outvoted on this issue (having tests for one or two of the autogenerated methods, leaving the rest untested until you actually run into a problem is my preferred option). I would object, and I have. Oh well, my total lines of code written is through the roof, well on it's way to the moon, far exceeding people who've been writing code for more than double the amount of time I've been here. And it's useful code, and "useful" tests, so ...

> The approach I take is to generate actions with all the normal code in them as scaffold (for CRUD actions) - so for each one auth, then setup, then business logic,

Modifying autogenerated code is tricky and dangerous. You should never do it. It takes discipline, but you should always change the generators, never the code.

Re:Go 1.6 is Released by grey-area on Thursday February 18, 2016 @01:40PM (#11128104)
If it has been generated as boilerplate (e.g. To build out an API) with the explicit purpose of being extended, I think it's fine. It just saves a lot of typing. It's only inappropriate if you'd be better to adjust the template, not the code generated; if you're adding unique code (which you should be), it's fine IMO.
Re:Go 1.6 is Released by chc on Wednesday February 17, 2016 @06:30PM (#11122439)
What is an alternate? I've never heard of that and Googling tells me nothing.
Re:Go 1.6 is Released by itp on Wednesday February 17, 2016 @06:40PM (#11122498)
I'm guessing that means something more like "alternatives," but that's just a guess.
Re:Go 1.6 is Released by bigdubs on Wednesday February 17, 2016 @07:22PM (#11122715)
s/alternates/substitutes/g

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

Re:Go 1.6 is Released by xyproto on Wednesday February 17, 2016 @05:17PM (#11121930)
Even with the delve debugger?
Re:Go 1.6 is Released by CSDude on Wednesday February 17, 2016 @05:25PM (#11122008)
Despite being a great work, delve is slow and sometimes might skip some of my breakpoints and have problems in debugging goroutines.
Re:Go 1.6 is Released by icholy on Wednesday February 17, 2016 @09:05PM (#11123162)
Yeah, it can get pretty confusing. It would nice if there was a way to define a breakpoint that only gets tripped by a specific goroutine.
Re:Go 1.6 is Released by jug on Thursday February 18, 2016 @04:46AM (#11124684)
Go feels similar to where Microsoft eventually wants to be with .NET Core and their native compilation.

Other than that competitor, I don't think Go has too many others in the same niche. Maybe D? I love the combo of native code + high level language + single binary in a language that also tackles parallelism.

It's as if the Go language designers took a good hard look at Python and went "This is what's wrong with it", taking its greatest weaknesses like dependencies/packaging and the GIL, turning these around 180 degrees, instead becoming main advantages of their new language. Of course, it's not an interpreted language so the comparison isn't perfect, but Go ticks a lot of boxes for me as well that Python perhaps never will due to design.

Re:Go 1.6 is Released by coldtea on Thursday February 18, 2016 @06:02AM (#11124975)
>Go feels similar to where Microsoft eventually wants to be with .NET Core and their native compilation.

Only in that it will end in a native binary.

In any other sense Go is worlds behind.

Re:Go 1.6 is Released by jernfrost on Thursday February 18, 2016 @10:40AM (#11126494)
In bloat, yes ;-)
Re:Go 1.6 is Released by coldtea on Thursday February 18, 2016 @05:53PM (#11130020)
There is no bloat at that level -- just people with bigger needs than other people.
Re:Go 1.6 is Released by _pmf_ on Thursday February 18, 2016 @03:28AM (#11124442)
> C derived

What is that even supposed to mean? The semantics and memory model are nothing like C and the syntax even less so.

> generates a single

Just link against static libraries; it's literally a single switch.

> supports concurrency very well

Better than C; much, much worse than C# and I'd argue even worse than Java with j.u.concurrent (want channels? use j.u.concurrent.BlockingLinkedQueue)

Re:Go 1.6 is Released by pklausler on Wednesday February 17, 2016 @05:08PM (#11121861)
"is opinionated"? What does that mean in the context of a computer programming language?
Re:Go 1.6 is Released by BHSPitMonkey on Wednesday February 17, 2016 @05:40PM (#11122124)
One superficial example: There is only one correct formatting of a particular Go source file, so you never have to debate with someone (or yourself) whether to use newlines here or there, or to place that opening brace on the next line, or to put spaces around your assignment operator in that function call, etc. The toolchain formats it the "correct" way and that's it.
Re:Go 1.6 is Released by sinatra on Wednesday February 17, 2016 @05:23PM (#11121979)
In addition to what melted said, Go has strong opinions about things (we want to keep language simple, we want to encourage writing maintainable code, we want fast compilation, etc) and it's okay if those opinions mean it can't please some critics. For example, Go isn't against generics. They just don't know (yet) how to do it while keeping language simple and compilation fast.
Re:Go 1.6 is Released by melted on Wednesday February 17, 2016 @05:15PM (#11121911)
Doesn't attempt to please everyone. Case in point: no OOP or inheritance and no FP. Minimal syntactic sugar.
Re:Go 1.6 is Released by zik on Wednesday February 17, 2016 @06:36PM (#11122476)
Nitpick - Go is very much an OO language. Almost everything is done using objects. It has a different way of handling inheritance however - it makes a different decision in the "Composition over inheritance" debate.

https://en.wikipedia.org/wiki/Composition_over_inheritance

Re:Go 1.6 is Released by iends on Wednesday February 17, 2016 @10:33PM (#11123521)
I've found that there is no real standard definition of what OOP is and people get very angry when you say Go is OOP but it doesn't have inheritance. YMMV though.
Re:Go 1.6 is Released by masklinn on Thursday February 18, 2016 @06:54AM (#11125129)
As far as Alan Kay is concerned (always a pretty good yardstick)

> OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late binding of all things.

Re:Go 1.6 is Released by redtuesday on Thursday February 18, 2016 @10:09AM (#11126235)
Yeah, I like this posting from him http://c2.com/cgi/wiki?AlanKayOnMessaging
Re:Go 1.6 is Released by fithisux on Thursday February 18, 2016 @04:01AM (#11124530)
Golang is the best. And this is a really amazing thing.

Golang does Pseudo OO like Motif. The added value is the composition which is amazing.

Re:Go 1.6 is Released by zdkl on Wednesday February 17, 2016 @05:23PM (#11121982)
Not to start a flamewar or anything, but what about clojure (or any lisp for that matter, I just like the CLJ ecosystem) doesn't vibe with your 'minimal syntactic sugar' and other requirements?
Re:Go 1.6 is Released by melted on Wednesday February 17, 2016 @05:38PM (#11122108)
Oh, don't mistake my comment for favorable opinion. I only wrote a few hundred lines of Go in my life. It worked well for the particular problem I was solving, but I'm really more of a C/C++ guy.

The problem with lisps is that you need to know lisp, and relatively few people do. It also requires a different approach to program design. It may or may not be a better approach, but the fact is, that's not what most people are trained for.

In contrast, go is imperative through and through, and its syntax is similar enough to C that people find it easy to adapt to it.

Re:Go 1.6 is Released by coliveira on Wednesday February 17, 2016 @09:23PM (#11123233)
The little secret of Lisp is that you can use it pretty much as an imperative language, even though it also enables functional programming. The main barrier is that Lisp is taught as a functional programming language, and many believe that this is the only way you should use it.
Re:Go 1.6 is Released by woah on Wednesday February 17, 2016 @06:10PM (#11122313)
Go tends to emphasize the simple, imperative way to get a computational thing done. It goes so far as to never hide a for loop from you. I'm not experienced with lisp, but from reading sicp, it seems to be a paradigm built on creating stacked layers of syntactical sugar (dsls).
Re:Go 1.6 is Released by ant6n on Wednesday February 17, 2016 @07:01PM (#11122609)
No floats?
Re:Go 1.6 is Released by melted on Wednesday February 17, 2016 @07:06PM (#11122642)
No functional programming, or language features borrowed from there.
Re:Go 1.6 is Released by pklausler on Wednesday February 17, 2016 @09:40PM (#11123293)
Which is kind of a shame, since many of those concepts would complement the strengths of Go quite nicely -- i.e., a pure goroutine that had no visible side effects apart from channel activity would help enable automatic remote execution in a cluster.
Re:Go 1.6 is Released by golergka on Wednesday February 17, 2016 @05:13PM (#11121896)
One way to do things, not ten.

Opposite example: implementations of OOP in Lisp and JS.

Re:Go 1.6 is Released by pklausler on Wednesday February 17, 2016 @05:16PM (#11121924)
I'm not sure that I understand your definition of the term "opinionated". Is Haskell opinionated? Is Fortran?
Re:Go 1.6 is Released by jgalt212 on Wednesday February 17, 2016 @05:45PM (#11122159)
I take opinionated to mean one obvious way to do things. Python and Go are opinionated. Ruby and Perl are not. But RoR is very opinionated.
Re:Go 1.6 is Released by antod on Wednesday February 17, 2016 @06:41PM (#11122503)
> I take opinionated to mean one obvious way to do things. Python and Go are opinionated.

IMO Python wants to be opinionated (in your 'one obvious way' definition), and it actually was 10-15yrs ago when Perl was the comparison, but ongoing progress has eroded that a lot - especially across the stdlib :)

But yeah Go and RoR are probably two of the most opinionated technologies I can think of.

Re:Go 1.6 is Released by TelmoMenezes on Wednesday February 17, 2016 @05:21PM (#11121964)
Take a look at a curated list of opinionated ecosystems. Hilariously, they contain some of the most popular use-cases going forward, and the price point is good.

Genuine question, why all the negativity?

Re:Go 1.6 is Released by pklausler on Wednesday February 17, 2016 @05:49PM (#11122180)
I'm not being negative. I was confused by the unfamiliar anthropomorphic terminology being applied to an artifact. I take away a sense that "opinionated" seems to be an idiom popular within the golang community for a sense of principled design along the lines of Smalltalk's message passing, Lisp's homoiconicity, Haskell's purity from side effects, and so on.
Re:Go 1.6 is Released by TelmoMenezes on Wednesday February 17, 2016 @07:03PM (#11122624)
> I'm not being negative.

I was. My previous message is an arbitrary combination of HN clichés, of which "opinionated" is one. It's gibberish, devoid of content but written in a fashionable way. It got zero down-votes so far. Maybe something to think about.

Re:Go 1.6 is Released by pklausler on Wednesday February 17, 2016 @09:35PM (#11123282)
I felt like I owed the world a response to your question even though the first sentence made no sense to me whatsoever. I guess that "opinionated" makes no less sense as a characterization of an artifact than "ambitious" or "stupid" does, so I'm going to have to learn to live with it, but it's one of those things like "performant" or "impactful" that will make me cringe if I ever catch myself saying it. Anyway, thanks for the response, my comrade-in-downvotes.
Re:Go 1.6 is Released by libria on Wednesday February 17, 2016 @11:02PM (#11123640)
"opinionated" is just shorthand for "the language authors held strong opinions when designing". There's no anthropomorphism so hopefully that takes away the confusion.
Re:Go 1.6 is Released by voidlogic on Wednesday February 17, 2016 @06:12PM (#11122327)
>so is debugging

Have you used delve? https://github.com/derekparker/delve

Re:Go 1.6 is Released by stirner on Wednesday February 17, 2016 @09:01PM (#11123141)
This is very similar to my experience. There are some very obvious flaws that have been analyzed to death, but I find myself returning to Go despite them. The native binaries and extremely simple cross-compilation are the features that I really miss with other languages.
Re:Go 1.6 is Released by zelcon5 on Friday February 19, 2016 @04:49PM (#11136910)
> generics

Go makes it easy for third party applications to parse the language,so generics are possible with pre-processing/codegen; e.g., https://clipperhouse.github.io/gen/

Re:Go 1.6 is Released by fpoling on Thursday February 18, 2016 @02:18AM (#11124204)
Go tools support code generators. So just use those for advanced data structures. As auto-generated it can support more features than even an advanced generics could provide.

For me the big minus of Go is that it is memory unsafe language when it runs with GOMAXPROCS>1 (default since 1.5). It is not that bad like in C as opportunities for bugs are not common, still this is an issue as consequences of such bugs is arbitrary code execution.

Another problem is lack of union types leading to poor code practice when those are emulated through (foo, err) or similar return types.

Re:Go 1.6 is Released by pcwalton on Thursday February 18, 2016 @01:47PM (#11128182)
> As auto-generated it can support more features than even an advanced generics could provide.

No, it can't. There are patterns that no monomorphization strategy (including code generation) can express. For example:

    func MakeList<T>(x T) List<T> {
        ...
    }

    func Foo<T>(x T) {
        if ... {
            Foo(MakeList(x))
        }
    }
This is a contrived example, but this shows up from time to time in functional data structures.
Re:Go 1.6 is Released by fpoling on Thursday February 18, 2016 @03:37PM (#11129114)
Code generation can do type erasure starting, for example from List<List<SomeConcreteType>>.
Re:Go 1.6 is Released by fithisux on Thursday February 18, 2016 @03:52AM (#11124499)
Golang is my favorite. Started on 2010 and use it without hesitation.
Re:Go 1.6 is Released by Shorel on Thursday February 18, 2016 @04:47PM (#11129578)
D lang seems to be another obvious candidate here.