© 2023 Hashnode
#refactoring
TL;DR: Don't allow remote code execution Problems Security Solutions Validate and sanitize input Avoid executing code. Input only data Apply sandboxing or isolation Context Deserializing objec…
In one of my other blog posts, I wrote about reading as a source of learning for a software developer. Now, finally, I've managed to read my first non-beginner book about coding! It was Refactoring - …
In Laravel, models are often the backbone of an application, responsible for handling data retrieval, manipulation, and persistence. However, as an application grows, models can become bloated with co…
To refactor means to restructure the source code of an application or piece of software in order to improve operation without affecting functionality. Programmers should abide by the D.R.Y. (Don’t Repeat Yourself) principle and avoid W.E.T…
TL;DR: Turn on Strict Checks Problems Unexpected errors Ambiguity The Least Surprise Principle violation Portability Solutions Enable strict mode Use role-naming arguments Context Most comp…
As software developers and data scientists, we have had whole weeks burnt on codebase maintenance. We've had bugs in our codebase that dated back to when we first made our first git project commit. We have come across many challenges that c…
The problem: In Django, we can set up Celery, and Postgres and then associate them with each other by providing them in the settings.py file. This is provided out-of-the-box by Django.So the problem arises in FastAPI as there is no out-of-t…
Introduction Hey there, fellow developers! Have you ever found yourself staring at a chunk of code that looks like a messy room? Don't worry; we've all been there! Just as spring calls for cleaning an…
You can prevent undefined TL;DR: Declare your variables and look after the scope Problems Readability Least Surprise Principle violation Variable Shadowing Solutions Be explicit on declaratio…
Your code is not safer using this operator TL;DR: Don't propagate nulls. Problems NULL propagation Harder to read code Hacky code Solutions Remove the nulls. If you can't remove it, deal exp…