Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I Know I'm to blame - Code repitition

Status
Not open for further replies.

PaulF

Technical User
Jul 14, 2000
1,522
US
I am very bad, I don't sit down and do flow charts, I rely on my dwindling brain. However as I fumble along with code I find I end up with lots of duplicated code which I could condense into routines. After I realise my dilemma, I spend hours running through code doing searches on commonalities and grouping things up, only to then generate bugs man made. Is there any magic way to alieviate the problem. As I say I am the one to blame. Thanks
 
The best way I have found to approach this is to start over again every now and then. If you don't like the paper part of design work, it is the only way.

Also, just grouping things together because the code looks similar is a bad approach. Look at what the function is - if there is a logical function that is used in several places, then that should be a subroutine or function.

Also, try reading a book on structured design. I haven't looked at any lately, but there used to be whole shelves of them at Borders and Barnes and Noble.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top