|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
What do you think about php coding guidelines ? I know for sure that
every big php project needs one, all those programmers need common rules to code, but do you think that is necessary for just one programmer ? And if the answer is yes what code guidelines do you recommend ? I found the phpbb3 group coding guideliness http://area51.phpbb.com/docs/coding-guidelines.html and also this http://codeassembly.com/Why-are-php-...nes-important/ and of course the PEAR coding guideliness http://www-eleves-isia.cma.fr/docume...standards.html I know pear is kind of standard but there are lots of thinks that I don't like about it, like putting the bracket on the same line ... Waiting for your opinions. Thanks. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
"__" <Givanz@gmail.com> wrote in message news:1194565202.597932.55410@e9g2000prf.googlegrou ps.com... > What do you think about php coding guidelines ? I know for sure that > every big php project needs one, all those programmers need common > rules to code, but do you think that is necessary for just one > programmer ? > And if the answer is yes what code guidelines do you recommend ? > I found the phpbb3 group coding guideliness > http://area51.phpbb.com/docs/coding-guidelines.html > and also this > http://codeassembly.com/Why-are-php-...nes-important/ > and of course the PEAR coding guideliness > http://www-eleves-isia.cma.fr/docume...standards.html > I know pear is kind of standard but there are lots of thinks that I > don't like about it, like putting the bracket on the same line ... > Waiting for your opinions. > Thanks. yes, it's important. if you do start to work with others in collaboration, you'll be happy you've already been doing what is best. further, if you go to an employer who wants to see some of your work, they'll certainly like to know that you are already on board in that sense. as for which one? be familiar with them all. pick one that makes sense for you. it's your choice for now. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
__ wrote:
> What do you think about php coding guidelines ? I know for sure that > every big php project needs one, all those programmers need common > rules to code, but do you think that is necessary for just one > programmer ? > And if the answer is yes what code guidelines do you recommend ? > I found the phpbb3 group coding guideliness http://area51.phpbb.com/docs/coding-guidelines.html > and also this http://codeassembly.com/Why-are-php-...nes-important/ > and of course the PEAR coding guideliness > http://www-eleves-isia.cma.fr/docume...standards.html > I know pear is kind of standard but there are lots of thinks that I > don't like about it, like putting the bracket on the same line ... > Waiting for your opinions. > Thanks. > > Yes, standards are important for ANYONE. Even one person shops. But it's impossible to give you any *good* guideline recommendations. There are several around; look at them and find one which fits our coding style. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
As a solo coder for many years I've evolved before PHP in cleaning up
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/docume...standards.html Larry |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
larry@portcommodore.com wrote:
> As a solo coder for many years I've evolved before PHP in cleaning up > 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/docume...standards.html > > Larry I like the Java naming conventions. I also like K&R block structure for 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 |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
As a C++ programmer using php I tend to follow codding standards that fit both languages, (they are so close anyway). I agree with what others have said, choose a standard that you like and stick to it. Even if you are on your own it is better to look at many projects that all follow the same standard. And you can re-use code as well knowing that it should fit well in your current project. I am in the case where I have been writing a small app on my own for the past year, now that it is picking up speed more and more coders are ing me and it s that I already had some form of standard to follow. FFMG -- 'webmaster forum' (http://www.httppoint.com) | 'Free Blogs' (http://www.journalhome.com/) | 'webmaster Directory' (http://www.webhostshunter.com/) 'Recreation Vehicle insurance' (http://www.insurance-owl.com/other/car_rec.php) | 'Free URL redirection service' (http://urlkick.com/) ------------------------------------------------------------------------ FFMG's Profile: http://www.httppoint.com/member.php?userid=580 View this thread: http://www.httppoint.com/showthread.php?t=22024 Message Posted via the webmaster forum http://www.httppoint.com, (Ad revenue sharing). |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
On Nov 8, 7:45 pm, "Shelly" <sheldonlg.n...@asap-consult.com> wrote:
> la...@portcommodore.com wrote: > > As a solo coder for many years I've evolved before PHP in cleaning up > > 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/docume...standards.html > > > Larry > > I like the Java naming conventions. I also like K&R block structure for > 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. |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
"4sak3n 0ne" <4sak3n0ne@gmail.com> wrote in message
news:1194731983.215223.86330@k35g2000prh.googlegro ups.com... > Is there a specific reason for using spaces instead of tabs? I still > use tabs, but format them to 2 spaces. Almost totally a matter of preference. I sometimes work on code from a guy who indents a double-space at a time; while I do it a tab at a time. He pointed out that it makes his *printed* code better fit on the page - and he's right. I still use tabs, but I'll be integrating his idea in my releases. For release, ya always gotta do some cleanup and, making the code print better seems to be a good one. |
|
![]() |
| Outils de la discussion | |
|
|