Introducing Nullable Reference Types in C#. Is there hope for D, too?

rjframe dlang at ryanjframe.com
Thu Nov 23 13:55:04 UTC 2017


On Thu, 23 Nov 2017 01:08:45 +0000, codephantom wrote:

> So yeah, you can change the language.. or you can change the way people
> think about their code. When they think differently, their code will
> change accordingly.
> 
> My point about sophisticated IDE's and AI like compilers, is that they
> don't seem to have addressed the real issue - that is, changing the way
> people think about their code. If anything, they've introduced so many
> distractions and so much automation, that people are just not thinking
> about their code anymore. So now, language designers are being forced to
> step in and start regulating programmer behaviour. I don't like that
> approach.
> 
> You rarely hear anything about defensive programming these days, but
> it's more important now, than it ever was. I'd make it the number one
> priority for new developers. But you won't even find the concept being
> taught at our universities. They're too busy teaching students to
> program in Python ..hahha...the future is looking pretty bleak ;-(

It's easier to write better tools than it is to change people. That seems 
to me to be a big part of the D language design.

The sophisticated IDEs and compilers exist to help developers write better 
code; large projects are too complex, and open source projects especially 
receive contributions from people that don't know the code, so if the 
compiler can help, it should.

I left Python for D mostly because of variable annotations[1]. The 
following is valid in Python 3.6:

>>> myvar : int = "some string"
>>> print(myvar)
some string

If my compiler/interpreter won't tell me if I do something stupid like 
that, I don't want to waste my time with it. If your language gives me 
explicit types, it needs to give me some sort of type safety with them; 
otherwise your language is a hack. Static analysis will catch this, but I 
shouldn't need to run a static analysis tool or use an IDE to find an 
error like that.

> What if I did a security audit on DMD or PHOBOS. What would I discover?
> 
> What if I did a security audit on all the D code at github. What would I
> discover?

If you have the skills, this would (in my opinion) be an amazing use of 
your time. I'd recommend just auditing the core tools and popular 
libraries, rather than all code unless it's a hobby of yours though.


[1]: https://docs.python.org/3.6/whatsnew/3.6.html#whatsnew36-pep526


More information about the Digitalmars-d mailing list