- cross-posted to:
- programmerhumor@lemmy.ml
call_me_xale ( @call_me_xale@lemmy.zip ) 53•8 months agoBold of you to assume no one will come up with a replacement date library rather than just getting rid of JS.
__init__ ( @__init__@programming.dev ) 43•8 months agoIt’s javascript. We’ll have gone through 275,760 new datetime libraries before then, it’ll be fine.
towerful ( @towerful@programming.dev ) 5•8 months agoString based date processing
Redkey ( @Redkey@programming.dev ) 3•8 months agoOf course! There’s already a proposal for a replacement Temporal object.
katy ✨ ( @cupcakezealot@lemmy.blahaj.zone ) 38•8 months agoslides £20 across the table make it end tomorrow
ARk ( @ARk@lemm.ee ) 1•8 months agoreserve me tickets for the inevitable shit show that follows 🍿
EmergMemeHologram ( @EmergMemeHologram@startrek.website ) 37•8 months agoPartitioning 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 ) English10•8 months agoUm excuse me time actually already ended in 1991
interolivary ( @interolivary@beehaw.org ) 2•8 months ago schnurrito ( @schnurrito@discuss.tchncs.de ) 1•8 months agoNo, that was the world that ended in 2012.
rekabis ( @rekabis@lemmy.ca ) 2•8 months agoFun 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 ) 2•8 months agoMy 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 ) 1•8 months agoEven 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.
CanadaPlus ( @CanadaPlus@lemmy.sdf.org ) 1•8 months agoFor 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 ) 1•8 months agoYou 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.
interolivary ( @interolivary@beehaw.org ) 1•8 months agoplease 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 ) 2•8 months agoIt’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 ) 1•8 months agofor thousands of years dates counted upwards from a negative number
wat
14th_cylon ( @14th_cylon@lemm.ee ) 1•8 months agoboy do i have a bad news for you… https://en.wikipedia.org/wiki/Floating-point_arithmetic#Accuracy_problems
FiniteLooper ( @FiniteLooper@lemm.ee ) English19•8 months agoNo programming language should last 200,000 years
DudeDudenson ( @DudeDudenson@lemmings.world ) 8•8 months agoJavaScript shouldn’t have lasted as long as it has and it’s still used widely
30p87 ( @30p87@feddit.de ) 7•8 months agoC
viking ( @viking@infosec.pub ) 15•8 months agoWhat 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 ( @Redkey@programming.dev ) 4•8 months agoThe 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.
- shiveyarbles ( @shiveyarbles@beehaw.org ) 14•8 months ago
Cockroaches will go extinct before JavaScript is dead
Nailbar ( @nailbar@sopuli.xyz ) 6•8 months agoThe last cockroach writes an AI in JavaScript to carry on the legacy
Turun ( @Turun@feddit.de ) 12•8 months agoThat’s because this is the maximum integer that can be stored in a double precision floating point number without loss of precision, lol
interolivary ( @interolivary@beehaw.org ) 7•8 months agoThat’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
rekabis ( @rekabis@lemmy.ca ) 10•8 months agopast 13 September
Yes, but will that be a Friday??
interolivary ( @interolivary@beehaw.org ) 10•8 months agoI honestly don’t quite get why it’s so common to hate Javascript.
I mean, it’s not my favorite language to put it mildly (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, leading to some people to insist Javascript is kind of like Scheme and other people to insist 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 semantically 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, and PHP which is a practical joke that went too far and somehow managed to eventually convince people it’s actually a real language.
edit: oh and if you don’t know about INTERCAL, I can highly recommend checking out the the C-INTERCAL revision’s manual, which includes eg. a very helpful circuitous diagram and a logical table to explain one of its more odd operators. There’s also a resource page that’s maintained by one of the perpetrators of the C-INTERCAL revision.
__init__ ( @__init__@programming.dev ) 2•8 months agoThere are two types of languages: ones people bitch about, and ones no one uses
interolivary ( @interolivary@beehaw.org ) 1•8 months agoI dunno; people bitch about Haskell too
Alien Nathan Edward ( @reverendsteveii@lemm.ee ) 9•8 months agoI’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?
XTornado ( @XTornado@lemmy.ml ) 5•8 months agoToo far away for my comfort.
jadelord ( @jadelord@discuss.tchncs.de ) 5•8 months ago2036 to 2038 is gonna be wicked.
lugal ( @lugal@sopuli.xyz ) 4•8 months agoWe survived the 2000 crash, we will survive this
mckean ( @mckean@programming.dev ) 5•8 months agoWe definitely will not…
sergih ( @sergih@feddit.de ) 4•8 months agoI’ll open a bug report