336
you are viewing a single comment's thread
view the rest of the comments
[-] gornius@lemmy.world 2 points 1 year ago

I disagree (mostly). What's the difference between library and language built-in? PHP and C++ has a ton of built-ins. It doesn't make it less complex than using library.

Problems that look simple at the first glance are in most cases are complex with too many edge cases.

I think I have never written a single utility function that had no non-obvious bug, and imagine that in more complex problems

Not to mention in many cases any function you write is possibly dangerous.

Just take a look how many things you have to consider when checking for odd number in JS:

https://www.npmjs.com/package/is-odd?activeTab=code

And of course most of that can be fixed be using strongly typed language.

[-] Obscerno@lemm.ee 3 points 1 year ago

The difference is I trust the language. That's one source I have to trust. With libraries I have to trust a ton of sources.

What I do is look around at existing utility functions and then adapt them to my needs. The difference is I know exactly what I'm adding, and I know it doesn't have dependencies, and when changes are made, I know what they are because I made them.

this post was submitted on 01 Sep 2023
336 points (96.4% liked)

Programming

17025 readers
189 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS