logoalt Hacker News

Uvixtoday at 3:01 PM2 repliesview on HN

Why not leave your functions but have them invoke the libraries instead?


Replies

Neywinytoday at 3:51 PM

They weren't drop in replacements. They were actually easier. Made up example:

> setup_terminal(); enable_input(); while(...) inp = read_character(); .....

vs

> readline()

So yes I could've stubbed out the other stuff and replaced just one, but that's just adding tech debt

show 1 reply
spockztoday at 3:32 PM

It depends a bit. But it would now mean that there are multiple ways of doing the same. Call your internal function or call the library directly. You need to put up some linting around it that people only use your function or the library function.

Otherwise you may get that you have your function, you think everywhere is using it, you make it fix a bug. And poof, you introduced bugs at the other call sites.