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

Reply via email to