206 points

I’ve literally told my coworkers “I’m not saying we should never use dependencies. But every time you add a dependency, you should hate yourself a little bit more. Some self flagellation can’t hurt either.”

permalink
report
reply
11 points

So, every time I use a library to recognize patterns on a picture, to interact with Kafka, do some SSL, or do database mapping, I should hate myself, noted

We did Elastic API integration in Java by creating and maintaining huge half-codegenerated transformer from code to Elasticsearch’s JSONs, it was a pain and it was source of more than one error

Dependences should be reviewed and audited to make sure they do what you need and they are worth using. Just making everything in-house gets you nowhere most of the time

permalink
report
parent
reply
24 points

Nobody is arguing that you should never depend on anything and create everything yourself, but adding a dependency for literally a one liner function is awful. Like one of the Go proverbs goes, a little copying is better than a little dependency.

permalink
report
parent
reply
3 points

Yeah, there’s mention of doing the opposite in C++ community in a neighbouring thread

permalink
report
parent
reply
11 points

You code in Java, of course you should self flagellate on a daily basis just for that. The entire ecosystem is completely fucked.

permalink
report
parent
reply
5 points

Joke’s on you, I code in Rust

permalink
report
parent
reply
3 points

That is what they were getting at by some self flagellation can’t hurt either. That sometimes “hating yourself” (adding dependencies) is worth it.

permalink
report
parent
reply
1 point

I read it as “also throw in some physical pain cause just feeling bad is not quite enough” 🤔

permalink
report
parent
reply
3 points
Deleted by creator
permalink
report
parent
reply
193 points

I’ve honestly never understood why someone at Google or Mozilla hasn’t decided to write a JavaScript Standard Library.

I’m not opposed to NPM, because dumb shit like this happens everywhere. If such a package is used millions of times a day, perhaps it would make sense to standardise it and have it as part of the fucking browser or node runtime…

permalink
report
reply
51 points

I’ve honestly never understood why someone at Google or Mozilla hasn’t decided to write a JavaScript Standard Library.

permalink
report
parent
reply
4 points

This picture honestly looks more like C++ than JS, and before you yell at me, JS doesn’t have any standards let alone competing standards so ¯⁠\⁠_⁠(⁠ツ⁠)⁠_⁠/⁠¯

permalink
report
parent
reply
1 point

JS doesn’t have any standards

ECMAScript would like to have a word with you.

If however by “doesn’t have any standards” you meant it’s willing to sink to new low grounds every day, you would be correct.

permalink
report
parent
reply
45 points
*

someone at Google or Mozilla hasn’t decided to write a JavaScript Standard Library.

Core APIs (including data types like strings, collection types like Map, Set, and arrays), Browser, and DOM APIs are pretty good these days. Much better than they used to be, with more features and consistent behaviour across all major browsers. It’s uncommon to need browser-specific hacks for those any more, except sometimes in Safari which acts weird at times.

The main issue is server-side, and neither Google nor Mozilla have a big interest in server side JS. Google mostly uses Python and Java for their server-side code, and Mozilla mostly uses Rust.

Having said that, there’s definitely some improvements that could be made in client-side JS too.

permalink
report
parent
reply
29 points

There’s a js runtime called bun that is 90-something% feature equivalent to node and also has built in alternatives to many packages like express and bcrypt. I haven’t used it myself so I can’t speak to its quality but it’s always nice to see a little competition

permalink
report
parent
reply
20 points

So is Deno! You can easily import npm: and node: packages and run typescript without transpiling. With Bun and Deno there’s no reason to use Node tbh.

permalink
report
parent
reply
5 points

For starting new projects i absolut agree. At work we have a legacy react app that just will not run on bun and for deno we would probably have to rewrite some stuff.

permalink
report
parent
reply
2 points

node now supports stripping types, which is good enough for one-off TS snippet.
(available only in nightly for now)

permalink
report
parent
reply
4 points

Bun is used by us in production, in dev, everywhere. It’s great. We don’t even use (p)npm to build js packages on our docker images for apps anymore.

permalink
report
parent
reply
29 points

That’s basically how Javascript gets extended. I put off learning jQuery for so long that all the features I’d want are now standard.

permalink
report
parent
reply
17 points

Vanilla JS is pretty good on the client side, but leaves a lot to be desired on the server side in Node.js, even if you include the standard Node.js modules.

For example, there’s no built-in way to connect to a database of any sort, nor is there a way to easily create a basic HTTP REST API - the built in HTTP module is just raw HTTP, with no URL routing, no way to automatically JSON encode responses, no standardized error handling, no middleware layer, etc.

This means that practically every Node.js app imports third-party modules, and they vary wildly in quality. Some are fantastic, some are okay, and some are absolutely horrible yet somehow get millions of downloads per week.

permalink
report
parent
reply
26 points

I wish they would replace JavaScript with something that was made for what it’s used for. JavaScript should have died years ago.

permalink
report
parent
reply
12 points

Sometimes it’s hard to detach It, specially dealing with web dev.

The browser expects JS, since JS was made for the browser, so you make a front in JS. But now you need a back, and hey, you already have all models and repos in JS, might as well make the back with JS.

It’s a vicious cycle. Honestly, JS is fine for either if you are component enough (ie. not using stuff like “is-number”), don’t get the hate on It.

permalink
report
parent
reply
3 points

No, JS is for scripts, it should have never been a whole framework for a frontend. But we can’t get away from it now, because it’s the only thing we have for browsers.

permalink
report
parent
reply
12 points

I’m still waiting for webassembly to take off

permalink
report
parent
reply
11 points

Let’s use Flash!

permalink
report
parent
reply
4 points

Actionscript, my beloved

permalink
report
parent
reply
10 points

Support for int64s out of the box and without jumping through hoops would be nice.

permalink
report
parent
reply
2 points

core-js is exactly that, but it focuses on implementing baseline features that can be polyfilled.

permalink
report
parent
reply
176 points

The only two people arguing against the change were both authors/contributors of is-number lol

permalink
report
reply
54 points

How many contributors could there possibly be

permalink
report
parent
reply
63 points
*

3, about two lines per contributor

permalink
report
parent
reply
18 points

Is it because they included a crypto miner in the package?

permalink
report
parent
reply
167 points

Note that the PR was later merged by a member who got fed up with his colleagues.

permalink
report
reply
34 points

And who hasn’t contributed any code to this particular repo (according to github insights).

permalink
report
parent
reply
38 points

Not familiar with this exact team, but a skilled reviewer/issue triager is useful. We can hope this person at least tested the changes.

permalink
report
parent
reply
3 points

The person who opened the pr already did

permalink
report
parent
reply
150 points

Another day of being extremely thankful I decided not to learn JavaScript

permalink
report
reply
174 points

I mean, the people relying on such packages didn’t learn it either.

permalink
report
parent
reply
104 points
*

Look at what you’re missing!

Edit: also, is-odd depends on is-number

permalink
report
parent
reply
13 points
*

These are both made by the same person from this PR (who also made both the package the PR is on, and the is-number package that is being removed as a dep)

permalink
report
parent
reply
7 points

Heaven forbid they make a package is-even-or-odd with both. Wait. Don’t give them ideas. They’ll just make it depend on both.

permalink
report
parent
reply
29 points

This can happen in any project that uses dependencies, javascript or not

permalink
report
parent
reply
51 points
*

Sure, but when was the last time you saw, say, a Python project using some third-party library instead of simply calling isnumeric() from the standard library?

There’s a reason for these jokes always being about Javascript.

permalink
report
parent
reply
15 points
*

Python has other stupid problems related to pip. As much as stupid micro-dependencies suck in Javascript, they’re not the shitshow managing dependencies in Python is. It’s an inefficiency that never actually caused me noticeable issues in my former webdev life.

And let’s not talk about C++… People reinvent all sorts of wheels all the time because sharing anything is so annoying.

permalink
report
parent
reply
12 points

I only glossed over it… but this looks like it’s trying to check dynamic typing issues? It’s like a statically typed language with extra steps?

permalink
report
parent
reply
38 points

I don’t think typescript exists because JavaScript wasn’t designed to be statically typed. I think Typescript exists because JavaScript wasn’t really designed, period.

permalink
report
parent
reply
-11 points

How’s the view up there on your high horse?

permalink
report
parent
reply
15 points
*

Must be pretty good, considering literally every time I check in on the JavaScript community it is somehow more on fire than it was last time. I guess I must have a front row seat to all their misfortune. Either that or they’re just incompetent, but it couldn’t be that, could it?

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 3.4K

    Monthly active users

  • 1K

    Posts

  • 38K

    Comments