On Friday 12 May 2006 17:01, Bèr Kessels wrote:
Op vrijdag 12 mei 2006 21:12, schreef Larry Garfield:
If you're doing that several times, that's a clear sign that you should be abstracting it. It makes the code easier to read later, too.
This is called DNRY Do not repeat yourself.
As soon as you have written a single line of code twice, you have done something wrong! Maybe not now, but certainly along the road.
Bèr
I refer to it as the Asimov Rule: The most unlikely number in the universe is 2. (If you write the same thing a second time, odds are you'll be writing it a 3rd, 4th, and 97th time, so generalize NOW before you go further.) -- Larry Garfield AIM: LOLG42 larry@garfieldtech.com ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it." -- Thomas Jefferson