Art of software dovelopment and practices

Well,its been some time since i penned for my blog. But better late than never… I came across a issue  which was quite interesting. It had atleast 5k loc, which i was wondering like wat made the previous developer to code so much for a functionality,after all 5k is some amout of code right?   Initially when i went through the code i was kind of felt that  previous developer has compromisd with the OOP concepts ,and after understanding the code completely i felt like both the design and OOPs principle is compromised.

Now the problem is quite simple which involves checking for some elements if its same and offcourse the data is quite a lot, again the way the data objects were designed is some thing which i wanna forget as soon as possible. I think this code is the perfect example for “code smell” (any thought work guy will agree with it once he goes through that code :p)

So the problem is as simple as this , it has N number of  data objects of set x and N number of objects of set y. it needs to be just verify if these data is same and there is certain constraints like say if some option is checked (ie in checkbox) or if some option is selected in the combobox , only that attribute needs to be verified.

So, when  i am given to code , first and foremost thing i  think is about the data structure of the data object. secondly  the algorithm to use which results in maximum performance and least cost of both memory and CPU time , which is directly proportional to the number of passes you take to verify.

As the basic task is to just verify i would have used some generic algorithm which verifies any kind of data, (I would like to keep the explanation simple as i will be writing an algorithm in my next post).

secondly when there is a constraints, one thinks of using series of  “If else ” conditionals , but offcourse your code clutters and i personally feel the “if else” conditionals is just too much for say N number of conditonals, and its bound to change later , so its important to use an “if else ” breaker design pattern🙂

The design  abstract is some thing which is a combination of  a proper use of data structure + verifying algorithm + “if else ” break design pattern thats it and  if required we shall refactor the code once its done.

In my next post i will device both the algorithm and code in either java or groovy or python.

The main purpose of this title is because i had lots of questions which needs to be answered. they are as follows:-

  1. why developers wont follow the proved practice and why the management wont encourage to go with the proper design and allocate enough time for the same?
  2. why the OOP concept is compromised?
  3. why people just give excuses when asked about the good design and coding standards?
  4. Is management just worried about the productivity and is  the good design and proved software development practices a cost we pay for it ?
  5. Do the  management think about the maintenance problems with such a haphazard design?
  6. Is the concepts of “software engineering” and “system analysis and Design” which we studied is just meant for exams ?
  7. should Project managers(technical managers who review it ) be blamed for it or is it the software engineer responsible for it.
  8. In spite of knowing the repercussions of the bad design and horrible coding standards why many well known product based / service based companies dont bother to give importance to it?

Still i cant think of any answers for these…..

4 Comments

  1. Hi ranganath , The questions that you have pointed out are suspicious . I dont agree with all. Infact not all the “company” will allow you to do such things.
    For the question 1-> Ofcourse you must adhere to their(Company) standards .

    2-> I never experienced like that !!! and in what sense you meant why the OOP concept is compromised?
    4 ->Yes management depends on productivity and not entirely depends on design pattern or standards only.
    and you can link your 5th questions and 3rd question….
    How can you assure that your design is 100% liable to your code ? This question is might be or might not be . Eventually your superior will take the decision .
    And not all the company will maintain good coding standard or design pattern . Well,I preferably do System Analysis and design and then code. And i think once you got the requirement first thing you gonna do, is to design right ??

  2. The questions that you have pointed out are suspicious
    >> “suspicious” …. what do u mean?

    For the question 1-> Ofcourse you must adhere to their(Company) standards .
    >> what is company standards? is it hapazard coding to have say n number of repeated code and not to reuse the existing code? if its the case i pity that company..

    2-> I never experienced like that !!! and in what sense you meant why the OOP concept is compromised?
    >> If you havent experienced , you are lucky.. but thats the case as far as my experiences go..well as far as the comments over oop concept is concerned, its just sticking to the code reusage and proper encapsulation, inheritance, overloading and not having a lengthy and redundant code and the list goes on and on..

    4 ->Yes management depends on productivity and not entirely depends on design pattern or standards only.
    >>I never said that management shouldnt depend on productivity, offcoz its the key and management should think about productivity but what i mean in my writeup is that it should not be at the cost of good quality design and code.

    you can link your 5th questions and 3rd question….
    >> this doesnt make any sense to me

    How can you assure that your design is 100% liable to your code ?
    >>It has to adhere to the requirement and thats the characteristic of a good design..

    And not all the company will maintain good coding standard or design pattern
    >> Now that is what the issue all about? why the hell all companies dont maintain good coding practices?

    Well,I preferably do System Analysis and design and then code. And i think once you got the requirement first thing you gonna do, is to design right ??
    >> you do it and its good for you. My concern is about the whole lot who dont believe in doing it and they believe the software development is all about if… else .. for.. while switch……..

  3. suspicious — > NOT AS EXPECTED , i meant that .
    Again you are relaying on what you have experienced in your company , be praticle…
    company standards doesn’t anywhere mention that you have to use repeated codes .. Does standards says that !! ….
    No one follow 100% of OOP . Not even you when you start new project . Even if you follow 100% OOP in your project , your subordinate wont agree , coz he might be having his own idea of design.And I am also not preventing you to follow it either.
    your 3rd and 5th questions are almost same.
    And how can your assure that your design is well adapt?
    According to your post you are just emphasizing your experience . And that doesn’t reflect to everyone. As per my company , I just dont do if-else or switch , I sometimes do UML too .
    I agree with some points but not all.

  4. I think you are completely misreading my write up. i have not targetted any x y z company. its completely based on the personal experience and the post is for those companies which isnt practicing the good practices, thats it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s