DEV Community

Discussion on: Writing Clean Code

Collapse
 
gonedark profile image
Jason McCreary

Agreed about momentum and separate commit.

However, most of your points are moot when automating this process with a formatter/linter as suggested.

Collapse
 
joeymink profile image
Joey Mink

If it's a new code base or new file, agreed. But what about modifying a legacy file to introduce/change actual functionality -- the automated formatter/linter may obscure the actual changes with a complete reformat, correct?

Thread Thread
 
gonedark profile image
Jason McCreary

To your point, do it in a separate commit. Run the formatter/linter one time manually across the entire codebase. This will provide a basis (momentum) and from then on only changed files need to be formatted/linted (which could be automated).