Bold of you to assume no one will come up with a replacement date library rather than just getting rid of JS.
JavaScript's days are numbered
Submitted 1 year ago by HKayn@dormi.zone to programmer_humor@programming.dev
https://dormi.zone/pictrs/image/f8960de0-6d3a-41da-b3dc-f26d646a0bf0.png
Comments
call_me_xale@lemmy.zip 1 year ago
__init__@programming.dev 1 year ago
It’s javascript. We’ll have gone through 275,760 new datetime libraries before then, it’ll be fine.
Redkey@programming.dev 1 year ago
Of course! There’s already a proposal for a replacement Temporal object.
LPThinker@lemmy.world 1 year ago
It’s not just a proposal, it’s already fully defined and almost completely implemented - I believe they’re just waiting on a standards update from ISO for time zone stuff.
towerful@programming.dev 1 year ago
String based date processing
pm_me_your_quackers@lemmy.world 1 year ago
cupcakezealot@lemmy.blahaj.zone 1 year ago
slides £20 across the table make it end tomorrow
ARk@lemm.ee 1 year ago
reserve me tickets for the inevitable shit show that follows 🍿
EmergMemeHologram@startrek.website 1 year 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.
chaorace@lemmy.sdf.org 1 year ago
Um excuse me time actually already ended in 1991
schnurrito@discuss.tchncs.de 1 year ago
No, that was the world that ended in 2012.
interolivary@beehaw.org 1 year ago
rekabis@lemmy.ca 1 year 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@startrek.website 1 year 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@lemmy.sdf.org 1 year ago
Even more fun: nobody can agree on how many their are, and mathematics is self-consistent regardless of if you assume some of them definitely do or definitely don’t exist.
CanadaPlus@lemmy.sdf.org 1 year ago
For all those who believe time is infinite please apply a logistic transformation to your dates.
In what unit? It’s 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@startrek.website 1 year ago
You can derive the date by first taking the smallest unit, checking if it makes sense, then moving to a bigger time unit iteratively until the date comes out right.
14th_cylon@lemm.ee 1 year ago
boy do i have a bad news for you… en.wikipedia.org/wiki/Floating-point_arithmetic#A…
interolivary@beehaw.org 1 year ago
please apply a logistic transformation to your dates
Which is definitely a totally normal and common day operation that people do with their dates
EmergMemeHologram@startrek.website 1 year 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.
xantoxis@lemmy.world 1 year ago
Also means you can’t reference anything earlier than the late Pleistocene.
sik0fewl@kbin.social 1 year ago
Nothing happens before c. 4000 AD anyway.
NegativeInf@lemmy.world 1 year ago
Sorry, that’s also wrong. The entire universe, in its current state, popped into existence last Tuesday. It’s been terribly inconvenient tho.
PunnyName@lemmy.world 1 year ago
GODDAMMIT
viking@infosec.pub 1 year ago
What people fail to see is that this is the largest date the API can store, not a magical cutoff date in the distant future.
You could create a date today and send it to the API, and it could potentially crash it, or create a buffer overrun.
Redkey@programming.dev 1 year ago
The definition of the Date object explicitly states that any attempt to set the internal timestamp to a value outside of the maximum range must result in it being set to “NaN”. If there’s an implementation out there that doesn’t do that, then the issue is with that implementation, not the standard.
FiniteLooper@lemm.ee 1 year ago
No programming language should last 200,000 years
normanwall@lemmy.world 1 year ago
[deleted]wreckedcarzz@lemmy.world 1 year ago
Replaced. Hotel? Trivago.
DudeDudenson@lemmings.world 1 year ago
JavaScript shouldn’t have lasted as long as it has and it’s still used widely
30p87@feddit.de 1 year ago
C
darcy@sh.itjust.works 1 year ago
there goes my plans to build a time machine in javascript
Gentoo1337@sh.itjust.works 1 year ago
Javascript 2 release date
Turun@feddit.de 1 year ago
That’s because this is the maximum integer that can be stored in a double precision floating point number without loss of precision, lol
interolivary@beehaw.org 1 year ago
That’s one thing that really bugs me about Javascript (weirdly enough I’m okay with eg prototypal inheritance and how
this
works, or at least worked before the bolted on classes that were added because apparently I’m like one of the dozen or so people who had no problems with those concepts). The fact that all numbers are floats can lead to a lot of fun and exciting bugs that people might not even realize are there until they suddenly get a weird decimal where they expected an integer
dadGPT@lemmy.world 1 year ago
please hide this. this is how john connor defeats skynet.
rekabis@lemmy.ca 1 year ago
past 13 September
Yes, but will that be a Friday??
Wogi@lemmy.world 1 year ago
That will be a Saturday
14th_cylon@lemm.ee 1 year ago
it may or may not be a monday - probably won’t. it will be monday based on the (4000 | year) => !(leap year) rule, but by the year 275000 the difference will be so big that i am pretty sure people will make more rules to solve that.
reverendsteveii@lemm.ee 1 year ago
I’ve got a bunch of freeze dried food from my backpacking days. Who wants to jump in on a business selling Y275.76K Survival Kits?
shiveyarbles@beehaw.org 1 year ago
Cockroaches will go extinct before JavaScript is dead
nailbar@sopuli.xyz 1 year ago
The last cockroach writes an AI in JavaScript to carry on the legacy
jadelord@discuss.tchncs.de 1 year ago
2036 to 2038 is gonna be wicked.
SuperJetShoes@lemmy.world 1 year ago
This will be a tough one to fix. There must be millions upon millions of embedded systems out there with 16-bit epoch burned in.
They’ll all be much tougher to find than “YEAR PIC(99)” in COBOL was.
Y2K wasn’t a problem because thousands upon thousands of programmers worked on it well in advance (including myself) we had source code and plenty of static analysis tools, often homegrown.
The 2038 bugs are already out there…in the wild…their source code nothing but a distant dream.
interolivary@beehaw.org 1 year ago
I honestly don’t quite get why it’s so common to hate Javascript.
I mean, it’s not my favorite language (I prefer type systems that beat me into submission) but as far as popular dynamically typed languages go, it’s not nearly the worst offender out there. Yes, lol, weird things equal weird things when you use
==
but that’s not exactly unique among dynamic languages, and some people couldn’t come to terms with it not being like Java despite the name so they never bothered learning how prototypal inheritance works, and also who the fuck needed bothnull
andundefined
when either of those by itself is already a mistake and introducing them to a language should be grounds for a nice, solid kick to the groin.But, warts and all, the implementations are generally reasonably performant as far as these things go, the syntax is recognizable because eg. braces are common whether we like them or not and notably also survives copy-pasting from eg. the internet or anything that doesn’t use the same whitespace you do, and it’ll happily let you write code in a quite multiparadigm way and leading to some people insisting Javascript is kind of like Scheme and other people insisting Javascript is nothing like Scheme.
So, shit could be worse. And by “shit” and “worse” I mean eg. Python, notable for achievements such as: being one of the first if not the first language with a designer who huffed enough solvents to think that significant whitespace is a great idea especially combined with no real standardization on whether you need to use tabs or spaces, and which often doesn’t survive being copy-pasted from the web and is a nightmare to format; being unable to actually run anything in parallel up until very recently because lol why bother with granular locking in the runtime when you can just have one global interpreter lock and be done with it; or being popular in part due to the fact that its FFI makes it easy to write modules for it in languages that aren’t a crime against common sense and can run faster and more parallel than an 80’s BASIC interpreter. And let’s not even go into the whole “virtual environment” thing.
So while Python’s not quite INTERCAL-bad, at least INTERCAL doesn’t have significant whitespace and its manuals are really damn funny.
And then there’s eg. Ruby, with 9999 ways to do everything and all of them so slow that it aspires to one day be as fast as INTERCAL.
tiny_electron@beehaw.org 1 year ago
This reads like a copy pasta
interolivary@beehaw.org 1 year ago
Mission accomplished
__init__@programming.dev 1 year ago
There are two types of languages: ones people bitch about, and ones no one uses
interolivary@beehaw.org 1 year ago
I dunno; people bitch about Haskell too
Asudox@lemmy.world 1 year ago
Well, I am comfortable leaving the upcoming disaster this will cause to the next generations.
sergih@feddit.de 1 year ago
I’ll open a bug report
TangledHyphae@lemmy.world 1 year ago
Be sure to cross-post it to the Usenet group for visibility.
lugal@sopuli.xyz 1 year ago
We survived the 2000 crash, we will survive this
mckean@programming.dev 1 year ago
We definitely will not…
Aux@lemmy.world 1 year ago
Speak for yourself, mere mortal!
psycho_driver@lemmy.world 1 year ago
Maybe by then my system will have recovered from this unresponsive javascript page
rockSlayer@lemmy.world 1 year ago
Well y275.8k will certainly be interesting
danc4498@lemmy.world 1 year ago
They’ll work on a solution in the year 275.799k
lars@lemmy.sdf.org 1 year ago
…written in ES5, Python 2 and mostly Rust++
Quoth_The_Revan@lemmy.world 1 year ago
It’s fun how oddly close that year is with 0°C in Kelvin: 273.15. Seeing 275.8K just instantly brought me back to chemistry…