Ad
  • Default User Avatar

    The same task with different starting and ending times would need to give those times as argument.
    The question is then what format use? Integer hour, Integer minutes, String, ... ?

    There's no point in making a function for any start and end when there's no specification about it, you would most likely have to rework the thing anyway.

    The function takes barely 1 or 2 minutes to write, if it has to be remake you didn't lose much.
    But if you write it to work as you said and the specification doesn't change then you lost way more time.

  • Default User Avatar

    This can be upvoted for "Best Practices" only when the numbers of hours tracked is low. Let's say we get the same task, but with 24 hours tracking, this type of code becomes pretty bad.

  • Custom User Avatar