DEV Community

Discussion on: Confidence level. Do you trust devs that extract duplicated code to funtions by hand instead of using IDE support?

Collapse
 
mohr023 profile image
Matheus Mohr

It's kinda natural if it's a technology/language you don't fully understand (for instance, trying to refactor code that uses a library you don't know, unless you take your time and understand it, you'll probably leave/delete a line that will unleash havoc in your software).

One of my usual ways to refactor "on-the-go" is to completely extract a code block, using IDE or not, and as I test, refactor that code block. That way I usually avoid mistakes like that and also stay productive, since the tests itself usually help me understand the flow my code should have.