Great Moments in JavaScript Web Design
-
While looking for a reference for a post in Great Moments in Responsive Web Design I came across this ... thing:
Try to navigate that with your mouse, and then realize this is from the same person who created JavaScript. All this Belgiumery around doors? It was always meant to be this way.
Look on his works, ye wtfers, and despair.
-
@Dreikin Because Chrome is f'ed on my machine when it comes to touch-capable sites, clicking doesn't work, but touch does. Whee!!!
-
@Dreikin ugh, it took me like a minute and a half just to figure out that I was supposed to arrow-key through it.
-
@anotherusername said in Great Moments in JavaScript Web Design:
like a minute
Hahah! Should totally open it in Kiosk mode and ask a few elderly to see if they can get it to do anything!
-
@Tsaukpaetra oh, I got it to do something easily enough. The only thing on the page that appeared clickable turned out to be a link to his Twitter handle, and it didn't even open in a new tab.
-
@anotherusername said in Great Moments in JavaScript Web Design:
The only thing on the page that appeared clickable turned out to be a link to his Twitter handle, and it didn't even open in a new tab
I did the same thing at first. If I hadn't known that was supposed to be a presentation, I would have just thought it was a static page with a link to twitter - and nothing else.
-
Easy enough. But then again, I have NoScript enabled.
-
@Lorne-Kates all the plugins you mention are unavailable in Android's default browser. And probably have bad usability in Android's firefox
-
@fbmac said in Great Moments in JavaScript Web Design:
@Lorne-Kates all the plugins you mention are unavailable in Android's default browser. And probably have bad usability in Android's firefox
Mobile? That's different.
-
Brendon Eich is another Jeff Atwood.
For JS not to have any of its problems it basically has to be another language. I am sick of web development, after this next contract I am doing something else.
-
@Dreikin said in Great Moments in JavaScript Web Design:
Look on his works, ye wtfers, and despair.
I see they've still not understood modules; they're still identifying them with particular locations (and names) of file.
Apart from that… just another person doing a presentation in a browser because they can, not because it is a good idea. There's a shit-ton of people infected with that particular brainworm, so it's hardly surprising.
-
@dkf said in Great Moments in JavaScript Web Design:
@Dreikin said in Great Moments in JavaScript Web Design:
Look on his works, ye wtfers, and despair.
I see they've still not understood modules; they're still identifying them with particular locations (and names) of file.
How should modules work? Like namespaces, which can be spread across different files?
@dkf said in Great Moments in JavaScript Web Design:
Apart from that… just another person doing a presentation in a browser because they can, not because it is a good idea. There's a shit-ton of people infected with that particular brainworm, so it's hardly surprising.
It's not the presentation in a browser that gets me, it's that it's completely unusable via mouse (unless you have noscript on, apparently) and that there's no hint that it's anything other than a static page. With a proper UI, presentations on the web seem like a good fit, to me.
-
@Dreikin said in Great Moments in JavaScript Web Design:
How should modules work? Like namespaces, which can be spread across different files?
I don't know how they should work in terms of implementation, but in terms of use you ought to be able to just say “I want the foobar library of version 1.2.3 or later compatible versions” and have the system figure out for you how it is going to satisfy that requirement.
-
@dkf said in Great Moments in JavaScript Web Design:
@Dreikin said in Great Moments in JavaScript Web Design:
How should modules work? Like namespaces, which can be spread across different files?
I don't know how they should work in terms of implementation, but in terms of use you ought to be able to just say “I want the foobar library of version 1.2.3 or later compatible versions” and have the system figure out for you how it is going to satisfy that requirement.
Ah, basically what NPM does for node projects? That seems interesting, but wouldn't that require centralization of that aspect of the web? Or is it meant to be more local than that?
I could definitely see one implementation being that browsers could cache a more limited set of frameworks by e.g., using an already-present version of jQuery that isn't an exact match if it's still compatible. So maybe not so much centralization as a new request method/protocol - specify library, source, and version spec. Something like
<script src="example.com/libs" lib="jQuery" version=">=2.0.0; <2.99; !2.0.5">
Although that's obviously HTML rather than javascript.
:mind_wanders_off:
-
@Dreikin it.... it rebooted my ipad!
-
@Dreikin said in Great Moments in JavaScript Web Design:
Ah, basically what NPM does for node projects?
Something like that maybe? I don't know.
That seems interesting, but wouldn't that require centralization of that aspect of the web? Or is it meant to be more local than that?
[Spitballing here…] I guess you'd pick which repositories of packages you use by some out of band mechanism (or rather a mechanism that you'd standardise outside ECMA, but set in stone differently for the web and node) but from the perspective of the script itself, it just says what it wants.
version=">=2.0.0; <2.99; !2.0.5"
Complex version expressions are typically a mistake. Everyone comes up with scenarios where they make sense, but they're completely unmanageable in practice (because typically the broken releases get introduced after the software is created). Just specify the minimum acceptable version and have everything beyond that up to the next major version be acceptable; it does 99.9% of what everyone needs for 0.1% of the complexity, and that's what I call a real win…
-
@dkf said in Great Moments in JavaScript Web Design:
typically the broken releases get introduced after the software is created
QFT. That's why version ranges never make any sense. Just specify the version you tested with, otherwise you're basically lying to your customers by claiming you're compatible with versions you've never tested and which might break your software. Even if the third-party package you depend on uses semver correctly (which is rarely the case), they might introduce regressions in a future version or you might depend on bugs or behavior that the API specification doesn't guarantee without knowing it.
The package manager might still decide to install the latest minor version then, but at least you clearly specified which version you actually tested with and the customer can roll back to that version if necessary.
-
I tried to open it on my iPad, it went to "a problem occurred on this page", tried to reload, did this several times until iPad Safari gave up.
Sounds completely accurate for JS at 20!!
-
asm.js was discovered
Ah yes, the scientific breakthrough of the decade! When a small, intrepid research team pushed their way into a previously untrod mountain in the antarctic, they found a temple inside waiting for them. The images were of creatures that provoked an innate, deep-seeded fear response in their minds ,driving them mostly mad, but the rubbings they took turned out to be ancient Sumerian which, when translated, turned out to be the source code to asm.js.
-
@asdf said in Great Moments in JavaScript Web Design:
That's why version ranges never make any sense
Weren't there a lot of issues with firefox plugins when they switched to the rapid release cycle where plugins had a maximum version that kept going out of date?
-
@asdf said in Great Moments in JavaScript Web Design:
QFT. That's why version ranges never make any sense. Just specify the version you tested with, otherwise you're basically lying to your customers by claiming you're compatible with versions you've never tested and which might break your software.
Don't look at a web.config in .NET website e.g.
<dependentAssembly> <assemblyIdentity name="Lucene.Net" publicKeyToken="85089178b9ac3181" /> <bindingRedirect oldVersion="0.0.0.0-2.9.4.0" newVersion="3.0.3.0" /> </dependentAssembly>
This is standard practice for upgrading web applications in ASP.NET
-
@Dreikin said in Great Moments in JavaScript Web Design:
With a proper UI, presentations on the web seem like a good fit, to me.
This brings back memories of around 2009, when Opera was the cutting edge of HTML rendering, they actually added a feature that let you use a different CSS stylesheet when the browser was in full screen, explicitly intended for making web presentations (i.e. you could have the page show as normal text, then press F11 and BAM, nice slideshow).
So 7 years later we still haven't learned.
-
-
@Dreikin said in Great Moments in JavaScript Web Design:
Ah, basically what NPM does for node projects? That seems interesting, but wouldn't that require centralization of that aspect of the web? Or is it meant to be more local than that?
For what it's worth, it is possible to create a fully decentralized repository of files that could be used as a "global library host" (though there are problems, like how to stop people from uploading 10TB modules and clogging the system). Not saying it's the best idea, just that it's not impossible.
-
@anonymous234 said in Great Moments in JavaScript Web Design:
So 7 years later we still haven't learned.
That could be said for most Opera (up to 12) features. These days even the Opera guys forgot. Well, apart form a few of them that went on to create Vivaldi (who made a different set of mistakes, IMHO).
Filed under: We
arewere the 2%!
-
@asdf said in Great Moments in JavaScript Web Design:
That's why version ranges never make any sense. Just specify the version you tested with, otherwise you're basically lying to your customers by claiming you're compatible with versions you've never tested and which might break your software. Even if the third-party package you depend on uses semver correctly (which is rarely the case), they might introduce regressions in a future version or you might depend on bugs or behavior that the API specification doesn't guarantee without knowing it.
No; you just ship the repository as part of the application. You don't (or at least shouldn't) need to put the repo online if you don't want to; for a complex system, packaging everything can make sense. OTOH, this vastly stiffens the application; if you've got unexpected bugs, or unexpectedly changing user expectations, your application has no chance at all to keep up.
Can't have one without the other; they are the flip-side of each other. I suggest avoiding packages whose authors have a tendency to fuck up. ;)
-
@Yamikuronue
They shouldn't have made mommy alien mad though
-
@Jaloopa said in Great Moments in JavaScript Web Design:
Weren't there a lot of issues with firefox plugins when they switched to the rapid release cycle where plugins had a maximum version that kept going out of date?
This was (is? I don’t know) a major issue with plugins for Apple Mail: that only allows plugins to run if they claim to work with the exact version of Mail being used, probably to avoid the plugins throwing unexpected errors, but I’d say for users it creates a lot more problems than it solves.
-
@lucas1 Why did Mozilla change their logo from the colorful, detailed and highly recognizable Dino logo-- into something that looks like a rejected "Default Anonymous" avatar from a Jurassic Park fansite's forum?
-
@Lorne-Kates No idea. Probably more flat design rubbish. I just remember at some point during 2011 the colour vampires seem to suck all the colourful sites off the net.
-
@Dreikin said in Great Moments in JavaScript Web Design:
If I hadn't known that was supposed to be a presentation
I didn't.
just thought it was a static page with a link to twitter - and nothing else.
Pretty much. Seemed to be that.
The phrase about navigating it (with the mouse) implied that... well, that whatever I could do with the mouse wasn't it. So it implied that there had to be something more. But... yeah.
@Mikael_Svahnberg said in Great Moments in JavaScript Web Design:
@Dreikin it.... it rebooted my ipad!
That's a feature!
-
@anonymous234 What's needed is a javascript TLD. I suggest something like http://java.scri.pt. This should run a web service, you send a request with a list of script name / version range pairs, it sends back customised javascript for your site.
-
You can kill older phones with by (ab)using the translate-z property in CSS3.
iPhone 3GS isn't exactly relevant now, but the number of bugs with iPhone 3GS because people put anything that might scroll onto the limited GPU where it would either lock the phone up or cause flicker (if you didn't put translate-z in the right order)
-
I'm not sure which came first, and I'm too lazy to look them up, but "Javascript at 20" sounds very close to "ff@20" from League of Legends. (In case you didn't know, it means to surrender as soon as the game allows [presumably because you're doing so badly, but can be too soon because some champions' power is after that point].)
This seems to me like a completely appropriate response to me, given this FROM HIS OWN PRESENTATION:console.log(isFinite("25")); // true
console.log(Number.isFinite("25")); // falseconsole.log(isNaN("LOL")); // true!?
console.log(Number.isNaN("LOL")); // falseI can't make sense of what he's trying to show. Were these functions moved into the Number (type/object/thing) ... with their functionality reversed? Or are there "global" and "Number." versions of the same function in the new version? I thought that JS tried to coerce strings to numerics if a numeric operation was applied, but if so, how could Number.isFinite("25") be false? isNaN("LOL")==true kinda almost makes sense, in a strict, literal, pedantic way, which is how good programmers should think, but again, why would Number.isNaN("LOL") be different?
-
@djls45 Those Number methods don't coerce to numbers; e.g. Number.isNaN(foo) will only return true if foo is a number NaN. The global functions are unchanged, so I don't know why the methods are even a thing. It's not like it was hard to do a typeof check if you really only wanted to run global isFinite on Numbers.
-
@Mikael_Svahnberg said in Great Moments in JavaScript Web Design:
@Dreikin it.... it rebooted my ipad!
My mini 4 (iOS 9.3.1) coped, and it turns out you don't need an sort of keyboard. A simple lateral swipe works to change pages.
I wondered a little about one of the JS code samples, though, using
let
as a keyword. Isn't that a bit BASIC? (I've used a selection of different BASIC interpreters, and whileLET
is normally optional, on the TRS-80 Color Computer's base interpreter, it wasn't recognised, and the Sinclair ZX-8[01] BASIC required it.)
-
@Steve_The_Cynic said in Great Moments in JavaScript Web Design:
I wondered a little about one of the JS code samples, though, using let as a keyword. Isn't that a bit BASIC?
It's declaring a different variety of variable with different rules. This worked ever so well with Perl5!!!
-
@djls45 said in Great Moments in JavaScript Web Design:
Were these functions moved into the Number (type/object/thing) ... with their functionality reversed?
no,
'25'
is something that can be coerced into a finite number so isFinite() returns true.
'25'
is not actually a number type thing (it's a string) so Number.isFinite() returns false'LOL'
cannot be coerced into a valid number so isNaN() returns true
'LOL'
is not actually a number type thing (it's a string) so Number.isNaN() returns falsesimple, no?
no, i don't know why the spec says the Number.* functions don't type coerce but the global versions do. if you know i'd love to hear it
-
@Steve_The_Cynic said in Great Moments in JavaScript Web Design:
using let as a keywo
ES5 introduced
let
andconst
keywords in strict mode as alternatives tovar
basically
let
is strict modevar
and is allowed to be reassigned,const
is strict mode constant, once assigned it can't be changed
-
@accalia said in Great Moments in JavaScript Web Design:
if you know i'd love to hear it
Seriously, I doubt there even is a better explanation.
-
@accalia said in Great Moments in JavaScript Web Design:
@djls45 said in Great Moments in JavaScript Web Design:
Were these functions moved into the Number (type/object/thing) ... with their functionality reversed?
no,
'25'
is something that can be coerced into a finite number so isFinite() returns true.
'25'
is not actually a number type thing (it's a string) so Number.isFinite() returns false'LOL'
cannot be coerced into a valid number so isNaN() returns true
'LOL'
is not actually a number type thing (it's a string) so Number.isNaN() returns falsesimple, no?
no, i don't know why the spec says the Number.* functions don't type coerce but the global versions do. if you know i'd love to hear it
So this is the function version of
==
vs===
? Yep, that's JavaScript. Or PHP, but probably JavaScript.
-
@Onyx said in Great Moments in JavaScript Web Design:
Seriously, I doubt there even is a better explanation.
yeah.....
JavaScript: A beautiful language, hidden under a pile of half thought out APIs and warts.....
-
@accalia said in Great Moments in JavaScript Web Design:
@Onyx said in Great Moments in JavaScript Web Design:
Seriously, I doubt there even is a better explanation.
yeah.....
JavaScript: A beautiful language, hidden under a pile of half thought out APIs and warts.....
Beautiful language? I thought it was a half-arsed imitation of Scheme made to look like Java pulled out of Brendan Eich's sleep-deprived mind on a ten-day coke-fueled bender at the height of the dot-com boom.
Still turned out better than PHP.
-
Re: the presentation.
The guy probably made that for his own consumption, so he could speak on a podium while pressing the arrow key to advance the slides.
People who use HTML slides instead of PowerPoint or Keynote usually do something special. Eg. fancy transitions or maybe an embedded code fiddle or something. Doesn't look like Eich did that, but then again I didn't scroll to the end.
TRWTF is this trend to spread around these slide decks from presentations without the spoken part. Like that can be of any use to anyone.
-
@Dreikin said in Great Moments in JavaScript Web Design:
Beautiful language?
yes.
@Dreikin said in Great Moments in JavaScript Web Design:
I thought it was a half-arsed imitation of Scheme made to look like Java pulled out of Brendan Eich's sleep-deprived mind on a ten-day coke-fueled bender at the height of the dot-com boom.
yes, but it got better.
well, not so much got better as we found the unintentional beauty hiding in it, you do have to ignore a lot in order to get to the good parts.
I mean this is clever and all, but wtf is going on here?
const elements = Array.apply(null, Array(Math.random() * 1e5)).map((_, i) => i + 1);
@Dreikin said in Great Moments in JavaScript Web Design:
Still turned out better than PHP.
yes, yes it did.
-
@cartman82 said in Great Moments in JavaScript Web Design:
People who use HTML slides instead of PowerPoint or Keynote
I can actually understand that. As someone who never paid for either (because I just don't have the need for an office suite that often), I was always a bit nervous carrying something made in Impress around since there was a non-zero chance of it blowing up in PowerPoint for example.
Now, you can say you can get stuck with a PC with only a crappy browser as well, but until relatively recently bringing a portable version of LibreOffice or something wasn't as easy as having portable FF or something. Nowdays the USB drives are easily big enough for that though.
-
@Onyx said in Great Moments in JavaScript Web Design:
I can actually understand that. As someone who never paid for either
Look at you, all coy, pretending never paid == never installed. Cute.
-
@cartman82 I said no lies in the post. I'm not confirming nor denying your statement either.
-
@accalia said in Great Moments in JavaScript Web Design:
well, not so much got better as we found the unintentional beauty hiding in it, you do have to ignore a lot in order to get to the good parts.
As documented in this historical pair of books:
(NB: I do actually like JavaScript, especially with many of the improvements that are supposed to be coming for it in ES6&7. I'd still rather a good vm though, and I'm not sure if WebAssembly is going to live up to the 'good' part of that.)
-
As much as I like JavaScript, Bredan has fallen to the chicken-egg fallacy. Some of the ES6 features are great- had they been implemented years ago. And already looking towards ES7 as ES6 is "already done"? Give me a break! It's nothing more than lipservice if web developers can't use it on forward facing sites.