if(arr) now a warning

Vladimir Panteleev via Digitalmars-d digitalmars-d at puremagic.com
Fri May 1 02:28:55 PDT 2015


On Friday, 1 May 2015 at 09:08:11 UTC, Jonathan M Davis wrote:
> Walter tends to err on the side of wanting to break no code 
> whatsoever, and
> he almost never seems to understand when folks actually _want_ 
> their code
> broken, because they consider the current situation to be worse 
> than having
> their code temporarily broken (e.g. because leaving the current 
> state of
> things in place would result in far more bugs in the future).

It's not really as simple as that, and I think I understand W & 
A's position here.

It seems that every once in a while, someone on Reddit etc. is 
going to say something along the lines of "I once tried to 
compile some code written in D, and it didn't compile with none 
of the three compilers. I'm not familiar with the language or 
code, so fixing it was out of the question, and so was randomly 
trying old compiler versions. If other people are going to have 
the same experience using MY code, then I don't see the point in 
investing time in D."

I was in the "break my code" camp for a long time, but this has 
gradually changed as the amount of D code I've written grew. Let 
me tell you, it's totally not fun when you need to quickly fix a 
D program you wrote 3 years ago because something is on fire and 
it needs fixing now, and discover you have to make a bunch of 
changes just to get it to compile again. The alternative is using 
an older compiler, and DVM helps with that - but this doesn't 
work if the fix is in a library which is not compatible with 
older compiler versions.

I would love a cleaner D language, if only it could be enforced 
just onto NEW code.


More information about the Digitalmars-d mailing list