I graduated in 1990 in Electrical Engineering and since then I have been in university, doing research in the field of DSP. To me programming is more a tool than a job.
I do not have a "decision algorithm" for deciding if "factorizing out" a piece of code or not, but roughly I would say that I apply DRY if at least one of the following conditions is satisfied
The action has a meaning by itself. For example, the code necessary to download a file after authentication could be implemented as an independent piece of code.
The duplicated code is quite complex and long and/or the probability of updating it in the future are quite large.
Actually, sometimes I do kind of opposite and put in code procedures that are maybe just called once in to improve readability. Sometimes it can happen that a procedure is quite long and does lots of different actions; in order to make some "order" I split the code in different procedures (with nice descriptive names). In my opinion this makes the code easier to understand. This is quite convenient in Ada (the language I code with) since you can define procedures inside other procedures, limiting the visibility (and the need for hunting) of the "readability procedures."
I do not have a "decision algorithm" for deciding if "factorizing out" a piece of code or not, but roughly I would say that I apply DRY if at least one of the following conditions is satisfied
Actually, sometimes I do kind of opposite and put in code procedures that are maybe just called once in to improve readability. Sometimes it can happen that a procedure is quite long and does lots of different actions; in order to make some "order" I split the code in different procedures (with nice descriptive names). In my opinion this makes the code easier to understand. This is quite convenient in Ada (the language I code with) since you can define procedures inside other procedures, limiting the visibility (and the need for hunting) of the "readability procedures."
I also sometimes do/don't factor out a piece of code based on whether I have a good, obvious name for it.