<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.parspooyesh.com/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fa">
		<id>http://wiki.parspooyesh.com/index.php?action=history&amp;feed=atom&amp;title=IBSng_Coding_Convention</id>
		<title>IBSng Coding Convention - تاریخچهٔ ویرایش‌ها</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.parspooyesh.com/index.php?action=history&amp;feed=atom&amp;title=IBSng_Coding_Convention"/>
		<link rel="alternate" type="text/html" href="http://wiki.parspooyesh.com/index.php?title=IBSng_Coding_Convention&amp;action=history"/>
		<updated>2026-06-24T11:40:53Z</updated>
		<subtitle>تاریخچهٔ ویرایشهای صفحه در ویکی</subtitle>
		<generator>MediaWiki 1.19.0</generator>

	<entry>
		<id>http://wiki.parspooyesh.com/index.php?title=IBSng_Coding_Convention&amp;diff=133&amp;oldid=prev</id>
		<title>Support: صفحه‌ای جدید حاوی 'Category:Programming &lt;div lang=en dir=ltr&gt; ==General== *Use extra new lines to separate different blocks of code.   ==File Names== *File nam...' ایجاد کرد</title>
		<link rel="alternate" type="text/html" href="http://wiki.parspooyesh.com/index.php?title=IBSng_Coding_Convention&amp;diff=133&amp;oldid=prev"/>
				<updated>2011-09-03T10:45:52Z</updated>
		
		<summary type="html">&lt;p&gt;صفحه‌ای جدید حاوی &amp;#039;&lt;a href=&quot;/index.php/%D8%B1%D8%AF%D9%87:Programming&quot; title=&quot;رده:Programming&quot;&gt;Category:Programming&lt;/a&gt; &amp;lt;div lang=en dir=ltr&amp;gt; ==General== *Use extra new lines to separate different blocks of code.   ==File Names== *File nam...&amp;#039; ایجاد کرد&lt;/p&gt;
&lt;p&gt;&lt;b&gt;صفحهٔ جدید&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Programming]]&lt;br /&gt;
&amp;lt;div lang=en dir=ltr&amp;gt;&lt;br /&gt;
==General==&lt;br /&gt;
*Use extra new lines to separate different blocks of code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==File Names==&lt;br /&gt;
*File names should be lower case seperating multiple words with underline _. &lt;br /&gt;
*Directory/Package names follow the same rules.&lt;br /&gt;
&lt;br /&gt;
==Variable Names==&lt;br /&gt;
*Variable should be written in lower case. If it consists of multiple words, seperate them with underline _. ex: user_obj, user_id&lt;br /&gt;
*Don't use single letter variable names except where they are very obvious (ex. c as count or i,j as loop counter)&lt;br /&gt;
*Use obvious variable name. Smaller variable names are preferred until they are obvious about what they are.&lt;br /&gt;
*Use _obj suffix for object variable in Python/PHP/JS codes&lt;br /&gt;
*Use s suffix for list or dictionaries that contain multiple values of same entity. ex: users for a list of user instances&lt;br /&gt;
*In PHP String always enclose variables names with {} ex. {$username}&lt;br /&gt;
&lt;br /&gt;
==Method/Function Names==&lt;br /&gt;
*Method names should writter in lower case letters. If consist of multiple words, the first letter of each word except first should be written in upper case. ;ex: getUserInfo, listUsers&lt;br /&gt;
*For private methods use __ prefix and for protected methods use _ prefix for method name.&lt;br /&gt;
*a comma and an space should separate arguments while calling a function ex. add($a, $b)&lt;br /&gt;
&lt;br /&gt;
==Class names==&lt;br /&gt;
*Class names should have first letter of all words including first word in capital and other letters in lower case. ;ex: User, BWLeaf&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
===Python===&lt;br /&gt;
For python use pydoc format comments for classes and methods.&lt;br /&gt;
&amp;lt;pre&amp;gt;def getTree(self, interface_name):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
            get tree nodes for interface_name&lt;br /&gt;
            for each node there's a list containing 3 members.&lt;br /&gt;
            the first is node_id second is list of child nodes and third is list of child leaves&lt;br /&gt;
            each child node is a list of same format. Leaves are leaf_name s only&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        int_obj=bw_main.getLoader().getInterfaceByName(interface_name)&lt;br /&gt;
        return self.getSubTree(int_obj.getRootNodeID())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For in-method comments use normal hash marks #, '''before''' the place you want to comment&lt;br /&gt;
&lt;br /&gt;
===PHP/JS===&lt;br /&gt;
Always use multi line style comments for commenting methods/classes. Put the comment before the definition&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    /*&lt;br /&gt;
        Add new checkbox object to container&lt;br /&gt;
    */&lt;br /&gt;
    CheckBoxContainer.prototype.add=function(check_box_obj)&lt;br /&gt;
    {&lt;br /&gt;
        this.check_box_objs.push(check_box_obj);&lt;br /&gt;
        check_box_obj.onclick=checkBoxOnClick;&lt;br /&gt;
        check_box_obj.container=this;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
inline comments can use both single line and multiline comments, but put them in the line before the entity you want to comment&lt;br /&gt;
==Lines==&lt;br /&gt;
*Always break lines longer than 110 characters&lt;br /&gt;
*Use new lines to separate logical parts of function/method codes&lt;br /&gt;
&lt;br /&gt;
==Documentation==&lt;br /&gt;
Descriptions are added to the code for the distinct purpose of documenting the code to assist other people in understanding the code's logic.&lt;br /&gt;
Always follow the standard documentation.&lt;br /&gt;
For Class/Method/Variables add descriptions before definition :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * MyClass description.&lt;br /&gt;
 */&lt;br /&gt;
class MyClass {&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Description&lt;br /&gt;
     * @var $var&lt;br /&gt;
     */&lt;br /&gt;
     &lt;br /&gt;
    var $var;&lt;br /&gt;
    /**&lt;br /&gt;
     * MyFunction description.&lt;br /&gt;
     * Second line for description.&lt;br /&gt;
     *&lt;br /&gt;
     * @param type $var1 : description for $var1&lt;br /&gt;
     * @param type $var2 : description for $var2&lt;br /&gt;
     * @return type : description for returning value&lt;br /&gt;
     */&lt;br /&gt;
    function MyFunction($var1,$var2){&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        .&lt;br /&gt;
        return (...);&lt;br /&gt;
     }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are passing a Class object to another function , make a comment before use like this : &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* @var $obj_var MyClass */&lt;br /&gt;
$obj_var-&amp;gt;(...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Good to Read==&lt;br /&gt;
http://www.python.org/dev/peps/pep-0008&amp;lt;br /&amp;gt;&lt;br /&gt;
http://en.wikipedia.org/wiki/PHPDoc&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Support</name></author>	</entry>

	</feed>