Studies have been done on this. In terms of pure legibility a slightly yellowish page color--"cornsilk" is a great place to start--offers ideal contrast (with black characters).
Object Oriented Design Principles have been distilled and are known by 3 letter codes (OCP = Open Closed Principle, LSP = Liskov Substitution Principle). Google that.
The best book I know of on this subject is "Object Oriented Software Construction" by Bertrand Meyer.
I remember the last time when Microsoft doomed what would otherwise have been a good format (FlashPix). Their "contributions" made it unusable in two ways. First, their "structured storage" which made it unbearable complex. Second, their insistence on a *destructive* alpha channel, in which the RGB values were premultiplied by the alpha channel as an optimization, making it impossible to recover colors from the areas designated as transparent.
And *now* they are championing "non-destructive" edits?
I have been using contracts in C++ since 1991, so I have some experiences to report.
First off, I wrote a little paper on it at the time.
I implemented it with macros. The main issues were:
It required a funny return macro, to guarantee exiting through the postconditions
Compilers started to complain about gotos crossing over my variable declarations. (I tried to put pre and post conditions at the top of the function, jump past the postconditions, and then on return jump back to the postconditions to execute them. This approach had serious issues, and would force me to declare some variables higher up.)
Despite the admitted problems, it was a radically successful effort, eliminating a whole class of bugs for me--most importantly in the area of attempted reuse of classes where I saved tons of debugging time. (Like the time I attempted to reuse a dictionary class, not realizing that my dictionary did not accept certain types of keys, or the time I found out with the same class that I was generating negative hashcodes.)
It never ceases to amaze me how some of the world's most important programming constructs--particulary for correctness--have not made it into mainstream languages.
Studies have been done on this. In terms of pure legibility a slightly yellowish page color--"cornsilk" is a great place to start--offers ideal contrast (with black characters).
Object Oriented Design Principles have been distilled and are known by 3 letter codes (OCP = Open Closed Principle, LSP = Liskov Substitution Principle). Google that. The best book I know of on this subject is "Object Oriented Software Construction" by Bertrand Meyer.
I remember the last time when Microsoft doomed what would otherwise have been a good format (FlashPix). Their "contributions" made it unusable in two ways. First, their "structured storage" which made it unbearable complex. Second, their insistence on a *destructive* alpha channel, in which the RGB values were premultiplied by the alpha channel as an optimization, making it impossible to recover colors from the areas designated as transparent.
And *now* they are championing "non-destructive" edits?
First off, I wrote a little paper on it at the time.
I implemented it with macros. The main issues were:- It required a funny return macro, to guarantee exiting through the postconditions
- Compilers started to complain about gotos crossing over my variable declarations. (I tried to put pre and post conditions at the top of the function, jump past the postconditions, and then on return jump back to the postconditions to execute them. This approach had serious issues, and would force me to declare some variables higher up.)
Despite the admitted problems, it was a radically successful effort, eliminating a whole class of bugs for me--most importantly in the area of attempted reuse of classes where I saved tons of debugging time. (Like the time I attempted to reuse a dictionary class, not realizing that my dictionary did not accept certain types of keys, or the time I found out with the same class that I was generating negative hashcodes.) It never ceases to amaze me how some of the world's most important programming constructs--particulary for correctness--have not made it into mainstream languages.