News for hackers. Stuff that matters.
Re:Ruminations on D: An Interview with Walter Bright by tree_of_item on Tuesday August 30, 2016 @11:51AM (#12391206)
I like a lot of things about D, but I don't like the fact that it seems stuck in the OOP fad from 15 or so years ago. Go and Rust have both abandoned this whole idea of making "classes" in favor of constructs like structs, enums, traits and interfaces. I wish D had gone this route as well, but other than that it seems like a nice language.
Re:Ruminations on D: An Interview with Walter Bright by FraaJad on Tuesday August 30, 2016 @11:59AM (#12391278)
Eh.. I wrote a 1000 line linux "system" application in D. Didn't use a single class. All enums and structs pretty much like you would approach it like good "C" programmer while still using all of D's goodness.
Re:Ruminations on D: An Interview with Walter Bright by tree_of_item on Tuesday August 30, 2016 @12:07PM (#12391350)
D enums are not the good kind of enums (i.e. sum types, like in Rust), though. Instead they have some silly implementation of sum types using classes in std.variant.
Re:Ruminations on D: An Interview with Walter Bright by Profan on Tuesday August 30, 2016 @12:16PM (#12391428)
It's not a class, it's a struct (as a value type), it's fine if you disagree with the idea of OOP, but don't come in with an incorrect assumption of how the language is actually used in the wild.

But sure, I would agree that having a natively implemented variant type would be better, even if this one can serve many of the same purposes.

Class = reference type, supports polymorphism, inheritance

Struct = value type, does not support polymorphism, inheritance

The variant type based on a struct is implemented through the language's metaprogramming facilities.

Re:Ruminations on D: An Interview with Walter Bright by zem on Tuesday August 30, 2016 @03:09PM (#12392976)
this is my primary "complaint" about D; i strongly prefer languages with algebraic datatypes and pattern matching built in. other than that it does indeed look like a beautiful language.

ironically, i haven't really used D for the same reason i haven't really used rust - i've yet to have a project for which ocaml wasn't a better choice. (i know both D and rust address things ocaml doesn't, but they aren't the things i tend to need for my personal projects.)

Re:Ruminations on D: An Interview with Walter Bright by skocznymroczny on Tuesday August 30, 2016 @02:12PM (#12392456)
You'll never satisfy everyone I guess. For me personally, I wish D went more the OOP route (as the Tango library did in D1 times), rather than the template/metaprogramming way it went with. Some of the error messages from D rival C++ STL template vomit.
Re:Ruminations on D: An Interview with Walter Bright by PeCaN on Tuesday August 30, 2016 @03:35PM (#12393178)
Heh, that's exactly what I do like about D—the generic programming/metaprogramming paradigm instead of OOP.

You can get some very elegant and efficient code with D, while OOP tends to have more runtime overhead.

Re:Ruminations on D: An Interview with Walter Bright by dansze on Tuesday August 30, 2016 @03:57PM (#12393347)
I actually almost never use the OOP parts of D because metaprogramming generally offers a more elegant solution to the problem than polymorphism.

That doesn't mean there's no downside to the metaprogramming in terms of project complexity, but once you get past the part where you rebuild the universe from scratch it's smooth sailing.

Re:Ruminations on D: An Interview with Walter Bright by bachmeier on Tuesday August 30, 2016 @06:16PM (#12394397)
I've been using the language since 2013, and I don't think I've ever written a class. My strong preference is functional programming.