Jump to content

Code Guidelines


seventheyejosh

Recommended Posts

Hey guys, my coworker and I have decided to start coding our code to a standard. We are given pretty free roam on most everything, so up to this point we've kind of just coded whatever. Now that our application is getting to be quite sizeable, we want to rectify our past ways and adopt a standard. I figured that we'd just go for the PEAR standard: http://pear.php.net/manual/en/standards.php , but one of the comments on there, or somewhere, mentioned the phpBB standard. So I had a looky at that, and I think it is a little cleaner looking: http://area51.phpbb.com/docs/coding-guidelines.html . My question is, would it be bad to learn a whole standard such as the phpBB which is not 'official' as opposed to a more popular one such as PEAR? In your experiences, would an employer want you to code to 'A' standard, or code to 'THE' standard?

 

If that is too confusing, firstly my bad, secondly the simple question is should I learn PEAR, phpBB, or some other standard? And, should I learn the SQL standard? Or just learn the SQL standard for the standard I learn ( I saw phpBB had one, not sure about PEAR).

 

Thanks!

 

- Josh

Link to comment
Share on other sites

In your experiences, would an employer want you to code to 'A' standard, or code to 'THE' standard?

 

There is no 'THE' standard. The idea of using any standard should suffice. I use Zend's which is a port of the PEAR standard I think.

 

should I learn PEAR, phpBB, or some other standard?

 

It depends. You can easily enough define your own. Your best bet however is probably to find one you like or code similar too already and role with that.

 

There are tools like CodeSniffer around too which may help you stick to these standards depending on how much you want to enforce them.

Link to comment
Share on other sites

I really like the look of the Zend standards, they seem quite clean.

Since these are the guys who created the core PHP engine, it is probably the best standard to adopt, especially if you are going to release code. However, as others have said, there is no right or wrong with this subject.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.