C is Brittle D is Plastic
Walter Bright
newshound2 at digitalmars.com
Mon Mar 23 01:51:40 UTC 2026
On 3/22/2026 10:19 AM, Derek Fawcus wrote:
> One can even play macro games (using _Generic) to make a wrapper for the
> function, such that one does not even need to go through and update the call
> sites to add or remove the & .
If _Generic is needed, you have outgrown C. (I am regularly baffled by the weird
useless things added to C, but the *needed* things are totally ignored.)
> However going back to the original point, as of late last year / early this year
> it is now obsolete. That specific example of switching the code to use . or ->
> is something which the LLM assisted coding agents are particularly adept at.
D doesn't need a coding agent to refactor the code. It paid off handsomely with
the Warp program I did a few years ago. I found it very easy to try different
algorithms and data structures.
> Such refactoring tasks are what I've been using it for, where it is quite easy
> to specify some form of grep pattern and then rules to update the code. So
> these days that'll take less than an hour to achieve.
I've done these sorts of refactorings. It takes 0 minutes, because the compiler
figures it out and does it. It also doesn't wind up with a blizzard of diffs in
the git history. It doesn't need code reviewing, either.
As I've become more experienced, my tolerance for all the weird kludges
necessary for professional C getting lower and lower. LLMs don't really solve
the problem, as the wrangled C code is just as ugly looking.
I've used LLMs to a modest extent, and am impressed by it. So, I might be wrong
about the above. But it's fun to talk about it!
More information about the Digitalmars-d
mailing list