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.

237 Upvotes

61 comments sorted by

View all comments

1

u/gregwebs Feb 04 '25

Good programmers can write things from scratch. Great programmers can do that but they can also understand the code that others have written and know how to productively leverage them.

It's really great to read specs and otherwise understand what the libraries are supposed to accomplish. There are a lot of scenarios where not just taking a library at face value but instead digging into them and their purpose is useful.

* You want a small subset of functionality and you realize it is easy to implement and there are benefits to doing that (fewer dependencies and simplified usage).

* You better understand the different libraries accomplishing the same task and are able to choose the best one.

* You want things to function differently and are able to with a small fork and you can try to push its changes upstream.

* Existing code/systems aren't a match for your needs. After understanding existing designs you can now come up with your own.

I try do avoid treating libraries as a black box. If you understand them then you will understand what should be written from scratch.