Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement code in a manner that lessens the possibility of complete re-works [closed]

I had a piece of work thrown out due to a single minor spec change that turned out not to have been spec'ed correctly. If it had been done right at the start of the project then most of that work would have never have been needed in the first place.

What are some good tips/design principles that keep these things from happening?

Or to lessen the amount of re-working to code that is needed in order to implement feature requests or design changes mid implementation?

like image 201
Louis Avatar asked Jun 02 '09 00:06

Louis


People also ask

What is code reuse and why is it important?

Code reuse is the practice of using existing code for a new function or software. But in order to reuse code, that code needs to be high-quality. And that means it should be safe, secure, and reliable. Developing software that fulfills these requirements is a challenge.

What is the implementation of code of ethics?

Implementation of Code of Ethics. Codes of ethics are guidelines provided by business entities to communicate to the subordinates the beliefs, values, missions and overall perspectives of what the company or organization is about.

Why are the results of two different implementations of a program different?

If the results are different, then one of the two implementations is doing something wrong, and you must find which and why. Precision can change (the prototype can give you x = 1.8966 and the production code x = 1.8965), and the comparison should of course take this into account.

How do you implement a code of conduct at work?

Implementing a code of conduct. Implementing a code of conduct in the workplace involves communicating the policies and guidelines to all staff and providing any necessary training to ensure they understand the code. The code should be practised and promoted by management to lead the way for staff.


3 Answers

Modularize. Make small blocks of code that do their job well. However, thats only the beginning. Its usually a large combination of factors that contribute to code so bad it needs a complete rework. Everything from highly unstable requirements, poor design, lack of code ownership, the list goes on and on.

Adding on to what others have brought up: COMMUNICATION.
Communication between you and the customer, you and management, you and the other developers, you and your QA department, communication between everyone is key. Make sure management understands reasonable timeframes and make sure both you and the customer understand exactly what it is that your building.

like image 154
Corey Sunwold Avatar answered Sep 26 '22 00:09

Corey Sunwold


Take the time to keep communication open with the customer that your building the product for. Make milestones and setup a time to display the project to the customer at each milestone. Even if the customer is completely disappointed with a milestone when you show it, you can scratch what you have and start over from the last milestone. This also requires that your work be built in blocks that work independent of one another as Csunwold stated.

Points...

  1. Keep open communication
  2. Be open and honest with progress of product
  3. Be willing to change daily as to the needs of the customers business and specifications for the product change.
like image 21
Cimplicity Avatar answered Sep 26 '22 00:09

Cimplicity


Software requirements change, and there's not much one can do about that except for more frequent interaction with clients.

One can, however, build code that is more robust in face of change. It won't save you from throwing out code that meets a requirement that nobody needs anymore, but it can reduce the impact of such changes.

For example, whenever this applies, use interfaces rather than classes (or the equivalent in your language), and avoid adding operations to the interface unless you are absolutely sure you need them. By building your programs that way you are less likely to rely on knowledge of a specific implementation, and you're less likely to implement things that you would not need.

Another advantage of this approach is that you can easily swap one implementation for another. For example, it sometimes pays off to write the dumbest (in efficiency) but the fastest to write and test implementation for your prototype, and only replace it with something smarter in the end when the prototype is the basis of the product and the performance actually matters. I find that this is a very effective way to avoid premature optimizations, and thus throwing away stuff.

like image 27
Uri Avatar answered Sep 27 '22 00:09

Uri