Hacker News new | ask | show | jobs
by Pet_Ant 1832 days ago
I like to use the poop emoji in the names of methods that are dangerous hacks that we want to (eventually) get rid of.

Being harder to type is part of the point.

1 comments

Can't you just use poop emoji in comments and search for them like TODOs?
But then others won't feel dirty when they use the method. The goal is to make people feel bad when they add more usages of it and make it harder to remove. This is the case when it's easier and faster than the proper way. When there is crunch time it's hard to push your lead to reject the PR so it's soft pressure and it's apparent at the call site whereas a TODO in the method definition is not.
There is a famous story of a codebase that used `sleep` calls for this purpose. Start by sleeping 1 ms every time that the undesired function is called. Next release, up it to 10 ms, then 100 ms, and so on.
But that's method shaming! /s

I guess you have a point. It's clearly a "let's meet in the back alley" API.

Reminds me of Haskell's tendency to prepend "unsafe" (or, in one case where that was insufficiently dire, "accursedUnutterable"), although the use case is a little different.
I assume making the name of the function they want to eventually get rid of more annoying to type is part of the reason to do this rather than just tracking ones needing replacement.