Live data from Hacker News

Why I Like D

aradaelli.com

61–70 of 134 posts

Re: Why I Like D

#61
post #18

Yes, I just wished more people liked D so it got momentum.

I first learned C++ 20+ years ago. While I've appreciated it, I also knew its shortcomings and had been looking for a replacement. D had some missteps along the way that lost some initial traction. I also wouldn't be surprised if timing was a factor with more C++ warts being added while the programming community has learned more lessons along the way that could be applied to the next languages (Go, Rust). As I follow…

> shoehorning

That happens to all languages over time. The more interesting thing is how well do those features fit in with the language's style.

Re: Why I Like D

#62

Earlier quoted context omitted.

I wanted to like D because I respect Walter a lot, and D's community probably has by far the highest SNR of any community I've visited... seriously smart people. But the language just wasn't for me. Right off the bat, the default import style which thrusts everything exported into the default namespace like C seems odd at this point. Apparently one can use what are called static imports, but as a code reader I can't…

Wow, and someone else just yesterday was giving D credit for not thrusting everything into the global name space like C does! Yes, two different D modules can declare the same name as public, and they will not conflict with each other.

Apologies if I misworded what it's doing.

It wasn't about name clashing, but readability. It's not clear at first glance what functions belong to which imports.

As an example: https://tour.dlang.org/

Three imports and what appear to be four unqualified functions from them.

Re: Why I Like D

#63
post #58

A colleague (who is probably one of the smartest people I've met) made VectorFlow targeting D: https://github.com/Netflix/vectorflow I've never had a chance to look at it much, but I think the magic is in the metaprogramming capabilities. It's more principled than C++ templates, more ergonomic than Scala macros, and more practical than Template Haskell. Somehow. (At least this was my impression from discussing it)

The library looks impressive, but I dunno about that sales pitch: isn't "more principled than C++ templates"… a pretty low bar? And isn't "more practical than Template Haskell"… also a pretty low bar? I would have asked the same rhetorical question of Scala macros a couple years back, but the Scala 3 macro redesign is indeed pretty nice.

While the design D picked for templates looks (and is) straightforward, it wasn't obvious. It's only obvious in retrospect (which is something a good design aspires to, like putting an eraser on the other end of the pencil).

Re: Why I Like D

#64

Earlier quoted context omitted.

Wow, and someone else just yesterday was giving D credit for not thrusting everything into the global name space like C does! Yes, two different D modules can declare the same name as public, and they will not conflict with each other.

Apologies if I misworded what it's doing. It wasn't about name clashing, but readability. It's not clear at first glance what functions belong to which imports. As an example: https://tour.dlang.org/ Three imports and what appear to be four unqualified functions from them.

I'm sorry you don't like it, but that's a feature! But if there are identical names from two different imports, the compiler will demand that you qualify them.

Or just use static import.

Re: Why I Like D

#65

Earlier quoted context omitted.

I wanted to like D because I respect Walter a lot, and D's community probably has by far the highest SNR of any community I've visited... seriously smart people. But the language just wasn't for me. Right off the bat, the default import style which thrusts everything exported into the default namespace like C seems odd at this point. Apparently one can use what are called static imports, but as a code reader I can't…

The SNR point is well taken. It's probably why I find less popular languages to be more enjoyable. Practically anything Python or Javascript related is flooded with too much entry-level commentary and Medium articles (yick). Languages such as D, AWK, Prolog, etc etc attract those who have broken that threshold, generally many years ago.

D programmers have also been in high demand in the industry, because D programmers tend to not need social proof, and tend to be self-educated and self-starters.

Re: Why I Like D

#66

Earlier quoted context omitted.

> You have to get over `begin` and `end` though. Ada would be smart to get rid of that.

It's probably not removable after almost 40 years. It has expression functions which you can wrap a return result in () and avoid it. The important part is that it's surprisingly consistent in that 3 of the 4 structural elements are nearly all self-similar in their declare/begin/end format (protected type being the 4th and the difference).

Actually, I liked Ada since I read the Milspec on it back in 1981 or so. It had its positive influence on D!

Re: Why I Like D

#67
Interesting language

    // Increment all elements by one (array-wise expression)
    half[] += 1;
Is this really that useful? Seems like a weirdly specific code smell...

Re: Why I Like D

#68
post #67

Interesting language // Increment all elements by one (array-wise expression) half[] += 1; Is this really that useful? Seems like a weirdly specific code smell...

Wish I had this in JS tbh

Re: Why I Like D

#70

BetterC got a lot of resistance at first, along the lines of who needs it. (BetterC is a subset of D that only relies on the C standard library.) But over time it has accumulated a lot of users, as being C without the troubles. We've gone a step further with ImportC, and now C code can be imported directly into the D compiler, which makes it easy to interface D code to your existing C base.

Partial aside, BetterC sounds a lot like Zig and Andrew Kelley moved to Oregon a year or two ago. Have you talked with Andrew? Funny that two of the language creators in the space are so close to each other on Earth.

I'd love to listen to you two discuss D, BetterC and Zig and C.

Post reply on HN