My PHP Development Experience
Source: - https://www,php.net

My PHP Development Experience

After spending 2 years as a PHP Developer in both corporate and startup environments within the industry, I would like to share my top insights on PHP Development and the experience of being a PHP developer.

1.      Write as cleanly as possible 🧹✨

Making your code readable is more important than making your code run faster. If any chance comes when someone else is looking at your code, then do not make them confused as it is going to take more time to debug the code and more difficult to fix.

Try using good text editors like VS Code, PhpStorm, or WebStorm by JetBrains to write your code, use formatter to format your document, and write your variable in snake case (var_name), or in camel case (varName) to make it more readable.

Try maintaining some space between and give breaks to some lines to make each statement much more readable. For your front-end code, try using a good formatter to make your HTML tags readable. Like your JS scripts in the frontend code.

These methods will make your code clean, easy to read, debug, and gives a professional look to your code.

 

2.      Name your files and routes wisely 📄📁

Like names of your variables, try making your routes, files, and folder’s name readable which will make your file system much more efficient, and readable route’s name to make the route much more end user-friendly.

For example, if a route for the user’s login page is created, then it should be created as either `localhost:8000/auth/login` or something else of your choice. Either for GET method routes or POST methods routes, making them readable and simple to access by end users.

 

3.      Use Tools for efficiency 🛠

Your text editor is way more powerful than you thought. A simple editor such as VS Code, with some extensions which can reduce your development time, makes code readable, and, makes debugging easy can efficiently your project completion journey.

Changing the theme of your text editors can make your code view better and makes development enjoyable. If you want some interesting themes idea for your VS Code, then please let me know in the comments.

 

4.      Using VCS & CI/CD Pipeline 💾💻

Version Controlling System (VCS) like Git is best when it comes to creating and maintaining a full fledge PHP application, in which to maintain a version of the application or APIs, but also makes the developer experience awesome and makes your application easy to maintain.

 

5.      Choosing Frameworks over Libraries 🧱🏗️

In PHP, earlier apps were created by either using a framework or libraries, but to increase the efficiency of the application, give try to use good PHP frameworks like Laravel, CodeIgniter, Symfony, and Yii to develop your Web Apps or APIs to structure your code in the MVC (Model, View Controllers) or Service APIs to make your application fast and much more support of the libraries regarding the frameworks like to process Excel Files or generating PDFs.

Developing applications using Libraries can give you much more versatility but makes your development slow and hectic (unless you are used to creating code using libraries).

 

6.      Manage your Assets 🛡️ 🖼️

From CSS to JS to images, try to make them load fast to make your application feels faster. Try Using CDNs to load your CSS or JS if they are generic like Bootstrap CSS, jQuery, or Popper JS, etc. to load them quickly to the client.

For Images, try using CDNs, Storage buckets, or other services to load your image to load them faster.

If there are some constraints in your code like custom JS or CSS, then try to build them using a module bundler like Vite, webpack, or gulp.js to compress and load the assets quickly to your public folder or from other folders where your assets are stored.

These methods will make your front-end assets load much faster and better to use.

 

7.      JS is your best friend 🤝

From DOM libraries like jQuery, or front-end libraries like React or Vue.JS, JavaScript should be your partner in making your web application much more user-friendly and making your application feels like a single-page application, and making async functionality much better.

Next time, try using React or Vue.JS to make your application feel like a Single page application. Laravel has the best support to handle these web frameworks to easily use them in your frontend.

 

8.      Try new Tricks!! 🔮

Instead of iterating an array of months, try using a ‘for loop’ of 12 to get details of a year. Or simply replace your if-else-if statement with a switch case and use ternary operators for saving data in a variable according to condition rather than using an if-else statement, such tricks will reduce your lines of code, speed up your application, and make your coding style better. Also, you will flex within your colleague that you know how to do things efficiently.

 

9.      Connect to more people for more ideas 🤝💡

From your college seniors to your connections in your LinkedIn account, connecting to more people can help you to get a job to help in some situations where you are confused about what to do in your career, looking for a job change, or reviewing your CVs & resumes. Also, your teammates can teach you how to do these things if you are stuck somewhere or they can teach you something to make your code much more efficient to perform.

 

10.  Focus & Commitment on the project 🎯

After reading all the above points, show your commitment to your project and focus on a single module or task rather than handling multiple modules simultaneously. Map the methods in your head and make them accomplished. 


That's it for today. If you like this article, then please comment below how do you feel and which point you found unique and interesting.

Thank you

Kindly share cv (for php role) at viren.k501@gmail.com

Like
Reply

To view or add a comment, sign in

Others also viewed

Explore content categories