Photo by Safar Safarov on Unsplash

Writing software code that is clean and maintainable will make your life and other developers’s lives that may work on your project later easier and sometimes improve the application performance and decrease the memory space it consumes, let me demonstrate more…

Note: The upcoming examples are written in PHP but it can be applied to any programming language.

1. Do not create additional variables if it is not necessary:

Let’s say you have an action in your controller that gets the user id from the request and sends it to a view, so you may write it like this:

class ProfileController{
// GET or POST request
private $request;
public function…

Ali Khaled

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store