Email or username:

Password:

Forgot your password?
Johannes Ernst

What's the best approach to large-scale code #refactoring that you know? Start somewhere, commit frequently, and hope for the best? Is there something better than that?

7 comments
🍄🌈🎮💻🚲🥓🎃💀🏴🛻🇺🇸

@J12t *test frequently, commit when you're done. If it's a particularly big job I'd consider codemods. github.com/facebook/jscodeshif

Johannes Ernst

@schizanon I'm looking for higher-level approaches than syntax-level. Like moving from one framework to another, or from/to a relational db to/from some other kind of db. Or splitting a monolith into microservices or such.

🍄🌈🎮💻🚲🥓🎃💀🏴🛻🇺🇸

@J12t functional end-to-end integration tests, and lot of them!

[DATA EXPUNGED]
Indieterminacy

@J12t Documenting inside the coding prior to touching the code, with (uncommitted) tasks and opinons inside it.

It provides more of a historical overview of the coding as it (eventually) changes, as well as reminds oneself and others of the forgotten facets; justifications; and functionalities.

Otherwise starting with a blank file, which has a strong delineation:
* Do I copy the entirety of the function?
* Does this function need adapting?

It forces the hand across the ecosystem esp wrt cruft

@J12t Documenting inside the coding prior to touching the code, with (uncommitted) tasks and opinons inside it.

It provides more of a historical overview of the coding as it (eventually) changes, as well as reminds oneself and others of the forgotten facets; justifications; and functionalities.

Otherwise starting with a blank file, which has a strong delineation:
* Do I copy the entirety of the function?
* Does this function need adapting?

Go Up