Author: nickhodges@gmail.com

Command/Query Separation

Introduction An important step to writing Clean Code is the notion of separating “commands” and “queries” by using the Command Query Separation Principle.  The notion was first discussed by Bertrand Meyer in his book Object Oriented Software Construction.  This means that the idea is not new.  In its basic form, it means we should separate the…

Read the full article

Testing My New Code Formatter

I am using the Crayon Code Highlighter.  Let’s see how it works: procedure ConfigureOptions; var Option : IOptionDefintion; begin Option := TOptionsRegistry.RegisterUnNamedOption<string>(‘The file to be processed’, procedure(value : string) begin TSampleOptions.FileToProcess:= value; end); Option.Required := true; Option := TOptionsRegistry.RegisterOption<Boolean>(‘OutputInUpperCase’,’o’, ‘The output should be in upper case’, procedure(value : Boolean) begin TSampleOptions.OutputInUpperCase:= value; end); Option.Required :=…

Read the full article

TVirtualInterface Series

I wrote a series of articles on using TVirtualInterface.  Here are links to all the articles in order: TVirtualInterface: Interfaces without an Implementing Class TVirtualInterface: Next Steps TVirtualInterface: A Truly Dynamic and Even Useful Example