Refactoring

Geoff Canyon gcanyon at gmail.com
Fri Jan 30 04:33:23 EST 2015


To me the three line version is far more clear than the ten line version.
Shorter wasn't my goal, just (in this case) a really good indicator of the
improvement in clarity.

On Thu, Jan 29, 2015 at 11:51 PM, William Prothero <prothero at earthednet.org>
wrote:

> Nice, but personally, I value clarity much more than I do brevity.
> Re-factoring is much, much more than brevity of code. When I work, I
> generally code, it’s spaghetti, then I re-write it. The more i re-write for
> simple, predictable functionality for each method, the easier it is to
> debug and change later on. Unfortunately, as the project nears completion,
> I get less patient and the quality of the code goes down as I cut corners.
> Oh well.
>
> Regards,
> Bill
>
> > On Jan 29, 2015, at 1:29 PM, Bob Sneidar <bobsneidar at iotecdigital.com>
> wrote:
> >
> > The code 10 years from now:
> >
> > scanMind(currentThought, currentObject, applyNow)
> >
> > All the code you will ever need.
> >
> > Bob S
> >
> >
> > On Jan 29, 2015, at 09:29 , Geoff Canyon <gcanyon at gmail.com<mailto:
> gcanyon at gmail.com>> wrote:
> >
> > Small thing, but I just turned this twelve-year-old code:
> >
> >     put "Double-Click:" into tProperty
> >     if the optionKey is "down" then
> >        if the commandKey is "down" then
> >           put "Option-Command-Double-Click:" into tProperty
> >        else
> >           put "Option-Double-Click:" into tProperty
> >        end if
> >     else if the commandKey is "down" then
> >        put "Command-Double-Click:" into tProperty
> >     end if
> >
> > into this:
> >
> >     put "Double-Click:" into tProperty
> >     if the commandKey is "down" then put "Command-" before tProperty
> >     if the optionKey is "down" then put "Option-" before tProperty
> >
> > I love turning ten lines of code into three lines of code. I hope twelve
> > years from now I can look back at those three lines with the same degree
> of
> > horror I feel now looking at the ten-line implementation.
> >
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list