Computer Programming

Learning a language simply wont make you a successful programmer. There are various things to consider as a programmer. Though I haven't been a real programmer yet, I would like to share some points that I felt which is required for being a good programmer.

1) User requirements: Whatever may be the application, big or small, it needs to correspond to users needs. So its better to ask the user what he wants exactly. Prototype (User Interface) on the actual software/program can be shown by designing using softwares. Analysis on feasibility of the project should be taken into account.

2) User Interface: It plays the major role now-a-days. Many algorithms/codes are developed that accounts for the speed and performance of the system. But today's main concern among the users is, how friendly is the user interface, Is the software reporting errors in a manner that a normal person would understand etc. If you could see the recent projects taken in the IT companies, you will find less of development projects and more projects that alter the codes that they already have giving better visual experience to the users. Voice recognition (One way of interacting with the OS, which is not much successful in Vista) is one such facility that is to be added in Windows Seven.

3) Algorithm: This is the starting step after analysis in the process of development of the code. Most students will neglect this step and will directly enter into coding, which is a wrong practice. Though the above two steps may/may not be considered by the student, this step is very important in developing any code for a problem big/small. In some cases, we find how to solve the problem manually and what are the functions required to solve the problem and the algorithm is created.

4) User Inputs: Many times, we wont see what will be the possible inputs from the users. For eg) assume that we wrote a program to find whether a number is prime or not. Most times, we wont check for the integrity of the user inputs. If we give negative numbers, then also it will show whether the number is prime or not. Sometimes our code will say 1 as prime number, if we did not make necessary checking for the user input as 1. Take another example of finding average of 5 marks which is given by user. Most times we assume that user will give something between 0 and 100. But what if the user gives a negative number or something above 100. The program should ignore such cases. So possible user inputs are one such conditions we must look into.

5) Overflow/Truncation: When the result of addition or mulitplication increases beyond the actual value a datatype can hold, error occurs. And instead of floating point operation as in finding average, normal integer operation is performed error will occur in the result. So checking the data type of variables used is very important and we should make sure that user inputs corresponds to the variable data type where

6) Speed and Resource: Again students while programming wont consider this point. They have lot of resource and their program is very small usually so they dont care much about this. But when it comes to developing bigger programs speed and resource play a major role. The speed at which a program starts, executes and gives results should be high. Speed of execution can be improved by various techniques like dead code elimination, checking for more probable condition first, eliminating operations in entry conditions for loops, using pointers etc. Resource that the program uses can be optimised by the number of variables we chose to perform a task, knowing the maximum length an array can have, using linked list etc.

7) Comments and Variable Name: For the one who sees the program, may be a tester, he should know what particular function/block does. For that you have to put comments here and there. This also is not a practise among students. And another important thing is giving meaningful names. When a program gets a input from the user, say marks of 5 subjects, we can either give the subject name + marks as the variable name or m1,m2 etc or mark1, mark2 etc or create an array with mark[5] which makes it more meaningful. Instead if we use variables like a,b,c,d,e the code will look odd to the one who sees it.

8) Error checking: Another important phase is testing for errors and whether the program gives the desired output. Mostly we do this. But if we struck at finding some error, we will find it hard to spot it. Those times, someone else who did not involve in coding can help you, because others dont know much about your code, and their main intention will be to spot the errors. It is natural tendency for one person to spot the error performed by other person, whatever may be the case.

I could remember only these at this time. If I remember more in the future, I will update it.

0 comments:

Post a Comment