百科知识库-中国实用知识供应者
网站地图设为首页加入收藏
百科知识库
您当前的位置:百科知识库英文阅读Computers&TechnologyIn Depth Software Development Strategies, Tip 1: Commenting
知识导航
In Depth Software Development Strategies, Tip 1: Commenting



         I've spent the past couple of days learning a new computer language, PHP. I'm currently in the process of developing an online management system, and after a careful anaylsis PHP seemed to be the right language to develop with.

         So I have been going through some tutorials and looking at lots of coding examples. As a pretty experianced programmer, I am still having a hard time understanding some code developed by other people.

         Which leads me to the first tip in this series.

         The following coding tip is very straight forward, but ESSENTIAL to keeping you effective in the Information Technology Industry, especially when working in a team enviroment

         1. Comment your code:

         If anyone is going to be reviewing your code at any point in time, you should always leave appropriate commets to help guide them. Here is how I structure my commenting, lets use JAVA for this example
/////////////////////////////////////////
// Title of Program Author's Name
// Date of creation
//
//Breif description of the program
/////////////////////////////////////////

public class TestClass
{
//Variables
protected int iCounter;
//Here is where you would list all your global variables

//Methods List all the methods after this for good programing structure

////////////////////
// main(String args [])
// Do: What is the main function of this method
// Input: What is brought into the method
// Returns: What the method returns
public static void main(String args[])
{

         //
}//End main Method--> Keep track of your end braces with a small comment
}// EndTestClass

Commenting while you are developing does not take a lot of time, and it will definitly pay off for you later, especially when you try to review some complex code.



         Graham McCarthy, has 6 years experiance developing software for both educational and business oriented purposes.
Website: http://concisecoding.blogspot.com/
Certification:


         - A College Diploma in Computer Programming Analysis from Fanshawe College in London, Ontario Canada.


         - A University Degree in Information Technology /w Honours from York University in Toronto, Ontario Canada.


        

 
百科知识库 版权所有

Copyright © 2007-2009 www.zsku.net, All Rights Reserved

本站所收集信息资料为网络转载 版权属各作者 并已著明作者 旨在资源共享、交流、学习之用,请勿用于商业用途,本站并不保证所有信息、文本、图形、链接及其它内容的绝对准确性和完整性,故仅供访问者参照使用。