lately i've been noticing this pattern a lot in classes where new keywords are used inside the constructor for what seems to be utility functions. ai picks up on it like hot stuff, recognizing that these should ideally come from injections rather than being instantiated internally.
the issue here is straightforward: while syntactically clean at first glance (or lack thereof), such patterns can lead to tightly coupled code down the line - making refactoring a nightmare later when u need changes.
do any of y'all have tips on how best to refactor these w/o breaking things? i feel like there's gotta be an elegant way, but every time it feels messy
full read:
https://hackernoon.com/code-smell-319-hardcoded-stateless-properties?source=rss