Live data from Hacker News

Go 1.4 is released

blog.golang.org

181–190 of 265 posts

Re: Go 1.4 is released

#181
post #138

Earlier quoted context omitted.

>imagine yourself building UI component without classes or inheritance I see no problem at all. UI development in my opinion becomes much more elegant, concise and easy to follow/reason about in a functional language that does not implement classes or inheritance. As you said, Go has struct inheritance and interfaces, that's how you do things in Go and every Go developer is familiar with the concept, it's clean and e…

Well, if what you are doing is inheritance-heavy, then OOP features will make your code cleaner. It's what OOP is made for. You can do it in Go, but it's not as elegant.

Inheritance as taught in OO courses (deep class hierarchies) is bad most of the time.

We can save 100 lines of code there by coupling 2 slightly related things forever (and arbitrarily choosing this criteria for division as the most important).

I've made game before I knew OO programming. I haven't knew it then, but I used Interpreter Pattern - there was data model, with a list of records, each record had some enums deciding how game logic should handle it. There was main loop updating the model using these enums to choose logic to run on this record.

It wasn't pretty but it worked, I was able to modify it however I wanted, to choose logic to run on some record basing on enums, other atributes of given record, attributes of parent records, or of colliding records, on whatever I wanted basicaly.

Then I rewrote the game to use OO design (I was enthusiastic- this is exactly what I need - I thought). It turns out that I had to choose arbitrary divisions. I can divide game objects into Solid and non-solid, Static and Movable, Visible and Invisible, and also Smart vs Dumb Objects. Which division should be first in class hierarchy? All the rest would need to be duplicated anyway. SmartMovableVisible, SmartMovableInvisible, SmartStaticVisible, etc... Ugly.

Inheritance solves part of the problem and leaves you with inconsistent solution.

The real solution is strategy pattern, and composition over inheritance. It can be done just as well in languages without inheritance (but with lambdas).

Re: Go 1.4 is released

#182
post #129

Earlier quoted context omitted.

If garbage collection is acceptable, you'd learn more from trying OCaml - or even Haskell, if you want to really expand your comfort zone. I'm not saying don't learn Go eventually, but for the "second language" you should try something more different from C/C++ so you get more of an idea of the range of stuff out there.

OCaml is been around for almost 2 decades. Something must be holding back its adoption. Microsoft's version F# seems to be doing better but developers aren't adopting it en masse.

It's become a lot more popular in the last few months/years, maybe there's a good reason for that. The English documentation is much better than it used to be, as is the library ecosystem.

I work mostly in Scala, but there's a lot of similarity, and I think the main reason we're seeing it take off now (10 years after originally released) is that the kind of problems where it's really useful are becoming a lot more common. If everything's in the cloud, you need a language that's good at distributed problems. If you need to handle huge volumes of data, you need something more flexible and explicit than traditional languages. If you're using too many layers of technology to understand what they all do, you need a language that can help you keep track of them.

Re: Go 1.4 is released

#184
post #48
post #7

Earlier quoted context omitted.

You can also add numbers on an abacus. It _works_. Put in a less snarky way, C is often way more low-level and tedious than you need. The great thing about Go is that it lets you blend high-level and low-level programming in the same program, only getting low when you need to. It feels like a great mix of C and Pythonubyerlhphavascript. I've given many talks on this, e.g. http://talks.golang.org/2014/gocon-tokyo.slid…

> You can also add numbers on an abacus. It _works_. Well, I wouldn't go there (C is antiquated/under-equiped like an abacus) if I was advocating Go. After all, Go, just like an abacus doesn't have generics, or, besides channels and goroutines, most other facilities modern languages offer for that matter (GC and some basic data structures built-in is so 1980).

> Go, just like an abacus doesn't have generics, or, besides channels and goroutines, most other facilities modern languages offer for that matter

If you need mainly a large number of features in order to program, Go probably isn't for you. But from the perspective of a C/C++ programmer, this isn't likely to be an important point. Languages with more features than C have been available for 40 years (depends on what you'd count as a feature), so there were plenty of "better" choices in that regard available for said people.

For me, the lack of some "features" is a great asset for Go, I probably wouldn't have bothered to learn a new language if it had boasted the complexity of Rust or Haskell.

Re: Go 1.4 is released

#185
post #85

Earlier quoted context omitted.

And now things just got interesting. I'll put my money on the availability of Go on Android being the catalyst for its future hockey stick growth.

I would be extremely surprised to see a language having no class, no inheritance and no good IDE become successfull in modern app development. Android devs are used to such a different type of programming, i don't expect them to accept banging their heads on so many walls for such little gains. Ps : my stand is the opposite for server side dev.

> no good IDE

LiteIDE is open source, cross-platform and pretty enjoyable. https://code.google.com/p/liteide/

Re: Go 1.4 is released

#186
post #178

Earlier quoted context omitted.

Not sure where you got that feeling : Android studio was just released a few weeks ago and became the official IDE for android. Xcode advocates building GUI using Wysiwyg tool. Swift has all the OOP features, and it also has an embedded "playground" mode, inside the IDE itself. I don't think the trend is toward slim environments. There will always be people to say that doing things manually is better than having the…

> There will always be people to say that doing things manually is better than having the computer do it Languages that don't require a heavy IDE (particularly one including lots of tools for writing and rewriting code -- static analysis tools are a different issue) aren't "doing things manually instead of having the computer do it" -- interacting with the language itself is no more "manual" than interacting directly…

I understand your point, although i don't think OOP has anything to do with ( as C# and swift demonstrate).

I disagree on your "read language" vs "write language" analogy. Take for example SQL and Database model designer. Both are useful, and the fact that the second makes things easier doesn't diminish the merits of the first.

Re: Go 1.4 is released

#187
post #66

Earlier quoted context omitted.

But you also get a stack trace without needing an IDE and debugger.

I've been working with Go daily for a few months now at my job and I'd like to point out that Go stack traces have a really big signal to noise ratio. There is a lot of cruft that mostly nobody cares about and sometimes it can be hard to pinpoint exactly where something crashed (at which line) with a panic. Just saying, they should probably improve it to be less verbose and more concise.

In that case you would say it has a really low signal-to-noise ratio.

Re: Go 1.4 is released

#188
post #66

Earlier quoted context omitted.

But you also get a stack trace without needing an IDE and debugger.

I've been working with Go daily for a few months now at my job and I'd like to point out that Go stack traces have a really big signal to noise ratio. There is a lot of cruft that mostly nobody cares about and sometimes it can be hard to pinpoint exactly where something crashed (at which line) with a panic. Just saying, they should probably improve it to be less verbose and more concise.

I realize I'm perhaps somewhat annoying, apologies, but that would make the signal to noise ratio _small_, not big.

It's literally (SIGNAL) / (NOISE), so if the noise is larger than the signal, the ratio goes down.

Re: Go 1.4 is released

#189
post #92

Damn, another project giving up on Mercurial and switching to Git. :-/ A few more major ones and basically nobody is using Mercurial anymore. How sad.

I have never use hg. I don't really see much difference. What do you like about it?

There isn't much of a difference. The underlying principles of how they work are essentially the same. However hg has IMHO a more pleasant UI, and it's easier to customise. I believe Facebook chose hg for the latter reason: https://code.facebook.com/posts/218678814984400/scaling-merc...

Re: Go 1.4 is released

#190
post #98

Earlier quoted context omitted.

Git is equally hostile to everyone! Long live Git. (Maybe the way to advance the poor Gui user interaction experience is to write frontends for it?)

If they're smart, Perforce will integrate their UI tools with Git. They have by far the best UI for a Git-style SCM.

Perforce's P4Merge is already the best GUI tool for three-way merges, and works like a charm with git.
Post reply on HN