Put reusable code into libraries to share between projects

I’ve recently read the post The Mooney Project » Reusable Code Is Bad.

Also I disagree with the title of the post, most of the issues in the text are valid and important.
Mike Mooney is mostly talking of creating customizable applications, that have hundreds of configuration settings.
Most close to my opinion is a comment from Geoff H
 

Design libraries for reuse, glue code to bind together, and logic code to call libraries through the glue.

When I am writing  an individual method, I am asking myself, how generic is the logic, is it only be useful for this feature, or to different parts of my application, or can be used as an extension of .Net framework.  Depending on this , I will move the common logic to one or another of my libraries. Sometimes, when I will looking to which class/dll should I add this new method, I will recognize, that our library already has the same or very similar method, and I don’t need to write it again.

posted @ Saturday, September 3, 2011 10:13 PM
Print

Comments on this entry:

# re: Put reusable code into libraries to share between projects

Left by Keith Nicholas at 9/6/2011 11:29 PM
Gravatar
reusable code is good... if you can't create reusable code simply and easily, then you've still got things to learn about how to design effectively.

its interesting, people get to a certain point in their career and they think they have a good grip on creating software, but still struggle to design code effortlessly.

mostly we just need to practice.

A lot of people I see struggle with these issues only ever try and work them out on actual projects. They make a bit of a mess, the project suffers, you come to a conclusion trying to make reusable software is skewing things, people are making things too configurable complexity is rising, blah blah blah. So they adopt a more measured pace suitable to their level of capability (which is beyond noob, but perhaps isn't as advanced as they think they might be)

None of these things are necessarily true of creating reusable software when you do it well.

One of the most useful things is to practice these things separate from production code. Throw it away, do it again. Throw it away do it again. Throw it away, do it again in a different language. throw it away do it again in another language, throw it away, do it again in the original language.

practice practice practice.... once you go through this process enough times you start seeing how code needs to be expressed to easily reuse it. Often the things that need to be understood are subtle. Then what once seemed hard is now easy and natural.

# re: Put reusable code into libraries to share between projects

Left by JAA at 9/9/2011 3:11 AM
Gravatar
well said!

# re: Put reusable code into libraries to share between projects

Left by Na at 9/13/2011 10:16 AM
Gravatar
Keith, you hit the nail on it's head!

Your comment:



(not displayed)

 
 
 
 
 

Live Comment Preview:

 
«October»
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678