This reminds me of that video where LGR reviewed a keyboard with a PIZZA keyboard key. Probably more useful of a usecase than this really... (https://youtu.be/USQxZc9nmtE)
Using JS over CSS for sizing elements rarely is a 'better solution', mostly because of flashes of unstyled content - especially on mobile where it might take longer for the JS to fully initialise.
Like other comments on here say, just use height: 100% instead.
Every time a article like this is posted I'm just flabbergasted at the fact that 'looking behind you before actually opening a door' is such a foreign concept to Americans.
My impression is that driving education in the US is rather lacking overall, though it's of course not federalized, so there are probably fifty shades of deficiency. (That being said many driving schools here suck as well, though that's mostly a money drain for the driving students; 40 % or so failure rate in the practical exam).
I've got a British driving license and an American driving license. The British driving license was hard work. The American driving license involved little more than proving I could make the car go forwards and that I had a pulse.
There's really a 40% failure rate? That's insane given how easy it is to pass the test.
Yes, so let's all keep reinventing the wheel, over and over again.
I know the author uses pretty extreme examples, but I still don't see what's inherently wrong with the mentioned packages.
- it does what you think it does:
`isOdd(2)` is a lot easier to understand than `value % 2`
- even though most of these are one liners, it's one line of code less that you have to maintain
- if the package is at least somewhat popular, it's highly likely it has measures for edge cases; stuff I wouldn't have thought of when writing it myself.
On top of that, mentioning left-pad is really cliche and weak at this point (bear in mind this happend 2 years ago), npm has taken measures and nothing similar has happend since then, and even then, it was still a fairly isolated event - the whole thing actually took 10 minutes.
I'd much rather take a rare, yet-to-happen-again chance that a package goes down, over having to rewrite simple utility functions over and over again, every month.
> Yes, so let's all keep reinventing the wheel, over and over again.
Writing basic code, like operator calls is not reinventing the wheel.
> `isOdd(2)` is a lot easier to understand than `value % 2`
It's not tho, an operator is fundamental and everyone knows what it does. The function on the other hand you have no clue and have to check the source to see what it does.
> On top of that, mentioning left-pad is really cliche and weak at this point (bear in mind this happend 2 years ago), npm has taken measures and nothing similar has happend since then, and even then, it was still a fairly isolated event - the whole thing actually took 10 minutes.
Mentioning left-pad because the culture has not changed since then, this is a culture problem and not a technical one IMHO.
They could've made an open standard that not only websites but other search engines could implement as well, but then again why would they do that? They'd lose a competitive advantage.
I think AMP is very deliberately locked in to google.