Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In Germany, we say: <strong>The truth lies in the middle</strong></p> <p>You marked two extremes here, but they are a good start. When you are to low-level, you will win nothing. Your reusable code should be worth the effort. When it does something, a mid-class programmer can implement in 3-7 lines or in 1-3 minutes, it might not be worth it, unless it is really, really needed often!</p> <p>The other extreme is the generic SQL client. Of course, the reuse should not lay any burden on the user. That is a definitive no-no!</p> <p>In my opinion, you should think about your project and then have a careful watch, what parts could be needed in multiple situations. These are candidates for reuse. But there are also other factors, you should check the candidates against, before you make the code reusable:</p> <ul> <li>Will the extra effort (see below) be worth it? (3-7 liners!)</li> <li>Does it lay extra burden on reusers and/or users?</li> <li>How often will it be reused (estimated)</li> <li>Can I decide now? (You might not have enough experience right now -- then better delay it and implement some use-cases as standalone, before making it reusable)</li> <li>Can I really generalize all the details that much, that I can have one single code-line? Special cases can be the death of reuse ...</li> </ul> <p>You might find further factors. I wanted to give some adhoc examples.</p> <p>I think, "Think first" is the best rule of thumb for reuse ... and of course reuse needs much experience.</p> <p><strong>Also it needs extra effort:</strong></p> <p>That is a really main point, many people forget. <strong>Reuse does not come free!</strong> You have to pay for it.</p> <p>You have extra costs for:</p> <ul> <li>Extra guessing, how to make it really universal</li> <li>Extra-Asking all the potential consumers</li> <li>Extra-Documenting, since the consumers will only use it, when it really is simple to use</li> <li>Extra-Advertising, since potential consumers must know, that there exists something reusable and that is worthwhile to reuse.</li> </ul> <p>Also you have to establish a reuse-culture, what is not easy, since it goes against the fealings of plenty developers. All developers think that only them have found the holy-grail and only their code is good at all. So many people will be offended and resist reusing code. The resistence can be either open but also hidden to the bosses (which might be the worst). Also the management must be aware of reuse. Without management backup, you will not have a substantial reuse-culture in your company.</p> <p>So, there is a price-tag attached to it. But it is worthwile, when you manage to really pay the price!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload