r/ProgrammerHumor • • Aug 08 '16

JQuery Does All Things!

https://i.reddituploads.com/b79bb2d6e2f14e65b769686647cc4782?fit=max&h=1536&w=1536&s=ed6be616a7a0467c49330eda9253811e
3.0k Upvotes

207 comments sorted by

View all comments

86

u/[deleted] Aug 08 '16

an old one but a good one.

Just today I googled something to get "try xxx jQuery plugin" which literally could be replaced by 5 lines of vanilla JS.

31

u/gandalfx Aug 08 '16

Well Node developers also like to import packages from NPM that literally contain a trivial one-liner. And that's not even a rare occurrence.

28

u/[deleted] Aug 08 '16

Missing dependency: left-pad .

17

u/DeeSnow97 Aug 08 '16
const leftPad = (s, l, c) => new Array(Math.max(l - s.length, 0)).fill(c || ' ').join('') + s

I'm still struggling to believe the absence of this code took down the world

4

u/[deleted] Aug 08 '16

Not ashamed to admit that this is way more clever and elegant than how I would create a left-pad method. Maybe because I don't do JS much.

1

u/[deleted] Aug 10 '16

And unlike the leftpad function, this isn't quadratic time.

7

u/senntenial Aug 08 '16

Javascript devs could host a mirror of most NPM packages on twitter.

7

u/faubiguy Aug 09 '16

6

u/xXxNoScopeMLGxXx Aug 09 '16

Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.

I can't catch my breath.

2

u/gandalfx Aug 08 '16

In a way NPM is already just a mirror of random answers on stackoverflow.

2

u/daronjay Aug 09 '16

I just import it all

"dependencies": {
    "stack-overflow": "^2.0.15",
  }

1

u/DeeSnow97 Aug 08 '16

Thanks for the perfect idea for my new twitter account

6

u/[deleted] Aug 08 '16

Yeah... it's totally only node developers that import trivial libraries...

1

u/Andernerd Aug 09 '16

My team lead recently requested that I find him a 3rd-party dropdown menu plugin so that our frontend can catch up with our 350+ backend Node modules.