© 2023 Hashnode
#refactoring
TLDR; I made so many code smells due to time constraints, in this article I go over how I refactored/santify the repo for further development. I highlight few areas and my approach. If you find better…
In this tutorial, you will learn how to improve your code using STL algorithms and lambdas. Example Problem In this problem, you have a class that stores grades for students in an English class, and y…
Although we already use PHP Framework, there is a possibility when our code is confusing enough and sometimes the original code author loses context why they even code like that because many of us wro…
Ever repeated a condition everywhere? Maybe because you wanted to represent one value in two different formats? Maybe because you wanted to add a special value to it? Nah, stop doing that, use Polymor…
As a web developer, writing clean and maintainable code is crucial for the success of your web application. It not only improves the readability and understandability of your code but also reduces the…
An object that appears and disappears mysteriously TL;DR: Add the necessary indirection layers, but no more. Problems Accidental complexity Readability YAGNI violation Solutions Remove the int…
TL;DR: Keep your code explicit Problems Coupling Fail Fast Principle violation Bijection Fault Solutions Be declarative and explicit Don't oversimplify Context Hidden assumptions are underly…
Before diving into the world of code refactoring, let's imagine that you are renovating a house. You have two options: demolish the whole house and build a new one, or make small changes to improve its functionality and efficiency. Which op…
Laravel 10 is making the headlines these days. However, many apps are stuck in older versions, or at least still use the syntax and methods of older releases. One of the most significant changes intro…
Why do we have bad code (code smells)? Have you ever walked into a class/function that felt like everything was wrong? You start wondering how could this piece of code, be approved by someone. If qual…