Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Stefan Koopmanschap's Blog:
Tip: use clearly readable variable names, and constants!
Dec 05, 2007 @ 18:05:00

Stefan Koopmanschap has a good reminder for developers out there in a new post to his blog - make your code much easier to understand via readable variable names and constants.

Yes, you know what code you write and you also know how it works. You can find your way around it. But what if you haven't touched a piece of code for months or even years. Or what if someone else needs to work with your code. Prevent a hell: use clearly readable variable names and constants.

He points out an example of what not to do - a specific line from the FUDForum code with multiple variables named with a single letter of the alphabet in a complex if() evaluation. He suggests even using "namespacing" of sorts (PHP6 here we come!) to help compartmentalize your variables to make things even easier.

tagged: clearly readable variable name constant namespace clearly readable variable name constant namespace

Link:

Stefan Koopmanschap's Blog:
Tip: use clearly readable variable names, and constants!
Dec 05, 2007 @ 18:05:00

Stefan Koopmanschap has a good reminder for developers out there in a new post to his blog - make your code much easier to understand via readable variable names and constants.

Yes, you know what code you write and you also know how it works. You can find your way around it. But what if you haven't touched a piece of code for months or even years. Or what if someone else needs to work with your code. Prevent a hell: use clearly readable variable names and constants.

He points out an example of what not to do - a specific line from the FUDForum code with multiple variables named with a single letter of the alphabet in a complex if() evaluation. He suggests even using "namespacing" of sorts (PHP6 here we come!) to help compartmentalize your variables to make things even easier.

tagged: clearly readable variable name constant namespace clearly readable variable name constant namespace

Link:


Trending Topics: