19
Bikonja
7y

So I just created a function called GetMinutesFromMinutes... It actually makes sense and I'm not sure if that makes it better or worse :)

Comments
  • 1
    It should :)
    I neee to represent time in separate hour and minute variables, but also as minutes from midnight so that's the conversion from minutes from midnight to minutes within the hour and theres also a GetHoursFromMinutes function
  • 6
    @libcmg well of course it is, who doesn't comment code? *Runs to add comments in code* :D
  • 2
    Maybe getDayMinutesFromHourMinutes would be clearer...
  • 0
    @spongessuck dashes in function names? Never seen that before... But I like the concept, a little lengthy, but still acceptable and a bit clearer
  • 2
    @Bikonja Where you see dashes?
  • 1
    @Bikonja And if you have an IDE with autocomplete you only have to type it once 😜
  • 1
    @spongessuck huh, Android version automatically adds dashes for wrapping I guess...
    And it's JS so if someone makes an error it probably won't be visible until runtime so it would be nice to keep it as simple as possible, regardless of any help from an IDE.
  • 2
    @Bikonja @libcmg in my company it is forbidden to comment code.... Architecture says the methods name should be self explanatory, this would be something like getMinutesAfterMidnightFromMinutes()
  • 1
    @krlooss Utter nonsense, while it's true code should be self explanatory comments also help to explain things at a glance.
  • 1
    @nblackburn @krlooss totally agree, code should be self-documenting, it shouldn't do so at the detriment of everything else... Sometimes you would need an extra long name, sometimes you couldn't optimize things properly with making the code readable, sometimes you can even have conflicting problems with self-documenting code like verbose code that has a huge block so you don't see what the braces are closing (so write a comment to make it easier to see) or make the code compact, but therefore less readable (tbf, usually still readable enough, but still)...
Add Comment