On Sunday, 3 February 2013 at 13:56:13 UTC, bearophile wrote:
deadalnix:
The code seems to miss the usage of contracts, foreach loops
on numerical intervals, final switch, toString with sink,
text() function, enum for compile-time constants, most const
arguments, const on methods.
My experience tells me that this is probably a good idea if
you don't want to run into weirdland.
Among those things I have listed, probably the only ones that
give a little of troubles are const on methods.
The author has used asserts at the beginning of methods,
outside a the pre-condition, this is silly. Not using foreach
loops on numerical intervals is a waste of fingers and
increases the risk of mistakes, final switches often help you,
text() is shorter than to!string(), const arguments are usually
handy to avoid some troubles and make function/method
signatures more informative.
Bye,
bearophile
Welcome to reality Bearophile!!!
In real projects people do the job as best as they can at the
moment, and they probably, and with right, do not care what
people who only theorise, criticise, and philosophise think! You
write perfect code?! I doubt! And if you do, you will probably
never finish any serious project in time!