Geeks With Blogs

Michael Freidgeim's Blog MS .Net Development

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 on Saturday, September 3, 2011 10:13 PM Blogging , General Tips | Back to top

Comments on this post: Put reusable code into libraries to share between projects

# re: Put reusable code into libraries to share between projects
Requesting 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.

Left by Keith Nicholas on Sep 06, 2011 11:29 PM

# re: Put reusable code into libraries to share between projects
Requesting Gravatar...
well said!
Left by JAA on Sep 09, 2011 3:11 AM

# re: Put reusable code into libraries to share between projects
Requesting Gravatar...
Keith, you hit the nail on it's head!
Left by Na on Sep 13, 2011 10:16 AM

Your comment:
 (will show your gravatar)

Copyright © Michael Freidgeim | Powered by: | Join free