News for hackers. Stuff that matters.
Re:Program your next server in Go by yanilkr on Tuesday June 07, 2016 @02:09PM (#11856376)
I once tried to convince an enterprise java developer to give golang a try. The guy passionately hated it and the reasons were very very petty. The other younger engineers who did not have prior bias loved golang and they were productive so fast.

The person truly had a java supremacy attitude that was very difficult to deal with. Golang is a kind of shift in thinking that you have to first unlearn your existing ways of thinking and then you will have a place for it. Some people are not willing to take that leap of faith unfortunately.

Re:Program your next server in Go by kmiroslav on Tuesday June 07, 2016 @02:53PM (#11856801)
> you have to first unlearn your existing ways of thinking and then you will have a place for it.

Unlearning is not always acceptable, especially when you have to unlearn sound and proven practices, which Go often requires to do.

I think it really depends where you're coming from: people coming from dynamically typed languages like Python and Ruby are quite happy with Go since it's a small ramp up on the type ladder, but anyone who's used to static types and generics will usually see Go as a step back and refuse to take that step (for good reasons in my opinion).

To draw an analogy, imagine a Go developer is being asked to switch to Python and in order to convince them, you tell them they just need to unlearn a few things. To them, you are asking them to give up types and other practices that makes their code more robust, so it's not an acceptable argument.

Re:Program your next server in Go by weberc2 on Tuesday June 07, 2016 @04:38PM (#11857595)
> especially when you have to unlearn sound and proven practices, which Go often requires to do.

Such as? I'm not really sure what "sound and proven practices" a Java developer would have to "unlearn" to adopt Go. Most of the differences between Go and Java amount to removing features that 20 years of Java experience have proved to be unsound or unnecessary (inheritance and exceptions, for example). From a feature perspective, Go is mostly a subset of Java. The features Go adds are mostly related to concurrency, and I've not heard anyone say Java does concurrency better than Go.

Re:Program your next server in Go by jaegerpicker on Tuesday June 07, 2016 @08:40PM (#11859205)
Maybe if you are taking Java the language in isolation but if you consider the JVM ecosystem than I'll absolutely say the JVM does concurrency better. While the JVM offers something like quasar (http://docs.paralleluniverse.co/quasar/) which can match go's goroutine and channels plus an actor interface or the really excellent Akka (http://akka.io/) for a non blocking async actor framework. Offering a lot more choice than golang's single concurrency pattern. I've written major applications with both go and Akka using Java (and scala) and while both were successful stable and performant it's hard to argue with the JVM's concurrency story.
Re:Program your next server in Go by Matthias247 on Wednesday June 08, 2016 @08:50AM (#11861864)
Java for sure has good tools for concurrency, and you listed some of the very interesting choices!

However the flexible nature of Java concurrency also has the drawback that you might need to integrate different libraries that utilize different concurrency solutions (blocking threads, actors, non-blocking eventloops) with each other. This can end up in a lot more effort than if you try to use multiple libraries in an ecosystem with a single opinionated concurrency solution (like Go for blocking IO or node for pure nonblocking IO).

The weakest ecosystem regarding this is imho C++, where most concurrency/IO solutions only work well if you don't try to also use other solutions in parallel (e.g. QT plus glib plus boost asio plus libuv...).

Re:Program your next server in Go by eropple on Tuesday June 07, 2016 @05:43PM (#11858166)
I'll say that Java doesn't do currency worse than Go, that's for sure. It has all of the primitives in whatever arrangement you want to put them (Javaflow and now Coroutines if you want go-I'm-sorry-coroutines, native threads if you want those, and Go channels can be implemented in maybe two dozen lines), more flexible, battle-tested abstractions (such as Akka offering you an asynchronous, message-passing actor model, which could be written in Go but seems in practice to be passed up in favor of channels), and tooling around these that I find to be head-and-shoulders better than anything Go has (like multi-threaded debugging).

I've basically (willingly or unwillingly) turned into a Ruby person over the last few years, as neither Go nor the JVM really have a ton to offer me right now, but I don't think a fair comparison of concurrency-related stuff, either in terms of tooling, libraries, or the language itself (I'd give Go this, except that you can't build an unbounded buffered channel and at that point the use of channels for what I write rapidly approaches zero), is nearly as clear as you assert.

Re:Program your next server in Go by colin_mccabe on Wednesday June 08, 2016 @02:58AM (#11860512)
Java's concurrency story is weak overall. Nearly all code still uses the old-style "synchronized" blocks, rather than ReentrantLock. This shouldn't be a big surprise, considering that ReentrantLock was only introduced recently. With synchronized blocks, you don't have any way of releasing the lock other than by exiting the block, which leads to some very contorted-looking code.

The fact that you can synchronize on literally any object means that your object lock is effectively part of your public API. Some other piece of code can easily grab your object, synchronize on it, and then start calling your methods, assuming that this will be atomic. And if you change to use a different lock later, it will break.

Sure you could use BlockingQueue to get some of the benefits of Go channels. But the standard library and pretty much any software you'll interact with were written before BlockingQueue existed, so they won't make use of it. You will have to fight your lonely crusade to use message passing on your own. Which in practice means that you won't be using message passing, just plain old mutexes and volatiles.

In Go, all code runs in goroutines which get multiplexed to kernel threads. In Java, nearly all code is blocking and uses an entire kernel thread. Sure you can use NIO to write an event loop-- just as long as you're careful to never, ever call a blocking function. But nearly every interesting function in Java can block. Including the DNS lookup functions Java provides.

Re:Program your next server in Go by kmiroslav on Wednesday June 08, 2016 @08:44AM (#11861823)
> The fact that you can synchronize on literally any object means that your object lock is effectively part of your public API

I'd argue that the fact you can lock on any object is a strength. These days, hardly any Java developer will use synchronized on methods and instead prefer the idiom:

    public class A {
        private Object lock = "";

        public void foo() {
            synchronized(lock) {
            }
        }
This allows Java code to be extremely granular in what gets locked, which has enabled very powerful multithreaded constructs and libraries such as ForkJoinPool and many others described in the Java Concurrency In Practice book.
Re:Program your next server in Go by eropple on Wednesday June 08, 2016 @11:06AM (#11862703)
So this doesn't map to anything I see in the JVM. It's super interesting that you say it (and I want to stress I'm not calling you a liar or anything, it's just different experiences). Personally? I haven't used synchronized blocks since college (so ~2010 or so). I've been using NIO about that time. I don't feel like I'm swimming upstream using it.
Re:Program your next server in Go by weberc2 on Wednesday June 08, 2016 @12:04AM (#11859930)
Debugging is definitely a valid counter-point. Go's debugging story is rapidly evolving, but it's not particularly friendly or settled at this point.

Goroutines are subtly different than coroutines, mostly in that goroutines are not bound to the OS thread they're created on, and also that they don't need to be explicitly yielded--any I/O or lock-blocking (including reading or writing on channels) are potential interrupt points. Channels are probably also less easy than you might think, particularly the nuances around Go's `select` keyword.

I'm not sure where exactly Java stands on all of this. I've heard that the Quasar library comes close to bringing Go's concurrency tools to the JVM, but it's not widely used and any non-Quasar I/O is likely going to block your OS thread. At any rate, while I agree that Java can theoretically come very close to matching Go's concurrency story, it falls very short in practice.

> you can't build an unbounded buffered channel and at that point the use of channels for what I write rapidly approaches zero

If you're using Ruby, I'm guessing you don't need thread safety, so you probably just want a slice.

> I don't think a fair comparison of concurrency-related stuff ... is nearly as clear as you assert

Like I said, I think libraries like Quasar have a lot of potential, but they're not widely used. If it was the de-facto solution for concurrency in Java, I would agree that "concurrency in Java is no worse than in Go" (and I would have to, since Quasar's stated purpose is to bring Go-like concurrency to Java).

Re:Program your next server in Go by eropple on Wednesday June 08, 2016 @11:08AM (#11862721)
> goroutines are not bound to the OS thread they're created on

Neither is a coroutine in Java using the Coroutines library (Javaflow used thread-locals, but Coroutines doesn't), or a Lua-based coroutine...I'm not sure what you're driving at here?

> If you're using Ruby

Sorry, this was inartfully said. If I am using the JVM, i.e. I want to be using something where I can be bombing around on multiple threads etc., I'm probably going to want my inter-thread channels to be unbounded. BlockingQueues in Java give you that; Go channels don't.

Re:Program your next server in Go by weberc2 on Wednesday June 08, 2016 @01:03PM (#11863723)
> Neither is a coroutine in Java using the Coroutines library (Javaflow used thread-locals, but Coroutines doesn't), or a Lua-based coroutine...I'm not sure what you're driving at here?

I'm not familiar with Coroutines or Lua-based coroutines; coroutines are almost always bound to the thread on which they're created, I was pointing out that this is a primary difference between goroutines and coroutines--goroutines are M:N threads.

> BlockingQueues in Java give you that; Go channels don't.

Go channels aren't meant for this purpose; they're synchronization primitives, not dynamic data structures. You can easily build a BlockingQueue in Go.

Re:Program your next server in Go by eropple on Wednesday June 08, 2016 @02:21PM (#11864351)
> coroutines are almost always bound to the thread on which they're created

Can you provide a cite for this? I'm not saying you're wrong, just that I've never heard this assertion before (and I have been doing really stupid stuff with coroutines for way too long). My understanding of a coroutine is just that it's just a cooperatively yielding function where a yield returns a continuation for later resumption.

Re:Program your next server in Go by weberc2 on Thursday June 09, 2016 @02:23PM (#11871284)
I don't have a cite for this; almost no coroutine implementations are multiplexed across threads. I spent quite a while Googling around, and I wasn't able to come across any thing. The stuff that I did come across (without searching for 'goroutine') were comparisons of coroutines and goroutines in which one of the defining characteristics seem to be the ability (or inability, in the case of coroutines) to be multiplexed across OS threads.

In general, the term "coroutine" has come to be pretty watered down.

Re:Program your next server in Go by kasey_junk on Tuesday June 07, 2016 @09:59PM (#11859506)
Java absolutely does concurrency better than go. The only place the conversation is even close is the Golang scheduler.

But as far as abstractions, collections, libraries, profiling, error handling, etc the Golang concurrency options are worse than Java's.

I've come to the opinion that concurrency is a weakness of go, not a strength.

Re:Program your next server in Go by jonathankoren on Tuesday June 07, 2016 @05:35PM (#11858091)
> ost of the differences between Go and Java amount to removing features that 20 years of Java experience have proved to be unsound or unnecessary (inheritance and exceptions, for example).

We'll just have to disagree about this point.

Re:Program your next server in Go by yanilkr on Tuesday June 07, 2016 @03:02PM (#11856875)
The good programmers I know are not attached to their tools. They prefer to use the right tool for the job. Many other programmers want to solve the problems using tools they know. There is nothing wrong with that. A company with good programmers who could do similar things more efficiently will add to competitive advantage.
Re:Program your next server in Go by kmiroslav on Tuesday June 07, 2016 @03:46PM (#11857211)
Again, we all agree about the motto.

If you need to screw something and you have a choice between

1. A screwdriver

2. Electric drill A

3. Electric drill B

you will certainly look funny at someone considering the screwdriver over the alternatives.

Someone who automatically narrows this choice between the two electric drills is not "attached to their tools", as you say. They are just picking the better tool.

Re:Program your next server in Go by vertex-four on Tuesday June 07, 2016 @05:28PM (#11858033)
So as someone who's written some Go, I'd argue that Go is the screwdriver - it's one of the only modern languages which explicitly refuses to tackle the error handling problem, which has resulted in some of my code being more about the failure case than the success case.

Of course, others will disagree - fine. But to argue that e.g. Java is definitely the screwdriver is a subjective judgement.

Re:Program your next server in Go by eropple on Tuesday June 07, 2016 @05:46PM (#11858193)
To add to this: Go's inexpressivity (hi, generics!) makes common patterns that I see in Kotlin, Java, and Scala (as well as Rust, off-JVM) makes error handling a complete bear, to the point where my eyebrows are really raised at vertex-four being downvoted for this.

The use of please-check-this error conditions instead of something like a Try<T, E> (Result<V, E> in Rust) and an inability to just map over these as 0- or 1-element collections is such a huge pain, and it certainly does matter when you're piling up multiple error-handling cases. Even more when you'd otherwise use Scala's `recover` to get back on a happy path. Go's inexpressivity directly impinges on one's ability to get things done.

(Food for thought: forgetting to handle the error case from Rust's Result<V, E> is a compiler error. Is "if err != nil" really that good an idea in such a universe?)

Re:Program your next server in Go by chrismorgan on Tuesday June 07, 2016 @07:49PM (#11858989)
Not using a Result is a warning, not an error: https://is.gd/U43rdG
Re:Program your next server in Go by eropple on Tuesday June 07, 2016 @08:00PM (#11859037)
Sorry, yes (I compile with warnings as errors), good catch.
Re:Program your next server in Go by mratzloff on Wednesday June 08, 2016 @01:45AM (#11860272)
You must explicitly ignore errors in Go.

result, _ := someFunc()

Re:Program your next server in Go by kasey_junk on Wednesday June 08, 2016 @07:14AM (#11861425)
Not if they are the only return value. You should use an analysis tool to avoid this but nothing about the language requires it.
Re:Program your next server in Go by mratzloff on Thursday June 09, 2016 @10:40AM (#11869650)
Ah, you are right.
Re:Program your next server in Go by ThrustVectoring on Tuesday June 07, 2016 @10:20PM (#11859566)
I'd use a different analogy - there are definitely circumstance where you'd want the screwdriver over the electric drill. Screwdrivers can't run out of batteries, are lighter weight, and give you more feedback and control while being used. If I was going to be in a crawlspace for three hours doing wiring and knew that I'd need to drive in a screw at some point, I'd rather have the screwdriver on me than lug around or go back for the drill.
Re:Program your next server in Go by johndifool on Wednesday June 08, 2016 @06:19AM (#11861204)
Nothing wrong using a screwdriver when you do cabinet work as opposed to using electric drills for carpentry. A manual and more precise work calls for a different tool. Electric drills will strip the head of the screws over time. And every tiem I need to use an electric drill, its battery needs to be charged first, sending me back to the manual screwdriver.
Re:Program your next server in Go by takeda on Tuesday June 07, 2016 @03:55PM (#11857286)
IMO switching an enterprise developer from language such as Java to Go is like asking someone who has very developed vocabulary in English to try Toki Pona[1].

Yes, it is simple, and you can learn it fast, you also can also communicate with it, but you will often have to fight with the language to express what you want. That person generally won't be satisfied.

Go's shortcomings wouldn't be so bad if in exchange, the language would ensure that your code is less prone to errors, but that doesn't seem to be true. In fact Go programs from my experience appear to be slightly below average in terms of stability and robustness compared to other statically typed languages.

[1] https://en.wikipedia.org/wiki/Toki_Pona

Re:Program your next server in Go by weberc2 on Tuesday June 07, 2016 @04:48PM (#11857676)
Your analogy seems weak at best. Go is mostly a subset of Java, so there's almost no difficulty in a Java developer learning Go. A Java developer can immediately read 90% of Go programs, and within a couple of hours, he can write real, interesting programs. I'm not sure that a good analogy could be made incorporating English, nor do I think there's value in doing so.
Re:Program your next server in Go by takeda on Tuesday June 07, 2016 @05:24PM (#11857999)
I don't think you understood my analogy. Go supposed to be Toki Pona.

I'm saying that once you are used to a language that's more powerful you feel constrained.

I know many languages and some bring interesting things to the table, go doesn't really deliver (at least based on the hype). The concurrency supposed to be the killer feature, but it is limited to specific cases.

BTW: The Go is not subset of Java if anything it's very similar to Algol-68 (http://cowlark.com/2009-11-15-go/)

Re:Program your next server in Go by weberc2 on Tuesday June 07, 2016 @05:42PM (#11858155)
> I'm saying that once you are used to a language that's more powerful you feel constrained.

I did misunderstand your point, though I don't find this one more compelling. While Java has more features than Go, the only one I would consider to be "more powerful" would be generics.

> The concurrency supposed to be the killer feature, but it is limited to specific cases.

How do you figure? To which specific cases is it limited? How is Java better?

> BTW: The Go is not subset of Java if anything it's very similar to Algol-68

My argument wasn't that Go is most similar to Java; only that Go's featureset is almost a strict subset of Java's. Go gives you tighter control over memory and a better concurrency story, but most of the rest of it looks the same.

Re:Program your next server in Go by yanilkr on Tuesday June 07, 2016 @04:13PM (#11857416)
Your opinion on this is couple of standard deviations away from popular one. Is there a specific example where a program written in golang lacked compared to other statically typed languages?
Re:Program your next server in Go by takeda on Tuesday June 07, 2016 @05:07PM (#11857851)
Well, it's small sample but I used things like InfluxDB, Consul, there were some command line tools (that I no longer remember) as well.
Re:Program your next server in Go by kasey_junk on Tuesday June 07, 2016 @02:12PM (#11856410)
I program go full time and have for a couple of years. My biggest complaint about it is that there is some magical shift in thinking required to use it.

The only shift I've found is moving on when the Golang way isn't as good as other tools you are used to. Because the ecosystem & language really are not on par with other environments I've worked in.

Re:Program your next server in Go by eropple on Tuesday June 07, 2016 @02:45PM (#11856728)
Agreed--the culture always strikes me as a weird one and, having just had to dip back into Go for a project recently, your observations ring really true. I feel like there is a strong sense of epistemic closure around Go advocates (as separate from the Go team, I've had interesting and good conversations with a couple) that lead to contortions like "magical shifts of thinking" rather than an acceptance of problems and a desire to fix them. The advantages of a tool that is unmistakably disadvantaged in some areas (like Go's not-great ecosystem and relatively weak expressiveness compared to many of its competitors) may outweigh those disadvantages, but the amount of aggressive you-don't-need-thatting and the insistence that the emperor has the finest clothes is...weird.
Re:Program your next server in Go by kmiroslav on Tuesday June 07, 2016 @02:51PM (#11856774)
That's odd. I think the absence of generics in Go is a reasonable answer for a JVM developer to justify they are not interested. No need to go petty.
Re:Program your next server in Go by yanilkr on Tuesday June 07, 2016 @02:56PM (#11856818)
This feeds into language supremacy mindset. There is no universal best language nor there will ever be the one.

Right tool for the job is a better flexible mindset. If you are a master painter, you could paint something amazing with anything you have got. Same thing applies to programmers.

Re:Program your next server in Go by kmiroslav on Tuesday June 07, 2016 @02:58PM (#11856844)
> There is no universal best language nor there will ever be the one.

I never made that claim, I just emphasized the widely accepted fact that having types is better than not having them.

To a Java developer, Go feels like the Java of ten years ago in that respect, so you will encounter some justified push back.

> Right tool for the job is a better flexible mindset

Of course, but not all tools are equal. In programming languages, languages that have a static type system have an insurmountable advantage of dynamically typed ones.

Re:Program your next server in Go by yanilkr on Tuesday June 07, 2016 @03:06PM (#11856905)
javascript and python would disagree with you.
Re:Program your next server in Go by Jtsummers on Tuesday June 07, 2016 @03:51PM (#11857248)
Parent's claim:

  Of course, but not all tools are equal. In programming
  languages, languages that have a static type system have
  an insurmountable advantage of dynamically typed ones. 
Your response:

  javascript and python would disagree with you.
My question:

  How so?
Since the claim is about the advantages of static type systems, I'll respond on that claim alone. The primary advantage of static type systems, particularly expressive ones, but even of less expressive ones like C, is that a large class of errors can never occur in run-time code. You cannot, possibly, without deliberate effort to defeat the type checker do the following in a statically typed language without at least a compile time warning (to permit C and its weak type system and occasional implicit casting):

Define a function in your language of type: int -> int -> int [or (int, int) -> int]. Pass in something that is not an int to either parameter.

Python will happily accept this code:

  def add(a,b):
    a + b
  ... some context
    add("aoeu", 3)
And not tell you until that add call occurs. A run-time error. Could be very infrequent, which makes it really hard to reproduce.

In C:

  int add(int a, int b) {
    return a+b;
  }
  ... some context
    add("aoeu",3);
the add call won't even make it past the compiler.

JavaScript is even worse: You won't get an error at all!

  function add(a,b) { return a + b; }
  ... some context
    add("aoeu",3) // results in "aoeu3" as the return!
Dynamic and weak typing!

This doesn't mean python and javascript are bad. But it does mean they possess disadvantages relative to statically typed languages. Their type systems mean that significant testing has to be put in to verify/validate your program for guarantees that are baked into statically typed languages (caveat for implicit conversions of certain types, again, in languages like C, but this usually gets at least a warning if not an error).

Re:Program your next server in Go by yanilkr on Tuesday June 07, 2016 @04:04PM (#11857355)
"insurmountable advantage" - I don't think so.

the simplicity that javascript and python provides is an enormous advantage to many kinds of projects.

Re:Program your next server in Go by Jtsummers on Tuesday June 07, 2016 @05:03PM (#11857810)
It's not simple when you have to maintain it or debug it.

There are many classes of errors that can occur when writing software. Languages with implicit variable creation like python obscure errors like mistyping the name of a new variable (versus an explicit declaration like in C or an ML where the mistyped name will result in an error immediately modulo name conflicts). It looks correct at a glance, but:

  def foo(a_name, b_name):
    # computations
    a_nam = #some more computations
    # computations using a_name, not a_nam, returns
    # erroneous values
(NB: The above is bad practice anyways, an advantage of the single static assignment of the dynamically typed erlang.)

Oops, we forgot an 'e' at some point. Now we have a new variable, but we used the old variable name for future computations and returned a result based on that.

Type errors, I've already discussed.

Logic errors like:

  if(a < b) // when we meant a <= b
Are universal to all languages, they can't eliminate these. Actually, this leads to a major gripe I have with C. The duplication of meaning for = as both initial value assignment and later reassignment paired with the use of non-zero values to indicate true.

  if (a = b) // well, shit. a has a wrong value, and we go
             // down the wrong branch now depending on the
             // value of b.
Good practices only get us so far. Moving those good practices (static typing paired with type inference for simplicity, single static assignment or immutability by default, etc.) into the language does add mental overhead to programming. But it also produces less errorful final products.

As a guy who writes software that can literally save or kill someone depending on how well or not it functions, I'm in favor of better languages.

Re:Program your next server in Go by niothiel on Wednesday June 08, 2016 @01:45AM (#11860273)
Per your typo point, this has already been solved by linting. If I made a typo like that, any decent editor (Sublime in my case) would draw a big red box and complain at me for using an undeclared variable. In the case of a typo on assignment as in your example, the linter would report a variable declaration without usages.

Per your testing point, so what? Doesn't everyone strive for 100% code coverage anyway? One of the big advantages of dynamic languages is that more functionality can be implemented in less code which in turn makes it easier to hit that 100% coverage.

Re:Program your next server in Go by blub on Wednesday June 08, 2016 @05:53AM (#11861123)
Good point, one just has to every now and then open all files in Sublime and check for red squiggles :)

And not everyone is striving for 100% code coverage unless it really matters (e.g. SQLite). A beneficial activity becomes harmful if taken to extremes.

Re:Program your next server in Go by kmiroslav on Tuesday June 07, 2016 @04:30PM (#11857533)
These languages stopped being simpler when type inference became mainstream in statically typed languages about ten years ago.
Re:Program your next server in Go by gagege on Tuesday June 07, 2016 @03:43PM (#11857188)
A lot of people are perfectly happy if Javascript and Python disagree with them.
Re:Program your next server in Go by jdmichal on Tuesday June 07, 2016 @03:02PM (#11856868)
> Right tool for the job is a better flexible mindset. If you are a master painter, you could paint something amazing with anything you have got. Same thing applies to programmers.

I find the opposite for practical arts: The better the practitioner, the more reliable their tools must be, not less. A beginner painter might not be able to point out a bad brush from a good one; a master absolutely will. Furthermore, a bad brush won't necessarily hinder a beginner painter, but it will absolutely hinder a master painter. There are simply some techniques that the master will not be able to execute unless the brush is of a good enough quality.

Re:Program your next server in Go by rdtsc on Tuesday June 07, 2016 @03:10PM (#11856943)
> There is no universal best language nor there will ever be the one.

But there are better languages for some task than others.

Having a better type systems suites many types of tasks and environments. So making that observation seems rather rational.

Re:Program your next server in Go by kmiroslav on Tuesday June 07, 2016 @03:48PM (#11857225)
> If you are a master painter, you could paint something amazing with anything you have got. Same thing applies to programmers.

That's a flawed analogy. Here is a better one:

If you need to drill something, do you consider a screwdriver and an electric drill equally?

Re:Program your next server in Go by elbear on Tuesday June 07, 2016 @05:09PM (#11857871)
I don't agree with this analogy, because languages overlap a lot more. You could choose one of several different languages to build a web app (Python, JavaScript, Ruby, PHP, etc.).

Only particular tasks have languages that fit best. Many other tasks can be solved in multiple languages. In that case, the best tool for the job is the language you know best.

Re:Program your next server in Go by Zergy on Tuesday June 07, 2016 @02:27PM (#11856573)
I've been running into this phenomenon a lot and its not isolated to java developers. We recently had a class on Clojure 101 and the main audience was Obj-C/Swift developers. A lot of the developers went into the class actively trying to prove Clojure was dumb and the way they were doing it was better.

I think any language one it reaches a critical mass attracts people who are not problem solvers but memorizers. There is a correlation between people who rely on copy pasting existing code and SO answers and people heavily invested in their language.

Point being most people who have trouble adopting other languages tend to be memorizers vs problem solvers and become insecure when working in a poorly defined environment. Pulling them into something new after others have solved the hard problems and created best practices tends to be easier and more productive for everybody.

Re:Program your next server in Go by readams on Tuesday June 07, 2016 @02:36PM (#11856660)
This is because using Go feels very much like going back in time to Java 4.
Re:Program your next server in Go by Matthias247 on Tuesday June 07, 2016 @04:56PM (#11857745)
Not necessarily. I think by providing native slice and map types Go reduces the need for generics already by a large margin. Other things that often use generics (higher order functions, future types, ...) are no idiomatic Go which leans more to the imperative way of doing things. In total I have not really missed generics in Go up to now (but I have up to now only written about 20kloc in it) - while I certainly missed them in early Java and C# versions.
Re:Program your next server in Go by readams on Tuesday June 07, 2016 @08:13PM (#11859096)
As long as your needs are sufficiently basic that you never need to create data structures then what's in Go can be ok. People who are fans of Go seem to be people who don't know what they're missing in more advanced languages. This seems to include C programmers and dynamic language programmers. Programmers used to better type systems are generally not happy with Go.
Re:Program your next server in Go by Matthias247 on Wednesday June 08, 2016 @08:35AM (#11861768)
I think I've done things in most well known programming languages that are quite far from basic - from dynamically typed languages up to static typed functional languages. And I'm not a fan of dynamic typed languages.

But I still stand behind my opinion from the parent post: Go's type system is quite primitive, but in combination with the typical way of doing things there it is sufficient for most cases. Whereas other languages need generics a lot more, especially functional languages where monadic types are often used or languages that don't provide builtin list and dictionary types.

Re:Program your next server in Go by mratzloff on Wednesday June 08, 2016 @01:56AM (#11860304)
This comment is patronizing and implies that liking Go makes someone a "junior varsity" programmer, or ignorant of alternative programming models. It doesn't. I'm well-versed in half a dozen other languages, many of which include generics. I like Go just fine. Yes, there are cases where it is not the best choice. That's fine, too.

How much Go have you written, out of curiosity?

Re:Program your next server in Go by idobai on Wednesday June 08, 2016 @07:34AM (#11861503)
> This comment is patronizing and implies that liking Go makes someone a "junior varsity" programmer, or ignorant of alternative programming models.

Because that's the truth and that was intentional at its design.

> I'm well-versed in half a dozen other languages, many of which include generics.

It depends in which languages.

Re:Program your next server in Go by Lewisham on Tuesday June 07, 2016 @02:24PM (#11856544)
Bad programmers are always going to be bad programmers, no matter what their age. Bad programmers are inflexible and unadaptable; unable to keep up with new languages or idioms. Ken Thompson is about as old school as they come and he wrote much of Go.
Re:Program your next server in Go by airless_bar on Tuesday June 07, 2016 @03:34PM (#11857124)
I think dismissing anything invented after 1960/not invented at Google counts as "inflexible and unadaptable; unable to keep up with new languages or idioms".
Re:Program your next server in Go by weberc2 on Tuesday June 07, 2016 @04:52PM (#11857709)
Many folks come to Go from "modern" languages, Python and Java in particular. I don't think this can be considered "dismissing".
Re:Program your next server in Go by airless_bar on Wednesday June 08, 2016 @03:35AM (#11860638)
I don't think anyone considers Python or Java modern.

Nevertheless, this isn't about where adoption comes from, it's about how the language design was influenced by the advancements in language design in the last 40 years.

Re:Program your next server in Go by weberc2 on Wednesday June 08, 2016 @12:52PM (#11863627)
> I don't think anyone considers Python or Java modern.

This is why I put "modern" in quotes; these languages are "modern" relative to the 1960s-era languages.

> Nevertheless, this isn't about where adoption comes from, it's about how the language design was influenced by the advancements in language design in the last 40 years.

Precisely. The OP implied that Go programmers are "bad programmers" because they can't adapt to post-1960s languages. I countered his hypothesis by pointing out that the lion's share of Go developers were previously competent Python, Ruby, JavaScript, or Java developers. If his hypothesis were correct, one would expect the Go community to be primarily C expats.

For whatever reason, a large swath of developers find the features Go adds to be more useful than the "advancements" Go omits (or perhaps they just find value in the omission of those "advancements" altogether). At any rate, Go's popularity can't be reasonably attributed to graybeard developers who can't grok Java.

Re:Program your next server in Go by Chris2048 on Tuesday June 07, 2016 @02:42PM (#11856707)
Consider there may be an existential bias - people who are open to new languages are more likely to move away from Java.