Php code guidelines, is it necessary for just one programmer ? - PHP

This is a discussion on Php code guidelines, is it necessary for just one programmer ? - PHP ; 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 ? ...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Php code guidelines, is it necessary for just one programmer ?

  1. Default Php code guidelines, is it necessary for just one programmer ?

    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. Default Re: Php code guidelines, is it necessary for just one programmer ?


    "__" <Givanz@gmail.com> wrote in message
    news:1194565202.597932.55410@e9g2000prf.googlegroups.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. Default Re: Php code guidelines, is it necessary for just one programmer?

    __ 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. Default Re: Php code guidelines, is it necessary for just one programmer ?

    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. Default Re: Php code guidelines, is it necessary for just one programmer ?

    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. Default Re: Php code guidelines, is it necessary for just one programmer ?


    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
    helping me and it helps 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. Default Re: Php code guidelines, is it necessary for just one programmer ?

    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. Default Re: Php code guidelines, is it necessary for just one programmer ?

    "4sak3n 0ne" <4sak3n0ne@gmail.com> wrote in message
    news:1194731983.215223.86330@k35g2000prh.googlegroups.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.






  9. Default Re: Php code guidelines, is it necessary for just one programmer ?

    On Nov 10, 3:00 pm, "Sanders Kaufman" <bu...@kaufman.net> wrote:
    > "4sak3n 0ne" <4sak3n...@gmail.com> wrote in message
    >
    > news:1194731983.215223.86330@k35g2000prh.googlegroups.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 started using tabs but read the reason people use spaces is because
    tabs can be interpreted as different lengths on various editors or not
    at all. A space is a space, or four in my case of code indenting.


  10. Default Re: Php code guidelines, is it necessary for just one programmer?

    4sak3n 0ne wrote:
    > 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.
    >
    >

    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.

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attglobal.net
    ==================


+ Reply to Thread
Page 1 of 2 1 2 LastLast

Similar Threads

  1. Replies: 20
    Last Post: 10-05-2007, 03:33 AM
  2. Code guidelines for checks ?
    By Application Development in forum Java
    Replies: 5
    Last Post: 07-13-2007, 11:48 AM
  3. Code Guidelines
    By Application Development in forum DOTNET
    Replies: 2
    Last Post: 11-02-2004, 01:57 AM
  4. VB.NET: Robot / Auto Programmer / Code Generator
    By Application Development in forum ADO DAO RDO RDS
    Replies: 0
    Last Post: 01-27-2004, 07:10 AM
  5. VB.NET: Robot / Auto Programmer / Code Generator
    By Application Development in forum ODBC
    Replies: 0
    Last Post: 01-27-2004, 07:10 AM