Discussion on static reflection syntax in C++

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Feb 22 21:16:07 UTC 2021


On Mon, Feb 22, 2021 at 07:27:29PM +0000, Dukc via Digitalmars-d wrote:
> On Monday, 22 February 2021 at 16:54:31 UTC, IGotD- wrote:
> > Oh my god, let's hope this goes through and let C++ destroy itself.
> 
> I can't agree with this wish - not everybody can switch. If something
> like this goes through it'd only make life more difficult to those who
> don't have the luxury of D (or Rust, Go, Nim, etc.).

That would perhaps put more pressure on C++ devs to switch to a saner
language! ;-)


> I believe C++ is still an improvement over C (at least if you don't go
> crazy with all the complex features).

That is precisely the problem: all the complex features are still there,
beckoning every new hire to use them as a quick-fix to make a release
deadline.  Unless you keep a very tight control over what features can
be used -- essentially balkanizing the language, which has already
happened for at least a decade, probably longer -- the codebase becomes
a gigantic, unmaintainable mess.

Years ago, I worked in a team project where there was a C++-based
infrastructure so fancy and over-engineered, that after a while nobody
knew how to use it properly and started spending more time working
around it than using it.  Eventually, we ditched the C++ portion
completely and rewrote it from scratch in C.  It was a refreshing
change.  C's relative dearth of features was certainly limiting, but
limitation is not a bad thing in a team where people are constantly
coming and going. No matter how horribly the code devolved, there was
still only a small set of features it could abuse, and the scope of
abuse is well-known and manageable.  It wasn't *enjoyable* to go back to
C per se (D takes the cake on that one :-D), but it was definitely
better than drowning in the ocean of badly-interacting misfeatures that
is C++.


> But I too kind of fail to see how `f(...[:tuple:]..., a, b)` would cut it
> when `tuple.expand.f(a,b)` has been possible in "another language" for like
> 10 years.

That's why C++'s early death would do everyone some good. Maybe some of
the survivors would discover D. :-D


T

-- 
Programming is not just an act of telling a computer what to do: it is also an act of telling other programmers what you wished the computer to do. Both are important, and the latter deserves care. -- Andrew Morton


More information about the Digitalmars-d mailing list