Reduced Structural Complexity With Examples

Code quality is -should be- one of the main concerns of a software developer. While designing the internal structure, it is important to avoid increasing the structural complexity -cyclomatic complexity, cognitive complexity, halstead volume, maintainability index and such…- which exposes to reliability, maintainability and testability problems. Factory pattern design seemed like a good place to start explaining how to work on complexity problems. The reason, Gürel and I picked factory pattern, is because its most common usage -no offense, this is just one way of doing it :)- simply turns…