but it feels good

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

but it feels good

glen ep ropella
https://changelog.com/posts/why-do-so-many-developers-get-dry-wrong

> Once you eeked out enough XP to reach Level 2, condensing that copy pasta down felt amazing. Suddenly your code looked more impressive. Efficient! Clean! Simple! This is like the lowest common form of refactoring. But it feels good…
--
glen ep ropella 971-599-3737

============================================================
FRIAM Applied Complexity Group listserv
Meets Fridays 9a-11:30 at cafe at St. John's College
to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com
archives back to 2003: http://friam.471366.n2.nabble.com/
FRIAM-COMIC http://friam-comic.blogspot.com/ by Dr. Strangelove
Reply | Threaded
Open this post in threaded view
|

Re: but it feels good

Marcus G. Daniels
Bugs are often introduced during the maintenance of code.   Here's a trivial example.  In code that isn't factored, it is common to see large conditionals like this:

If (so-and-so) {
   A few hundred lines of stuff, A
   Something unique, X
   More stuff, B
} else {
   A few hundred lines of stuff almost like the ones above, A'
   Something else unique, Y
   More stuff B'
}

Now random developer looks for X, e.g. a diagnostic message they saw in their JIRA tasking, and fools around with the code above it.  Unfortunately their fix ignored the other common mode of use that involves Y that needs to do the same things.   The developer gets the behavior they want for their test case, and goes back to look at Instagram.     In fact A should equal A' and B should equal B'.   The fact that the code structure even allows this edit (as opposed to, say, being a high-order function) is careless, even though it may "build trust" or "foster team spirit" to tolerate it.  

I don't think it is really that common that people doing refactoring change code of a colleague written as above.   Usually when these changes happen it is because the code has been abandoned and no one even remembers it is there.   It's like cleaning up garbage blowing around in the park.   Sure there will be people that will be alarmed just with the *idea* that the commons is changing.   Argue with them and make them tired, or disable their commit messages until the deed is done.  It's not like they'll ever look.  

Marcus

On 2/14/20, 8:16 PM, "Friam on behalf of glen e p ropella" <[hidden email] on behalf of [hidden email]> wrote:

    https://changelog.com/posts/why-do-so-many-developers-get-dry-wrong
   
    > Once you eeked out enough XP to reach Level 2, condensing that copy pasta down felt amazing. Suddenly your code looked more impressive. Efficient! Clean! Simple! This is like the lowest common form of refactoring. But it feels good…
    --
    glen ep ropella 971-599-3737
   
    ============================================================
    FRIAM Applied Complexity Group listserv
    Meets Fridays 9a-11:30 at cafe at St. John's College
    to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com
    archives back to 2003: http://friam.471366.n2.nabble.com/
    FRIAM-COMIC http://friam-comic.blogspot.com/ by Dr. Strangelove
   

============================================================
FRIAM Applied Complexity Group listserv
Meets Fridays 9a-11:30 at cafe at St. John's College
to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com
archives back to 2003: http://friam.471366.n2.nabble.com/
FRIAM-COMIC http://friam-comic.blogspot.com/ by Dr. Strangelove