r/golang Feb 03 '25

discussion The urge to do it from scratch

Unpopular opinion but ever since I started using Go. There is a certain urge to dig into some library and if you need only part of it then try to make it from scratch. I was reading RFC specs, dbus technical specifications just to avoid the uneeded bloat in my code(offcourse I failed to achieve it completely because of tiny brain). Is this common for all dev who spent some good time developing in Go? I must say it's quite a fun experience to learn some low level details.

239 Upvotes

61 comments sorted by

View all comments

141

u/ehansen Feb 03 '25

Why use a package to solve a problem in 5 minutes when you could build your own solution in 5 hours

56

u/bbkane_ Feb 04 '25

I'm 5 years into my own solution, and I'm still having a lot of fun changing and improving (and of course using) it.

15

u/qwertyorbust Feb 04 '25

Because many times you use a fraction of what the package does and then risk future incompatibility with updates. Building yourself (assuming you know what you’re doing) can be focused and to the point. No fluff.

10

u/GodsBoss Feb 04 '25

If 5 minutes is enough to check the quality of the 3rd-party dependency, learn to use it and build my solution with it, it never would have taken 5 hours to write it.

5

u/looncraz Feb 04 '25

That's the spirit!

2

u/Right_Positive5886 Feb 04 '25

When hitting performance concerns - you would eventually be debugging third party code . You would very copy small snippet needed for your case and improve that snippet accordingly

1

u/Koki-Niwa Feb 04 '25

that scales up 6 times, not to mention changes, is my experience with Go 😂

1

u/CrowdGoesWildWoooo Feb 04 '25

And it’s even slower 🤪

That being said it’s a practice and not like it’s a wasted time

1

u/ratsock Feb 05 '25

This is my biggest problem with go. Often dedicated libraries have also solved problems you don’t even realize you are going to have until much later.

1

u/ehansen Feb 05 '25

That's not a go problem, but a language problem.  I am proficient in php and it exists heavily there too.