Blog

Innovation in Iteration: A Developer's View on Quality & Legacy Code

Anna Kamińska
Anna Kamińska
Regular Software Engineer
March 04
4 min
Table of Contents

Quality is a very wide concept, understood by everyone in a bit different way. It can be taken care of on different business levels. It means something different for testers, product owners, and even for clients. As developers, this term will be mostly associated with producing high code quality.

In theory code quality is one of the most important aspects while developing software. Unfortunately, mostly due to workload and deadlines, this essential measure is ignored many times. Of course, such code can still behave in the way it is supposed to, but with time it will result in technical debt, bugs, security vulnerabilities, and many other issues.

As developers, we rarely have the opportunity to create new code from scratch

In the last years, there was much buzz about “Clean” Code, Horrible Performance by Casey Muratori. In this video, the author states that using clean code rules may cause more harm than good mostly to performance. He makes some good points as indeed performance and efficiency are important, even crucial for gaming software. But following just this approach will not be beneficial when we are dealing with huge programs that are not only required to be fast but above all to be bug-free and reliable.

As developers, we rarely have the opportunity to create new code from scratch. Most of the time we work with code that was there for months or years. In the book “Working Effectively With Legacy Code” by Michael Feathers, the author points out four main reasons why we want to change already existing code: adding a feature, fixing bug, improving the design, and optimization. There is no doubt that code ages in time. That is why when we as developers are creating or changing something, we should pay special attention to quality.

Understanding code quality

By code quality term, the first thing we should have in mind is readability. If the code is written in such a way that every other developer or even someone non-technical can understand what a given function is doing, it is much more maintainable. We can achieve that by simply using naming conventions. Sticking to one convention in the whole project is improving readability, consistency, and maintainability. Easy-to-read code is even more important than the concept of reusability. It saves developers time and as a result clients’ money – if understanding code takes hours it is a huge waste.

To improve the readability of code we need to ensure that the names given to code elements such as variables, functions, and methods, clearly reflect their purpose or functionality. The method that obtains something should have a ‘get’ prefix for example. If it is challenging to name a method or function, it might be the indicator that the function is too complex and needs to be refactored into a few smaller ones to provide clarity. As the well-known KISS rule, which means Keep it Simple Stupid, says – we need to focus on simplicity and self-describing naming since it will as a result save our time and the time of other coworkers.

Code review dilemma: toolkits or custom paths?

Sometimes we can think that what we created is easy to understand and without any flaws. Let’s be realists: we are not really objective when it comes to our code. This is where code review enters. Nowadays, many businesses use code review tools which is very helpful, but when developers know that code will be checked and commented on by peers, it puts a bit more pressure on them. They will try harder to deliver well-designed and tested code that others can understand. Apart from the code quality increase, thanks to code review, this process allows us to get others’ perspectives and maybe learn something in the process. Sharing knowledge and being open to other peoples’ remarks makes us better programmers and it reflects in the quality of your work.

A crucial part of code review is checking documentation. Even if we have beautiful legacy code, if we cannot run the application or don’t know how to use functionality, how can we fix the bugs or add new features? Clear and comprehensive documentation is a guide for us, and helps us to understand the codebase, its functionality, and its intended use. It also makes onboarding for new team members much smoother and it is really helpful when troubleshooting, debugging, and modifying. It provides information about why was that specific design, algorithm, and approach chosen. By keeping effective documentation, we ensure the preservation of knowledge and save the time we would otherwise use to transfer it. Also, well-documented code will be beneficial in understanding software evolution over time.

Balancing performance, readability, and maintainability

While “Clean Code” principles advocate for readability and maintainability and are mostly concerned with the development process, it’s essential to recognize that performance considerations are also valid, especially for large-scale programs. We must balance these aspects to ensure bug-free and reliable software and concentrate on the fact that we are not writing code for ourselves. By documenting, code reviewing, and using naming conventions we enhance readability and maintainability and our code will not be much slower.

Anna Kamińska
Anna Kamińska
Regular Software Engineer
  • follow the expert:

Testimonials

What our partners say about us

Hicron’s contributions have been vital in making our product ready for commercialization. Their commitment to excellence, innovative solutions, and flexible approach were key factors in our successful collaboration.
I wholeheartedly recommend Hicron to any organization seeking a strategic long-term partnership, reliable and skilled partner for their technological needs.

tantum sana logo transparent
Günther Kalka
Managing Director, tantum sana GmbH

After carefully evaluating suppliers, we decided to try a new approach and start working with a near-shore software house. Cooperation with Hicron Software House was something different, and it turned out to be a great success that brought added value to our company.

With HICRON’s creative ideas and fresh perspective, we reached a new level of our core platform and achieved our business goals.

Many thanks for what you did so far; we are looking forward to more in future!

hdi logo
Jan-Henrik Schulze
Head of Industrial Lines Development at HDI Group

Hicron is a partner who has provided excellent software development services. Their talented software engineers have a strong focus on collaboration and quality. They have helped us in achieving our goals across our cloud platforms at a good pace, without compromising on the quality of our services. Our partnership is professional and solution-focused!

NBS logo
Phil Scott
Director of Software Delivery at NBS

The IT system supporting the work of retail outlets is the foundation of our business. The ability to optimize and adapt it to the needs of all entities in the PSA Group is of strategic importance and we consider it a step into the future. This project is a huge challenge: not only for us in terms of organization, but also for our partners – including Hicron – in terms of adapting the system to the needs and business models of PSA. Cooperation with Hicron consultants, taking into account their competences in the field of programming and processes specific to the automotive sector, gave us many reasons to be satisfied.

 

PSA Group - Wikipedia
Peter Windhöfel
IT Director At PSA Group Germany

Get in touch

Say Hi!cron

    Message sent, thank you!
    We will reply as quickly as possible.

    By submitting this form I agree with   Privacy Policy

    This site uses cookies. By continuing to use this website, you agree to our Privacy Policy.

    OK, I agree