null [re: spec#]
Simen kjaeraas
simen.kjaras at gmail.com
Sat Nov 6 06:03:04 PDT 2010
steveh <steveh57 at useshotmai.l> wrote:
> I've known there are hidden tradeoffs when using these 'intelligent'
> types. Non-null types add terrible runtime checks everywhere. It's
> simply not acceptable in a systems programming language. Operating
> system kernel uses very efficient uninitialized arrays for buffers. It's
> crazy to force this non-null hype down our throats.
And here you are sorely mistaken. The point of non-nullable types is the
exact opposite. In fact, the only time you need a runtime check is when
converting a nullable type to a non-nullable - after that, it's guaranteed
not to be null. When in addition there is no way to create a non-nullable
variable without initializing it (and possibly checking that the
initializing value is not null, if it comes from a nullable source),
the result is a great decrease in runtime checks, not an increase.
--
Simen
More information about the Digitalmars-d
mailing list