Lost Password?


Go Back   CodeCall Programming Forum > Software Development > General Programming

General Programming Non language specific, Assembly, Linux/Unix, Mac and anything not covered in other topics. Talk about Programming Theory here.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-06-2005, 07:44 PM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 9,224
Last Blog:
Ext JS or Ext GWT
Rep Power: 20
Jordan is just really niceJordan is just really niceJordan is just really niceJordan is just really nice
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default PEAR Standard

I found this in a Google search. The website isn't there anymore but the cached version is.

ActionApps - Coding Standards

We encourage ActionApps developers to follow the coding standards described bellow. It help us to have the code as readable as possible for everyone.

Most of the following rules comes from php PEAR standard http://pear.php.net/manual/en/standards.php
Most important rules on tne top:

* use UNIX end of lines (use \n and never windows \r\n)

If we mix both modes, the CVS diffs are unusefull
* Indent 4 spaces, with no tabs

Do not use Tabs or use 'insert Tabs as spaces' option of your text editor. Most of the editors (like Jedit or HomeSite) allows it. Then the code will look good in any editor.
* Use PHP functions up to version 4.0.6

* <?php open tag

Do not use any other shorted version like <?, .. There are some problems on some Apache configurations with <?...
* comments should follow phpDoc standard

See http://phpdocu.sourceforge.net/
- use /* */ and // for comments, not #
* control structures should look like

if ((condition1) || (condition2)) {
commands;
} else {
commands;
}

- open brace at the end of line
- if, while, ... separated by space (it is not function call)

* function($var1, $var2=true)

No space between function name and open brace allow us easier find the function in the code.
* 80 characters wide

Try to write the code 80 characters wide, if possible.
* quote strings in indexes

Allways qoute strings like 'name' in $arr['name'] or $db->f('name') although current PHP do not need it.
* use $_GET, $POST, and $_SERVER

Use mentioned superglobal arrays to access variables from forms ...
* use return true; instead of return(true);

Return is the statement, not a function.
* When you commiting changes into CVS, allways update CHANGES file and send a note to apc-aa-coders@sourceforge.net

* Document new feature in the FAQ (http://apc-aa.sourceforge.net/faq/) and in the code

* If it is possible, create an example of new feature on Sourceforge installation of ActionApps

* If you changing database structure (adding table, ...), you should update sql_update.php3 script

* Before you are going to code some new feature, let us know about, please (apc-aa-coders@sourceforge.net)


I know the current code do not strictly follows mentioned rules, but from this time it will ....... hopefully

Honza Malik, 1/29/2003
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 11-06-2005, 07:45 PM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 9,224
Last Blog:
Ext JS or Ext GWT
Rep Power: 20
Jordan is just really niceJordan is just really niceJordan is just really niceJordan is just really nice
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

Check out the link in the post above for more info:

http://pear.php.net/manual/en/standards.php
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-13-2006, 02:00 AM
moonrise moonrise is offline
Learning Programmer
 
Join Date: May 2006
Posts: 40
Rep Power: 10
moonrise is on a distinguished road
Default

that was a informative post thanks buddy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-24-2006, 07:56 PM
kromagnon kromagnon is offline
Learning Programmer
 
Join Date: Jun 2006
Posts: 53
Rep Power: 9
kromagnon is on a distinguished road
Default

I hate putting the open brace at the end of a line... it makes my soul cry. This is how I always do it:
Code:
for(int i; i < 3; i ++)
{
    some code
    some code
    some code
    some code
}
__________________
<!-- comment comment comment --></
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-24-2006, 08:26 PM
TkTech TkTech is offline
 
Join Date: Jun 2006
Posts: 990
Last Blog:
Having trouble with yo...
Rep Power: 20
TkTech is on a distinguished road
Send a message via MSN to TkTech
Default

Jordan, the site is still there, http://actionapps.org/aa/doc/coding.html
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 07-25-2006, 06:46 PM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Moderator
 
Join Date: Jul 2006
Age: 35
Posts: 3,276
Last Blog:
wxWidgets is NOT code ...
Rep Power: 36
WingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to all
Default

I'm with you, Kromagnon, but I can live with either style. It's a holdover from when I coded in Pascal and had to use "begin" and "end" instead of { and }.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Programming is a branch of mathematics.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 08-03-2006, 05:47 PM
dirkfirst dirkfirst is offline
Programming Professional
 
Join Date: May 2006
Posts: 338
Rep Power: 12
dirkfirst is on a distinguished road
Default

I prefer the { on the line of the function

Code:
int main () {
}
__________________
DirkFirst
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Studio Standard vs. PRO Chan Software Development Tools 2 09-22-2006 05:47 PM


All times are GMT -5. The time now is 01:34 PM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 98%

Ads