Algorithm Design A Call For Concern To Software Engineers

Algorithms in its entirety are often misunderstood and misinterpreted by most of the software engineers or developers. Technically every software or program you develop does use an algorithm and in most cases brute-force that is the obvious solution and at times the easiest. In computer science and software engineering, the concern is in solving problems and any problem that needs to be solved requires a solution in a finite amount of time and using the smallest amount of resources as possible.  In this post is the discussion about the importance and need for a software engineer to be able and capable of designing a good algorithm in his or her software development lifetime. This post will also go further to demonstrate on the side effects that you as a developer have without basic knowledge of algorithms,
 the software that you build and the community that uses the software you build.

Importance of good algorithm design.


  1. Algorithm design is important because They make your program fly, by fly we mean the experience your users will perceive when interacting with your program will be amazing. You will also have a reduction in cost(in terms of money and resource ie money you will otherwise use for purchasing high-cost equipment to gain the advantage the efficient algorithm brings
  2. With good algorithm design, you are also certain of the correctness of what your algorithm or program does. You can at any point in time say with certainty what your program is doing and whether it is doing it correctly
  3. You are also going to be able to have an improvement in the efficiency of your program if it is well designed. At this point of efficiency, you can be sure of the time consumptions by your program the memory consumed and the power it consumes. 
As an example let below are three different pseudo code that multiplies two numbers 


function naive(a, b):
    x = a
    y = b
    z = 0
    while (x > 0):
        z = z + y
        x = x - 1
    return z
function obvious(a,b):
     z = 0
     while (a >0)
       z += b
       a--
     return z
function bitwise(a,b):
    x = a; y = b
    z = 0
    while (x > 0):
        if x % 2 == 1:
           z = z + y
        y = y << 1
        x = x >> 1
    return z
    Generally we know multiplication is continuous adddition. which means
a*b = a+a+a+...+a  btimes
In terms of readability and understanding the first and second algorithm can be straight to the point but the third which does the same thing is a little complex as it involves bitwise manipulation With bigger values the first and second algorithm executes in order of seconds but the third will run in maximum milliseconds meaning it won't even reach 1 second.
The algorithms above can even further be improved to use divide an conquer but as this article was not about analyzing algorithms I will end here with this analysis You can check my next article on the analysis of algorithms for detail explanations of the above algorithms.  So noticing the big difference in the runtime of the two algorithms that do multiplication. it will do you much good to go with the one that runs faster in this case as you benefit from speed.

To the developer/engineer

As a software engineer or developer, Not only does having the skills for developing algorithm important to the software that you build but it has a great impact on your personality and the way you do thins.
  • With this skill, you are going to gain a critical thinking ability which will otherwise won't have have been possible. You will find yourself solving problems you would have termed impossible just simply because you lack the mindset of thinking properly. This can go further to reiterate the reason why big tech companies will need you to go through a type of algorithm in order for you to gain employment with them. This is necessary because a keen look into the world now you notice everything is moving to the hands of the developers so even the lives of others are dependent on the actions and behavior of the software.

  • Algorithm design needs to be considered very highly by developers but its rather unfortunate and is the last thing that most newbies and some developers think of. These developers care less an example of such is someone who goes into web development and for example, using WordPress all he or she cares about is getting the website or whatever he or she wants out there by installing a thousand plugins some of them not even used and so long as he can install it he just pile them up. The resulting software becomes a junk of plugins and libraries That's if the choice of these were not well taken care of.  So it's not just about getting the work done but. Effects of poor algorithm and software design on Humans and society.
  • Good algorithm design spares you to time to carry out maintenance as well as the nightmare of rushing as a result of a phone call or notification due to a system crash or failure.

To society

The disaster caused by this can be enormous to the society since the day to day functioning of the society is entirely becoming dependent on software. A typical example will be 
  1. An inefficient facial recognition software used by the armed forces. This can lead to the software detecting a regular citizen as a criminal this is just for the minor case though there are worst scenarios that lead to death and more environmental disaster 
  2. Airplane crash. A malfunction in the software of an airplane will consequently result in a crash. software sending error signal in respect to airplane results in a crash.

There are even many other challenges that can result due to the poor design of algorithms and software.

Summary

The take-home message from this post is that developers and engineers should keep at the forefront of their software development skills the task of always developing even better algorithms and know software is not all about it working but a lot more is entailed. Better knowledge and application of algorithms will change the face of software development and developers as a whole. As a recommendation There are platforms that can shape the way you think, see, program and write code that conforms to algorithm best practices example of those are Hackerrank, Codechef, Kattis Topcoder, etc. As well as knowledge of mathematics will be very useful both of this help you reason and think about problems in a different way.

Comments

Post a Comment

Popular posts from this blog

Week Twelve

Week Eleven