This is part 2 of my small series about cleaning up large code bases. After we get our team together and all are determined to clean up that mess, where […]
I have done another refactoring session in my last two blog posts. I have covered refactoring in other blog posts, but there is a thing that is really important about […]
Today I’ll pick up where I left last week with the refactoring with @vaughncato‘s inverse matrix multiplication function.
A while ago, Twitter user @vaughncato sent me the piece of code for this refactoring session. Since there is a lot of things to do on this code, I split […]
In my last post I showed the Visitor design pattern in its fully object oriented implementation. In the post before that I wrote about moving from enums to class hierarchies. I […]
When an enum controls the behavior of a class, that behavior can sometimes be expressed by class hierarchies.
Sometimes, a fixed set of string values is allowed as input. Often these string values are then stored, used for control flow etc. Enumerators are a better alternative.
I’ll try something new today: I pick a piece of code from the web and see what improvements I would make to it, using small refactoring steps.
We often see compiler warnings about pieces of code that have potential problems or poor style. Sometimes they point out code that is actually wrong, so don’t ignore them.
Managing the lifetime of dynamically allocated memory and the objects residing in it is one of the challenges that can be hard to do right. It is usually handled by assigning […]