Hacker News new | ask | show | jobs
by realSlavojTrump 2512 days ago
As mindfulgeek mentions, doing some sort of extract method refactor to slop a name onto it can be a good first step. Then do some sleuthing thru other number name pairings, inserting names in place of the numbers, until you have a solid grasp of what the names should actually be. Feathers in Working Effectively With Legacy Code brings up a concept called seams... u can insert a seam to map to objects and then do object manipulations with polymorphism.

Iirc that particular bit of code is the power logic. You can file an issue on my fork if ys like me to write more on this when im not on a broken phone.

1 comments

https://github.com/polytomous/TerrariaClone/issues/6 gives an example of how i work thru this sort of question, but its also spoiler laden so view at your own risk.