Great talk! Thanks for sharing.
>
> He also talks about Design Patterns and one example there is the
> pattern of a "function invocation" in Assembler. Now, nobody
> needs this pattern anymore, because the language does it for you.
Similar case, the Gtk GUI library, it's written in C in a way that
aims to be object oriented, but it's like playing a violin tuned two
octaves too high.
--
---- vruz
---- alterius non sit qui suus esse potest
A concrete example: The Visitor Pattern.
This is a clever, subtle pattern that uses subtype inheritance to
implement a type switch.
Go has type switches, and therefore no need for the Visitor Pattern.
I leave the Singleton Pattern as an exercise.
So you're right, it is educational to try to implement those problems
in Go, but for the most part those *patterns* don't really apply. Java
code doesn't work well in Go, nor Go in Java.
-rob
rather than naming the patterns and/or drawing complicated
diagrams, each code walk would simply show aspects of how
real Go code accomplishes things, with a focus on
picking out common aspects that are generally useful.
i think people might find this useful, but YMMV.
A concrete example: The Visitor Pattern.
This is a clever, subtle pattern that uses subtype inheritance to
implement a type switch.
Go has type switches, and therefore no need for the Visitor Pattern.
--You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Monday, 17 March 2014 07:59:28 UTC-4, Rob 'Commander' Pike wrote:
The Visitor Pattern, like many patterns in the "Gang of Four"[...]:
such are the lengths one must stretch to achieve simple goals.
This comment is a little ironic, given that there was a blog post on golang.org recently describing design patterns for concurrency in Go. Whatever the deficiencies of C++, I'm not certain that the existence of design patterns prove anything.
--