Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
 Kayn   ( @HKayn@dormi.zone )  to Programmer Humor@programming.devEnglish · 2 years ago

JavaScript's days are numbered

dormi.zone

message-square
39
link
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
412

JavaScript's days are numbered

dormi.zone

 Kayn   ( @HKayn@dormi.zone )  to Programmer Humor@programming.devEnglish · 2 years ago
message-square
39
link
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml

Source: https://en.wikipedia.org/wiki/Time_formatting_and_storage_bugs#Year_275,760

  •  EmergMemeHologram   ( @EmergMemeHologram@startrek.website ) 
    link
    fedilink
    arrow-up
    37
    ·
    2 years ago

    Partitioning by integer secobds is dumb.

    Just assign 0 to the start of time, 1 to the end of time, and every point between is represented by a double precision floating point number.

    For all those who believe time is infinite please apply a logistic transformation to your dates.

    •  chaorace   ( @chaorace@lemmy.sdf.org ) 
      link
      fedilink
      English
      arrow-up
      10
      ·
      2 years ago

      Um excuse me time actually already ended in 1991

      •  interolivary   ( @interolivary@beehaw.org ) 
        link
        fedilink
        arrow-up
        2
        ·
        2 years ago

      •  schnurrito   ( @schnurrito@discuss.tchncs.de ) 
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        No, that was the world that ended in 2012.

    •  rekabis   ( @rekabis@lemmy.ca ) 
      link
      fedilink
      arrow-up
      2
      ·
      2 years ago

      Fun fact: infinities can be different sizes, such that one infinity can be larger than another.

      They’re still infinities, with no end. Just of different absolute sizes. Fun stuff to rabbithole down into if you want to melt your brain on a lazy afternoon.

      •  EmergMemeHologram   ( @EmergMemeHologram@startrek.website ) 
        link
        fedilink
        arrow-up
        2
        ·
        2 years ago

        My nephew refuses to talk to me because of this.

        He said I smelled like farts, then I said he did times 10, he replied times a hundred, I pulled out the infinity card, then he replied with times infinity plus one, activating my trap card. I sat him down and for 90 minutes, starting with binary finger counting and Cantor’s diagonalisation argument, I rigorously walked him through infinities and Aleph numbers (only the first 2 in detail, I’m not a monster).

        Now he knows the proper retort (not infinity plus one, use Aleph 1). Unfortunately now he’s not sure if numbers are “real” or not because I taught him that natural numbers are the cardinal numbers.

      •  CanadaPlus   ( @CanadaPlus@lemmy.sdf.org ) 
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        2 years ago

        Even more fun: nobody can agree on how many there are (some people say none!), and mathematics is self-consistent regardless of if you assume certain ones definitely do or definitely don’t exist.

    •  interolivary   ( @interolivary@beehaw.org ) 
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      2 years ago

      please apply a logistic transformation to your dates

      Which is definitely a totally normal and everyday operation that normal people do with dates

      •  EmergMemeHologram   ( @EmergMemeHologram@startrek.website ) 
        link
        fedilink
        arrow-up
        2
        ·
        2 years ago

        It’s a little out of the ordinary for now, but for thousands of years dates counted upwards from a negative number, which this new method easily avoids.

        •  interolivary   ( @interolivary@beehaw.org ) 
          link
          fedilink
          arrow-up
          1
          ·
          2 years ago

          for thousands of years dates counted upwards from a negative number

          wat

    •  14th_cylon   ( @14th_cylon@lemm.ee ) 
      link
      fedilink
      arrow-up
      1
      ·
      2 years ago

      boy do i have a bad news for you… https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accuracy_problems

    •  CanadaPlus   ( @CanadaPlus@lemmy.sdf.org ) 
      link
      fedilink
      arrow-up
      1
      ·
      2 years ago

      For all those who believe time is infinite please apply a logistic transformation to your dates.

      In what unit? They’re not scale invariant.

      Also in case you’re serious, I’m sure (by the pigeonhole principle) you’ll run out of exponents just about as fast as you would run out of integers.

      •  EmergMemeHologram   ( @EmergMemeHologram@startrek.website ) 
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        You can derive the date by first taking the largest unit, checking if it makes sense, then moving to a smaller time unit iteratively until the date comes out right.

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 554 users / day
  • 2.07K users / week
  • 4.17K users / month
  • 8.21K users / 6 months
  • 447 local subscribers
  • 28K subscribers
  • 1.16K Posts
  • 18.9K Comments
  • Modlog
  • mods:
  •  Feyter   ( @Feyter@programming.dev ) 
  •  adr1an   ( @anzo@programming.dev ) 
  •  BurningTurtle   ( @BurningTurtle@programming.dev ) 
  •  Pierre-Yves Lapersonne   ( @pylapp@programming.dev ) 
  • BE: 0.19.13
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code