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 Jtsummers

5 years ago

Their point seems to be in the mismatch of names. Imagine seeing this sequence, with names instead of numbers:

  switch(HTTP_METHOD) {
    case PUT: processPut(...);
    case POST: processPost(...);
    case GET: processDelete(...); // wtf
    case DELETE: processGet(...); // mate?
  }

To the reader that appears to be an error even if it is precisely the thing you want to happen.

0 comments

Jtsummers

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