D vs Go in real life
Bienlein
jeti789 at web.de
Thu Nov 28 08:07:46 PST 2013
On Friday, 22 November 2013 at 14:43:11 UTC, Chris wrote:
> Go is web-oriented, so it seems, and I'm sure it will be
> marketed as the "one size fits all" solution for web
> development, multi-core and whatnot. But D goes deeper. D
> raises fundamental questions about how a good program should
> look like, what is good / practicable. I know that this
> approach doesn't sell, but it's the best I've ever come across.
> D makes you think and re-assess your own code time and again.
I basically I agree with this. But lately, I was asking myself,
though, whether me classifying Go as simplistic was wrong. I
programmed the canonical Scala trait sample in Go. In that sample
from the Scala book there is a trait Rectangular with a upperLeft
and bottomRight point. Some class Rectangle extends trait
Rectangular. I could get the same accomplished using delegation
in Go. The solution in Go is much much simpler and from what I
can tell the power is the same. So this made me think.
I guess the solution in Scala is easier to recognize for the
reader as the code is more structured using specific language
constructs. Therefore someone reading the code would easier see
the structure in the code and understand the solution.
Nevertheless, with a simple construct like delegation with some
compromises in visibility you get almost the same power as with
inheritance, traits/mixins, etc. This is still amazing to me.
-- Bienlein
More information about the Digitalmars-d
mailing list