16

You think arrays starting with 1 are annoying?

HA!

How about time in a day starting with 12?

12:00, 12:45, 1:00, 1:45,...,11:45, 12:00, 12:45, 1:00, 1:45, ..., 11:45, 12:00, 12:45, 1:00 again

What if arrays started with 12? I bet Americans would love that!
arr[12]=fuck
arr[1]=this
arr[2]=shit
arr[3]=!!!

Comments
  • 2
    Parsing time is a well-understood domain with existing libraries for most languages. Use them, and you will probably have little trouble.

    TRWTF are thos who need to reinvent that wheel every time—unfortunately, it is not well-understood by everyone.
  • 2
    Only Canadian arrays start at 1
  • 1
    Dates and times are always a PITA, and time zones just add to the misery.
  • 5
    @SevenDeadlyBugs I'm surprised they don't have that yet.. Probably stuck in their TODO list
  • 2
    @SomeNone it's bearable when you have tools to deal with that. It's another story when you need to parse/write those times manually, in comms
  • 5
    @SomeNone time is often read by humans. Libraries don't help with that. Americans just should learn to format time like humans.
  • 6
    @netikras Im so going to work on a library that introduces "imperial types" into programming... It will probably be a javascript framework called empire.js and all arrays will start at 0 but move in steps of 5 or better known as "one array" so if you allocate an array with 5 arrays length the last index will be 20! But if you want small step you can also use arr's which are half of an array so you can step by 2.5...

    It will be awesome
  • 2
    @Hazarth you clearly have too much free time on your hands :)
  • 2
    @Hazarth

    DO IT !

    Is there a way to support your master craft? ='D
  • 0
    @SomeNone You do realise that it won't help when dealing dates entered by Americans when working on proper date/time formats (e.g. UNIX)?
    Or even when dealing with datasets with such data?
  • 3
    @Hazarth i have the perfect tagline for the .io site. "Empire strikes back"
  • 0
    @Berkmann18 If the input data is inconsistent, I take great pleasure in not envying your task of engineering an algorithm to guesstimate which date format was used to enter that particular date…
  • 5
    And in dates, in c and js, years and days are the actual year and day, but month is 0-11.

    That is an interesting choice ;)
  • 1
    @Hazarth Don't forget the Real Array (1.25 times the array) and the Stack (4 arrays).
Add Comment