Re: Php code guidelines, is it necessary for just one programmer ?
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Sat, 10 Nov 2007 19:10:15 -0500
4sak3n 0ne wrote:
On Nov 8, 7:45 pm, "Shelly" <sheldonlg.n...@xxxxxxxxxxxxxxxx> wrote:Tabs save space, but are dependent on editor settings. If your tabs are set to 2 space, no real problem. But if your editor sets tabs to 8 spaces, you'll quickly notice the difference.la...@xxxxxxxxxxxxxxxxx wrote:As a solo coder for many years I've evolved before PHP in cleaning upI like the Java naming conventions. I also like K&R block structure for
some of my coding practices (when you have 10+ years of code to
maintain you learn the hard way the importance of good coding
practices. Since starting PHP I've adopted many PHP coding guidelines
for formatting etc.
It makes life a lot easier to have well formatted code, in debugging
you will know where you are in a decision process or a loop, and a
couple years down the road the formatting variable/function naming and
comments will save you a lot of time getting back up to speed when you
revisit your old code.
I use a lot of Pear formatting guidelines for my code - I don't use
Pear but a lot of their guidelines are very common sense stuff. And
if I ever do at least I'm part way there.
have a look and see what you think:
http://www-eleves-isia.cma.fr/documentation/PhpDoc/pear.standards.html
Larry
braces. I use two space tabs. I also put a space before and after an
equals sign or logical operations or concatenation operators. Names should
ALWAYS be meaningful. In multiple condition conditionals I put each
condition in its own parentheses. Also, I like to keep file short. If
there are several operations that are sizable, I will put each in a separate
file (with a good name) and use a require statement. These are a few of the
things I have adopted over the years and it has paid off as both a lone
programmer and as part of a group.
--
Shelly
Is there a specific reason for using spaces instead of tabs? I still
use tabs, but format them to 2 spaces.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.
- Follow-Ups:
- Re: Php code guidelines, is it necessary for just one programmer ?
- From: 4sak3n 0ne
- Re: Php code guidelines, is it necessary for just one programmer ?
- References:
- Php code guidelines, is it necessary for just one programmer ?
- From: __
- Re: Php code guidelines, is it necessary for just one programmer ?
- From: larry
- Re: Php code guidelines, is it necessary for just one programmer ?
- From: Shelly
- Re: Php code guidelines, is it necessary for just one programmer ?
- From: 4sak3n 0ne
- Php code guidelines, is it necessary for just one programmer ?
- Prev by Date: Re: Php code guidelines, is it necessary for just one programmer ?
- Next by Date: Re: Is there any function in php that will match a word exactly and if it finds it, it returns true.
- Previous by thread: Re: Php code guidelines, is it necessary for just one programmer ?
- Next by thread: Re: Php code guidelines, is it necessary for just one programmer ?
- Index(es):
Relevant Pages
|