Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Funny, but incorrect?

Bespoke Plus is $5 and Pro is $15; there should be no check in the $5 line for Pro, OR if both lines are checked, the second line should be $10 and not $15.

As it is it means Pro is $5+$15=$20.



It depends a bit on interpretation: if you pay 15, you of course have also 5 fewer in your pocket, so the 5 fewer can be included in the 15 fewer, than it's correct.


  const originalDollars = 30;
  const myDollars = originalDollars - 15;
  const fiveDollarsLess = myDollars <= (originalDollars - 5);
  const fifteenDollarsLess = myDollars <= (originalDollars - 15);
  console.log(fifteenDollarsLess && fiveDollarsLess);
  // true


i disagree.

what you propose wouldn't make sense in my opinion, as its basically two consecutive boolean declaration

    $5 less = pocket - paid <= pocket - 5
    $15 less = pocket - paid <= pocket - 15


$15 less in the pocket is at least $5 less in the pocket.


Replies and downvotes mark a strong disagreement. So okay, my interpretation is not mainstream, but I still think it's a possible interpretation.

The difference in interpretation comes from the nature of "features": are they actions or verifications? A verification is (usually) idempotent / has no consequence on the state of the world, but an action isn't.

I read the lines as "takes $x from your pocket".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: