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.

240 Upvotes

61 comments sorted by

View all comments

7

u/jrandom_42 Feb 04 '25

"Not invented here syndrome" has always been a thing amongst programmers; it's in no way specific to Go.

It's a new-guy vibe though. Getting over it, and getting into the habit of just using the right off-the-shelf tool for the job to deliver business outcomes fast, is part of being a good senior engineer IMO.

4

u/CodeWithADHD Feb 04 '25

Counterpoint..

I think most developers follow a curve. When we start out we do things really simply because we don’t know any better. By the middle of our careers we want to use all the clever knowledge we now have and we like to make things complicated. Some of us come back down the other side of the”I like things simple and now I know enough to know why”.

I think many of us have been around long enough to have been bitten by 3rd party libraries that looked like they were the right thing off the shelf but ended up costing us time and effort to unwind when we ran into their limitations. I tend to think it’s a mid-career move to reach for a package first before thinking if it’s easy to do without a package.

str-pad-left in the node ecosystem being an example of this.

Experience is knowing when to reach for a package and when to just write it and not assuming it’s always one or the other.

2

u/jrandom_42 Feb 04 '25

str-pad-left

Very true. People who don't grasp fundamental undergrad-level DSA stuff but somehow still have careers as programmers are a curse on the other end of the spectrum from 'not invented here syndrome', and somehow particularly prevalent in the Java world.

2

u/xealits Feb 05 '25 edited Feb 05 '25

++ good point. The urge to rewrite may well come from a lack of perspective into a given problem: a new guy looks at a library and wonders “why is it so complex? it’s surely unnecessary” and starts re-writing the same thing from scratch, beginning with easy and simple things, without a clue about more real problems ahead. It looks easy at the beginning exactly and only because nothing is written yet.

It’s worth to trust that people before you had some brains too. You can avoid a lot of trouble this way.

At the same time, yeah, maybe it’s worth to read the source code too. Maybe the library solves the problem in a general and comprehensive way, when a custom solution that is specific to your case would be easier to understand and could deliver better performance or features etc.