Wed Oct 17 - Avoiding Code Smells by Walter Bright

TheFirefighter TheFirefighter at outlook.com
Wed Nov 7 11:00:49 UTC 2018


On Monday, 5 November 2018 at 11:07:11 UTC, Mike Parker wrote:
>
> So where are these teams of imperfect D programmers who are 
> plagued by accidental modifications of private class members? 
> Sociomantic? Funkwerk? Weka?

First, nobody needs to explain the problems that type errors 
create.

Any decent programmer should already be well aware of such 
problems.

Second, it's a matter of scale. How many D programmers are there?

The probability that someone will do something silly, like below, 
will increase with scale. That's just how it is.

Now. How many C++/Java/C# programmers are there?

And, since the chance of error will increase with the number of 
users (and also the number of lines) how many of them would find 
that their compiler will happily compile the code below?

and the is answer: zero

no matter how many of them - it'll *always* be zero.

unless they do it in D.

------
module test;

class Firefighter
{
     private void DoSomethingATraineeShouldNotDo() {}

}

class TraineeFirefighter : Firefighter {}

unittest
{
     TraineeFirefighter joe = new TraineeFirefighter();
     joe.DoSomethingATraineeShouldNotDo();

}
----------


More information about the Digitalmars-d-announce mailing list