C is Brittle D is Plastic

Walter Bright newshound2 at digitalmars.com
Mon Mar 23 23:48:27 UTC 2026


On 3/23/2026 8:12 AM, user1234 wrote:
> On Sunday, 22 March 2026 at 04:47:41 UTC, Walter Bright wrote:
>> [...]
>> Working on D shows that there is no reason for the C and C++ -> operator to 
>> even exist, the . operator covers both bases!
> 
> Yes from the user POV. From the compilers-details POV I think that semantics 
> checks for that are awfully complex. Add to this your system of UFCS. Boom, 1000 
> lines of code to desintricate what the programmer really meant.
> 
> However that's certain that once implemented properly it's 100% profit for 
> hundreds of programmers.

I admit the implementation code is not a dreamboat. But in defense, in the 1980s 
I attempted to develop the be-all and end-all windowing user interface library.

I soon discovered that what is intuitive and easy for the user is a giant mess 
of special cases in the implementation. And when the implementation was simple 
and consistent, the users thought it completely unintuitive.

Longtime D users might remember when I was the lone holdout on how the name 
lookup worked in D. I thought it was perfectly straightforward, and it was easy 
to implement in clean code.

Nobody agreed with me.

So now we have a complicated 2-phase lookup that everybody likes.

Go figure!

P.S. C and C++ require semantic analysis in order to parse the source code 
correctly (the C cast expressions, and the >> tokens in C++). These are 
unnecessary and simply bad language design.


More information about the Digitalmars-d mailing list