this post was submitted on 21 Mar 2025
358 points (98.1% liked)

Programmer Humor

21777 readers
1673 users here now

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

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] Ephera@lemmy.ml 13 points 1 day ago (2 children)

I mean, surely you did it for the exercise, right? If you needed a solution, you could've very likely used a library...

[–] chicken@lemmy.dbzer0.com 5 points 1 day ago* (last edited 1 day ago) (1 children)

Having fewer/no dependencies is nice though

[–] Ephera@lemmy.ml 2 points 1 day ago (1 children)

Well, we have a tool for that called vendoring, a.k.a. copy-pasting the library code into your repo. It's no worse than copy-pasting LLM-generated code...

[–] chicken@lemmy.dbzer0.com 2 points 1 day ago* (last edited 1 day ago)

To me the disadvantage would be, the library likely does many more things than just what you need it for, so there is way more code, so you probably can't realistically read and understand it yourself before incorporating it. This would lead to among other issues the main thing that irritates me about libraries; if it turns out something in it is broken, you are stuck with a much bigger debugging problem where you first have to figure out how someone else's code is structured.

Although I guess that doesn't apply as much to implementations of common algorithms like OP since the library is probably solid. I would consider favoring LLM code over most anything off npm though.

[–] ulterno@programming.dev 4 points 1 day ago

That screaming guy made the library.