Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by kelnos

1 hour ago

Because there's nothing inherently wrong with global variables. In small utilities like these, I would argue it would be less readable to do as you describe.

Sure, in anything larger, or anything that needs to be reentrant, global variables are going to hurt. But this is not that.

0 comments

kelnos

Reply

No comments yet

Contribute on Hacker News ↗

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities