Property discussion wrap-up

Dicebot m.strashun at gmail.com
Mon Jan 28 06:06:54 PST 2013


On Monday, 28 January 2013 at 13:49:14 UTC, Andrei Alexandrescu 
wrote:
> But this gets back to faith-based programming. I associate 
> "reasoning" with much more rigorous processes.

System-level programming is a lot about faith-based programming. 
I.e. you have some faith that "writeln" won't modify some random 
functions instructions at run-time, despite it possibly could 
have done it. This is very reason to push for idiomatic code and 
discipline when working with few million loc of system code - 
otherwise things might just blow up from any seemingly innocent 
action.

Compiler may help here or may not. Strict and well-defined 
property enforcement helps. Lax parens-les chaos leaves you no 
place for trust and forces either to spent much more time to 
maintain code or resort to verbal project-level restrictions and 
external verification tools.

>
>> That is why having .length of array as a property that 
>> reallocates is so
>> horrible.
>
> Well it's worked hasn't it.

If anyone can give me a language with half D features but with 
this part done right - I ll switch immediately. I have no other 
candidates though and am doomed to sit tight and suffer. Makes me 
rage every time I see it though. Recently another example of 
wrong property usage was given: range.save

Phobos is kind of fucked up in this regard.


More information about the Digitalmars-d mailing list