Hacker News new | ask | show | jobs
by AstralStorm 3280 days ago
The suffix thing is generally a sign you're doing functional programming and should instead explicitly name the state if any is needed.

The problem with that idea is that it clashes with the OOP notion typical in languages like C++, Java, C# and so on. (Though it does make dependency injection and persistence of the state easier.)

Plus some names like "allocator" or "garbage collector" are ingrained in standard.

(FYI the state for an allocator could be a freelist, for GC could be a graph.)

1 comments

I got that advice from some talk about refactoring in OOP languages, as far as I can remember Manager and Calculator were the discussed bad class name examples, "what do you manage/calculate?". Explicitly naming things you operate on was part of the advice given in the talk.