Hacker News new | past | comments | ask | show | jobs | submit login

Not copying and pasting that code chunk and wrapping it into a utility function :red-flag: :red-flag: :red-flag:



It's a contrived example, as I say. The point is constructing intervals and doing the interval range checks requires importing those functions everywhere and constructing shape objects for them to use. Don't read the code literally.

Obviously you can wrap them in a your own interval function which does the same thing. So like:

  function myOwnIntervalBetweenFunction(date, offsetBefore, offsetAfter)
Which is more hygienic but my point is I don't have to do that with Ruby ever.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: