| This is quite true. But it must be noted that the code may actually be bad.
Or it may be bad due to a thousand valid reasons (time pressure, business changes, etc) My personal approach is this: * Write new code must be "good" (Whatever that definition is) * As you iterate through old code, clean them up. For example our own codebase is several years old Nodejs project. Mostly written in callback style with `async.auto` and it's really ugly and hard to maintain comparing to async/await. All our new code uses promises and async/await. All old codebase uses callbacks. We have to use promisify a lot. But without any hiccups, we are slowly and slowly moving towards a better codebase. What helps "immensely" is tests. We have 2 different layers of test and I don't think anything would've been possible without them (although none of them are at 100% coverage. Nowhere near) |