When using new syntax switch whole project at once

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the workflows category.

Last Updated: 2024-11-23

At some point in Ruby history, the normal way of writing hashes went from :key => value to key: :value. I was maintaining a legacy application and decided at the time to write all future hashes in the new format but leave existing ones intact (to save effort).

But years down the lane, this turned out to be a bad idea. Why? Because it became more difficult to do searches and replaces across the entire (now much larger) project, since I had to consider both cases in my regexes.

Also noisy future commits were created where a future linter fixed the remaining entities piecemeal as that file was edited.

Lesson

If you're going to change syntax style, change everything at once.