Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

legacy-code

Why cast free’s return value to void?

February 1, 2023 by Tarik

If we are talking about the standard free function then its prototype is void free(void *ptr); Therefore the cast is completely useless. Now some speculation. The author might have forgotten to include the stdlib.h header declaring this prototype, so the compiler is assuming the return type of it as int. Now during static analysis of … Read more

Categories c Tags c++, casting, free, legacy-code, void Leave a comment

Coding Katas for practicing the refactoring of legacy code

December 16, 2022 by Tarik

I don’t know of a site that catalogs them directly, but one strategy that I’ve used on occasion is this: Find an old, small, unmaintained open source project on sourceforge Download it, get it to compile/build/run Read the documentation, get a feel for the code Use the techniques in Working Effectively with Legacy Code to … Read more

Categories refactoring Tags legacy-code, refactoring Leave a comment

What to do about a 11000 lines C++ source file?

October 10, 2022 by Tarik

Merging will not be such a big nightmare as it will be when you’ll get 30000 LOC file in the future. So: Stop adding more code to that file. Split it. If you can’t just stop coding during refactoring process, you could leave this big file as is for a while at least without adding … Read more

Categories c++ Tags anti-patterns, c++, legacy-code, version-control Leave a comment
Newer posts
← Previous Page1 Page2

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa