Code That Says Exactly What It Means
Walter Bright
newshound2 at digitalmars.com
Tue Oct 28 02:41:51 UTC 2025
On 10/27/2025 6:19 PM, jmh530 wrote:
> To be fair, it keeps coming up because people (not me!) say they want the
> feature and the reasons for being opposed to it have never been that great. The
> people opposed say D’s unit of encapsulation is the module, great, but what
> you’re really doing is presuming a paradigm of programming that is different
> from how they want to work. If D advertises itself as a multi-paradigm language
> that supports object-oriented programming and a bunch of object oriented
> programmers say they want scopePrivate / privateScope (and several get upset and
> leave the community), then it doesn’t really come across as that supportive of
> the paradigm.
D is also regularly accused of supporting too many paradigms.
For example, GC is optional in D. But some people do not want it optional, they
want it to not be there. Hence, -betterC. But D gets criticized for that, too.
There's no way to please everybody. I wish there was.
I've programmed first in BASIC, then Fortran, then C, then C++, then Java, then
Javascript, then D.
My first Fortran programs looked like BASIC. My first C programs looked like
Fortran, and so on.
It's always off-putting at first, until it becomes natural and you're done with
the previous way for good.
In the olden days, file lookups were slow and it made sense to cram it all into
a small number of source files. Those days are long gone now, and IDEs make
navigating multiple source files super easy. Having the unit of encapsulation
being the file which is the same as the module makes a great deal of sense.
I.e. if you have a 10,000+ line module, it's likely time to consider dividing it
into distinct modules, rather than dividing up the scopes in the file.
More information about the Digitalmars-d
mailing list