August 28
On Thursday, 28 August 2025 at 22:48:16 UTC, Ali Çehreli wrote:
> On 8/28/25 2:51 PM, monkyyy wrote:
> > On Thursday, 28 August 2025 at 21:33:27 UTC, Brother Bill
> wrote:
> >>
> >> The 'old book' pdf seems to be the most current approach,
> and it
> >> should only be about 3 years old.
> >
> > Its not even close to only 3 years old, it mayve been updated
> some but
> > its like 15 years old
>
> That's not an accurate guess: I may have started writing pieces of it 15 years ago but the last update was in February 2022:
>
>   https://bitbucket.org/acehreli/ddili/commits/branch/master
>


Its canonical and probably better then the spec itself, but it is old; updates can only do so much. You got a list of like 50 names your thanking for helping *in 2017*; I think I read it to learn d in 2020, it was quite long then, its been a bit. D itself isnt moving fast so its not like your falling behind, but someone did just go thru your book and found regressions.

> I know I will never get to the level of many programmers

?

Your probably like 5th, your book is canonical given its linked to by official sources enough that I believe every new user is aware of it within a few days.

> but the book was written to teach programming to novices.
> The fact that it uses D is helpful on many levels. There are some old concepts in > there like OOP and strong exception guarantees but I claim the content is still usable today.

My opinions on oop asside, its probably a bit on the heavy side to be a teaching tool, your competing with the spec in my opinion, especially if you only add chapters for new features or clarifying paragraphs as someone disagrees with you. I bet it hurt if someone threw it at ye head.

August 28

On Thursday, 28 August 2025 at 18:47:19 UTC, Brother Bill wrote:

>

It seems like 'templates' are the 'Achilles heel' of D.

Phobos is a great community resource--its presence is the only reason D can be considered by many enterprise-level adoptions.

That said, there are scenarios where "just D" can bring your dev focus back to the basics. Templates in their raw form just let you create data structures for a given type. If you're being overwhelmed, just stop there. It's enough.

Having just reached feature-complete for a web media player with middleware, backend, SSL, and SQLite3, I'm finally getting to the point where it's easier to do X in D than any other language. And I trust it more.

Always keep an eye on the distinction of D and Phobos. I use Phobos where it makes sense, but have a "tiny" library which often suffices with far less fuss. The D language itself is rarely the problem. This Mr. Bright guy is, well, bright. Actually, "brilliant".

Andy

August 28
On Thursday, 28 August 2025 at 22:48:16 UTC, Ali Çehreli wrote:
> That's not an accurate guess: I may have started writing pieces of it 15 years ago but the last update was in February 2022:

While I code in D, a PDF viewer of Mr. Çehreli's book is open in a tab. That the author of such a first-rate resource is available on this forum is... remarkable.

Thank you, Mr. Çehreli!
Andy

August 29

On Thursday, 28 August 2025 at 18:47:19 UTC, Brother Bill wrote:

>

It seems like 'templates' are the 'Achilles heel' of D.

Without starting a flame war, has D gotten to the point where ordinary mortals have difficulty coding in D with 'templates' such as 'cycle' requiring rewrites into 'myCycle'?

Does D now require 'deep' memory into layers of history and workarounds?

Most D coding doesn't require deep template knowledge. The standard library can sometimes be confusing, but that's the library, not the language itself. And I would say that every standard library has it's "history and workarounds."

>

Is D a general purpose language, suitable for Application Programming, or does it have a more limited scope?

No idea, after C++ every language just looks like a subset of C++ anyway.

C++ is suitable for Application Programming => therefore everything is

August 29

On Thursday, 28 August 2025 at 18:47:19 UTC, Brother Bill wrote:

>

It seems like 'templates' are the 'Achilles heel' of D.

Without starting a flame war, has D gotten to the point where ordinary mortals have difficulty coding in D with 'templates' such as 'cycle' requiring rewrites into 'myCycle'?

Templates are in general a horrible way to program. Therefore I don't use them very much. When I do, I don't do anything complicated. But everyone has their opinion on that. I similarly don't use attributes. I prefer simple code with a simple language. Hard to avoid ranges in Phobos, which can be crazy complex/inconvenient at times, but every language has its warts.

>

Does D now require 'deep' memory into layers of history and workarounds?

Not if you stick to the simple parts, like interfacing with C and writing scripts.

>

Is D a general purpose language, suitable for Application Programming, or does it have a more limited scope?

Yes. I use it for scripting and numerical programming (specifically, statistical work). Great for those use cases. Once you get into the complexities of templates and attributes and all that "stuff" you've lost the battle. Oh, and it has a garbage collector that you can use or not use, that's great too.

August 29

On Thursday, 28 August 2025 at 18:47:19 UTC, Brother Bill wrote:

>

It seems like 'templates' are the 'Achilles heel' of D.

Without starting a flame war, has D gotten to the point where ordinary mortals have difficulty coding in D with 'templates' such as 'cycle' requiring rewrites into 'myCycle'?

What you ran into is a bug. Indeed, sometimes with generative code, if there is a bug in the checks, you get very weird stuff as a result, sometimes hard to decipher.

But the solution suggested by Monkyyy isn't a requirement. I would never suggest that the correct way to use phobos is to work around its bugs. Maybe as a stopgap, until the problem is fixed.

>

Does D now require 'deep' memory into layers of history and workarounds?

No. It's a bug. We fix it, and now the next person doesn't have the same error.

>

Is D a general purpose language, suitable for Application Programming, or does it have a more limited scope?

Yes it is as suitable as any major language that exists today. All languages have bugs. That doesn't negate their suitability for use.

-Steve

August 28
On Fri, Aug 29, 2025 at 01:52:59AM +0000, Lance Bachmeier via Digitalmars-d-learn wrote:
> On Thursday, 28 August 2025 at 18:47:19 UTC, Brother Bill wrote:
> > It seems like 'templates' are the 'Achilles heel' of D.
> > 
> > Without starting a flame war, has D gotten to the point where ordinary mortals have difficulty coding in D with 'templates' such as 'cycle' requiring rewrites into 'myCycle'?
> 
> Templates are in general a horrible way to program. Therefore I don't use them very much. When I do, I don't do anything complicated. But everyone has their opinion on that. I similarly don't use attributes. I prefer simple code with a simple language. Hard to avoid ranges in Phobos, which can be crazy complex/inconvenient at times, but every language has its warts.
[...]

Interesting how opinions differ on this. :-D  I couldn't live without templates.  I might be tempted to quit D if I couldn't use templates... ;-) but OTOH there are times when templates are overused where they aren't actually needed.

Once, I wrote an entire program using Phobos ranges, which was amazing for fast prototyping thanks to pipeline programming.  But it resulted in hilariously huge generated symbols (like 4KB for a single symbol!) which slowed compilation down to a crawl while the compiler soaked up RAM like a sponge.  Thankfully, after I complained about it in the forum Rainer implemented a symbol compression scheme, which instantly reduced compilation times back to normal levels.

Then later, while working on a different but somewhat related project, I wanted to reuse the PNG generation modules I'd written entirely in Phobos ranges.  Performance was abysmal, though.  So I ended up rewriting it in more imperative-style code (well OK, with a couple of ranges thrown in here or there 'cos I couldn't be bothered to rewrite every last bit of perfectly fine, non-bottleneck code) and it worked much better.  Thanks to templates and DbI, the transition was smooth and almost without hiccups.  Without them, it would have been a painful exercise in frustration re-fixing bugs that had already been previously fixed.

Mind you, the new code still uses a fair share of templates, but with just the performance-critical bits in more imperative style.  A nice balance between development effort and resulting performance, which is something rarely achieved in other languages.  In a low-level language like C/C++ I'd be pulling my hair out in frustration as I try to navigate language pitfalls and memory micromanagement galore; in a high-level language like Java I'd be cursing the inability to get under the hood and optimize a hot loop without jumping through hoops, needlessly boxed native types, and mountains of boilerplate.  In D? Just a couple o' hours' worth of iteration with a mix of templated and C-like code, and it's already good enough to do real work.  Just a bit more effort and it'd be ready for prime time.  Best of both worlds!


T

-- 
The mathematician suffers from heart disease. He has an arrhythmatic problem.
August 29
On Friday, 29 August 2025 at 02:48:21 UTC, H. S. Teoh wrote:
>
> Interesting how opinions differ on this. :-D  I couldn't live without templates.  I might be tempted to quit D if I couldn't use templates... ;-) but OTOH there are times when templates

You probably gonna like comptime in Zig

I think it will be more interesting to compare with more modern languages, than justifying over old ones that are trying to save back-compatibility
August 29

On Thursday, 28 August 2025 at 18:47:19 UTC, Brother Bill wrote:

>

Is D a general purpose language, suitable for Application Programming, or does it have a more limited scope?

I've been using it for exactly that - application programming (both CLI and GUI based on GTK), for 20 years.

August 29

On Thursday, 28 August 2025 at 18:47:19 UTC, Brother Bill wrote:

>

It seems like 'templates' are the 'Achilles heel' of D.

Without starting a flame war, has D gotten to the point where ordinary mortals have difficulty coding in D with 'templates' such as 'cycle' requiring rewrites into 'myCycle'?

I don't think so.

It is true that template metaprogramming is more complex, slower to compile and prone to compiler bugs than C or Java-style programming, mostly thanks to templates repeating themselves less. But still, for the standard use cases Phobos is still more than stable and understandable enough. And so are at least some of the other widely-used templated libraries, such as EMSI containers and Vibe.D.

Generally, you just need a bit of humblety so you'll stop yourself from doing anything too fancy with the templates once you realise you have many strange problems popping up. Same as with any language feature set.

Compared to C++ templates, it is still almost always easier to do the same thing in D. I certainly prefer Phobos ranges over STL iterators, Boost, or a dynamically dispatched object-oriented solution like LINQ in .NET languages.

>

Does D now require 'deep' memory into layers of history and workarounds?

Didn't understand that question.

>

Is D a general purpose language, suitable for Application Programming, or does it have a more limited scope?

It is. I don't even know what that more limited scope would be if D was not.