News for hackers. Stuff that matters.
Re:Why Tech Startups Should Look at Go by shanemhansen on Thursday January 15, 2015 @12:41PM (#8893990)
I find java's ecosystem to be it's biggest drawback. Yes, there are libraries and frameworks available for everything. The drawback is that every simple task, from building to testing to servers is wrapped in so many useless layers of indirection and configuration I just want to tear my eyes out. If you could throw out all the nonsense that has infected java and just build simple things from scratch on the jvm that would be awesome. But it's too late.

I find that creating go backend services is super easy and simple. The builtin web server is amazingly performant. I've found it super easy to integrate with other services (cassandra, postgres, mysql, mongo, nsq). The result is always high performance apps with a low memory footprint and high test coverage.

When it comes to type systems, I find go's handling of errors to be closer to rust than c. Basically multiple return values encapsulate the same information Rusts's Result<T, E> does. You just deal with:

    if a, err := f(); err == nil {
        // do something with a
    } else {
        // do something with err
    }
 
rather than:

    match f() {
        Ok(a) => { // do something with a }
        Err(err) => { // do something with err }
    }
Rust certainly has the advantage in type safety, but I find the 2 forms mostly equivalent for the things I care about.
Re:Why Tech Startups Should Look at Go by codygman on Thursday January 15, 2015 @04:52PM (#8895624)
In the rust example error handling is enforced via the type system whereas with Go it depends on your (and others) discipline.
Re:Why Tech Startups Should Look at Go by shanemhansen on Thursday January 15, 2015 @06:21PM (#8896126)
You're correct. Go doesn't leave it entirely to discipline, since unused (or unhandled) variables are a compiler error. You can silence that error with _, but it sticks out to the eye as broken code.

However I'm not trying to argue that go gives you the same type safety guarantees that rust does, it doesn't.

Re:Why Tech Startups Should Look at Go by codygman on Thursday January 15, 2015 @07:52PM (#8896571)
Thanks, I forgot about the warnings. It's been a while since I've used Go.
Re:Why Tech Startups Should Look at Go by voidlogic on Friday January 16, 2015 @05:20PM (#8902106)
Its not a warning, its a "will not compile" :)
Re:Why Tech Startups Should Look at Go by dllthomas on Saturday January 17, 2015 @02:48PM (#8905308)
Isn't the technical term "error"?
Re:Why Tech Startups Should Look at Go by voidlogic on Monday January 19, 2015 @06:13PM (#8914687)
I suppose the technical term would be "fatal error". I was just clarifying it was a warning since C compilers, for example, will happily spit out many warnings and then hand you binary-
Re:Why Tech Startups Should Look at Go by dllthomas on Saturday January 24, 2015 @12:45PM (#8940287)
Yeah, it's a worthwhile clarification. Of course, the distinction is less hard than it might be, given that a lot of us build with -Werror.