Search This Blog

Wednesday, August 28, 2013

Develop 5 attributes that will help your software projects succeed

Have you ever wondered why there are so many failed projects out there, or why whenever you start a project you lose interest in it and just want to move to the next. Well i am here to give you some reasons "WHY" and "HOW" you can avoid this or at least reduce the rate failures.
     Firstly, lets establish the grounds of what a failed project really meant? Most people will agree that, a Software Project is tagged as "FAILED" if:

  • It does not conform to the required specification,
  • It is not cost effective (i.e more resources have been allocated to it than its worth )
  • It is incomplete due to lost of focus or the inability to control its development due to complexity.
  • It took longer time to be delivered and its no more needed or newer technologies have come into play and the used is considered outdated. 
This are a few points that will determine the success of a Software Project, however, the real question is; why does this happen? The simple answer will be, lack of professionalism amongst software developers. With this statement, i mean; software developers should not take on work beyond their scope and competence, software developers should be able to recognise the type of problem and the best suited methodologies and development models for it and finally software developers should be aware of time, cost effectiveness and quality throughout development process.
    With this pointers we are ready to draw out the required attributes in order for Software Projects to succeed.

  1. Accepting projects within your scope and competence: As i said earlier, a lot of developers take on works that are beyond their competence. This can really be a career ender because one will start working on a project and later realize that he does not have the required skills and in order to acquire the skills, a lot of time will be wasted and in turn failure to deliver product when expected. So i really advice, before you start any project analyze all skills required to work on it, and if you do not have at least 80% of those skills, do not accept it.   
  2. Comprehension of a Project: Most developers do not pay attention to clients when they lay down their specifications of what functionalities they need the software to provide. This is a vital requirement because without fully recognising who the client is and understanding what the client wants, the whole project will be in jeopardy because development will head in a total different direction leading to its failure.
  3. Knowing the right methodologies and development models to apply: This is a must for every developer, without knowing the right tool for the job, development can really be time consuming, ineffective and waste of resources which will then lead to the project failing. For instance, know when to reinvent the wheel and know when to reuse. Prototyping and incremental development are a very effective methods to apply to development compared to methods such as the waterfall model because, at any instance of time, one has a working product and this can really be a good in terms product delivery and progress measurement.
  4. Laziness is a Virtue: This was said to me by one of my colleagues, a brilliant mind. Come to think about it, lazy developers tend to be more effective and productive because they are always trying to find ways to minimize workload and this can lead to reuse of already existing tools, finding the most effective yet short approaches to problem solving and reducing the complexity of a system by a large degree.
  5. Finishing a project before starting the next: A lot of us think we are supermen and can handle multiple projects simultaneously. Even though some succeed in this, it is a really bad idea in terms of lack of concentration leading to increase in development time and the inability to complete either project. It is a really good practice to put time constraints on each project, this will help you to concentrate on everything needed for the development of one project without having to worry about the progress of others. This will help you deliver as much products in short period and also reduce task conflict.
By practicing this, you should be able to start a project, keep it alive and deliver the end product in time without losing interest or having any sort of conflicts and distractions.  

Thursday, August 1, 2013

Recursion: Divide and Conquer method

Recursion by a simple definition is the event when a function contains a call to itself. This method of solving problems  as i stated above is the divide and conquer method, we basically take a problem, divide it into smaller segments of it self and solve it mostly using the same algorithm and then combine those solutions back together.

Why is recursion important? 

I have asked and been asked this question a lot of times, and i will try to answer to the best of my knowledge.
First of all, some will say it is easier to use iteration instead of recursion and sometimes it is more effective since recursion can take a lot of memory and time when it gets too deep. But there are some scenarios and problems such as:

  • Iterating through linked list, binary trees, and some other level based data structures.
  • Searching games and exploring possible scenarios such as in chess, checkers etc.
  • Searching files in different locations in a system (i.e recursion can get to the root)

Recursion is your best solution for this type of problems, since it moves from one level to a deeper level till it gets to the root then comes back with or without a result, using a single algorithm that is called over and over again. Writing algorithm for this in an iterative manner can really get complicated.
Of course recursion is not normally easy to comprehend and can be confusing because of the inability to visualize the levels and what happen at each level, but once one understands the concept behind recursion, it is really fun and time saver.

There are two major segments of recursion one needs to know;

  • Termination segment, and
  • Call to itself 

this two have to be considered, when to terminate recursion is very important because if it is not dealt with, it can grow and fill the memory until there are no more space causing the system to terminate and also lose of data.

Examples:

The most popular problem solved recursively is finding the factorial of a number
e.g (5! = 5x4x3x2x1). solution in C:

int factorial(int number){

//termination segment
 if(number == 0 || number ==1){
   return 1;
 }

//recursion: calling itself in a deeper level
 if(number > 1){
   return number * factorial(number - 1)
 }
}

Also another example can be writing a Fibonacci function recursively.
Solution in Python:

def fibonacci(number):

#terminates when number is 1 or 0 returning the number
 if number < 2:
   return number

#compute the fibonacci sequence
 else:
   return (fibonacci(number - 1)+fibonacci(number - 2))

Another example can be searching for an element in an array.
Solution in Java:

// we pass the array, the value to be searched and the// position is returned, initialized to zero
public in search(int array[], int value, int position){
 if(array[position] == value){
   return position;

//as long as we have not reach the end //of array, we keep searching
 } else if(position < array.length){
   search(value, position + 1);
 }

// returning -1 when not found, Note: i used -1 because// index of an array starts from 0.
 return -1;
}


Leave your comments below if you found this materail to be helpful and ideas on what you will love to see in one of my series. Have fun hacking.