News for hackers. Stuff that matters.
Re:Ask HN: How do you deal with legacy code? by SenHeng on Monday July 09, 2018 @11:26AM (#17490913)
I am currently converting a 4 year old Coffeescript codebase into modern Javascript. There are certain parts containing heavy use of super, lots of this and global variables from who knows where.

My solution is to ignore the parts that can't be easily fixed. List them up in an issue or ticket somewhere to fix later if necessary. For now, modernising the majority of the codebase is a more pressing issue than nitpicking preferences.

Re:Ask HN: How do you deal with legacy code? by pards on Monday July 09, 2018 @12:09PM (#17491268)
It's sad that a codebase that's only 4 years old is considered legacy. I really feel sorry for the project sponsors in this scenario who presumably paid good money for a solution that didn't stand up to the test of time.
Re:Ask HN: How do you deal with legacy code? by shoo on Wednesday July 11, 2018 @06:18AM (#17505750)
if you take Michael Feather's definition of legacy code as "code without tests", it's probably the case that someone in your org is producing some new legacy code this week ;)

on the other hand, sometimes in a startup-ish scenario it is optimal from a business perspective to bash out code to add features to drive revenue and worry about tech debt for the far future hypothetical scenario of the startup turning into a profitable business that can pay to bring people in to rewrite everything.

that is, optimal in the sense of the alternative being slowly writing very well thought out and engineered code and running out of money before having enough customers to justify a longer-term engineering focus