Articles tagged “refactoring”
12 articles
- Refactoring It is not unusual to find a piece of code which has severe issues and cannot be maintained as is. It can actually come from a less experienced colleague, a low quality internet resource, or even… yourself. In all those cases, the code requires…
- Comments classification This is a bad comment: int i = 0; i + 1; // adding 1 to i should work but dont work i dont know why!!!! print(i);For every good comment, I've seen hundreds of bad comments. They harm the code base and give the wrong impression to the author that he…
- Code duplication Beginners' code is always an amazing opportunity to remove code duplication, as well as explain what code duplication is to the original author. I was reviewing a few thousand LOC, so I thought this is an opportunity to post an example and to show…
- Extensibility When modifying a system (such as adding features), one should be concerned about the ability of the system to be modified. This implies the presence of two extensibility aspects: architectural and quality-centered. I believe it is essential to…
- Aren't we misusing YAGNI too often? OK, I get it, I'm over-thinking and over-engineering this app. I should KISS, because YAGNI. Great. I should not attempt to solve problems I don't have. I should not attempt to solve problems I don't have. Or should I? Development is filled with…
- Simplifying systems by adding proper abstractions The original draft of Solange project defined a notion of profile and instance. According to the today's documentation (revision 1234): A profile is a generic description of a machine, i.e. a set of configuration items and operations which define a…
- Micro-services in a context of high complexity and low code quality One of the most problematic things of a software developer is how to handle the increasing complexity of a given code base and the decreasing quality of it. Code which, when originally written, was readable and understandable, looks completely scary…
- The greatness of TDD illustrated During an interview, I was asked to solve the following problem: A validation function takes as input a string containing parenthesis and square brackets. It should return true if the closing parenthesis and brackets are matching the opening ones, or…
- Take risks, fail fast In many software development teams, the source code is sacred. Its sacredness is caused by two factors: The code is the ultimate expression of the intellectual work of the developers. If you have anything against the code, it means that you're…
- Unit testing methods which are calling static methods Disclaimer: the article below talks about methods calling public static methods from other classes. This excludes the calls to private static methods. Recently, I wrote a rather unpopular answer on Stack Exchange about static methods in a context of…
- YAGNI principle in action Discussing YAGNI with colleagues, I often find myself in a situation where they give me a concrete example where they were very happy to think about a given feature or aspect before it was really needed. As those discussions always follow the same…
- Trimming strings Regularly, I find interesting questions on Stack Overflow, that look basic at the first sight, but appear to be not that simple after all. Today, it was a question on the Russian version of Stack…