DEV Community

Should You Throw Away More Code than You Keep?

Marek Zaluski on April 22, 2019

Once in a while, I like to pick a random NPM package that I'm using in my projects, and go read the source code on GitHub. When I was first learni...
Collapse
 
jefrypozo profile image
Jefry Pozo

I feel you. I think reading code from good and well-organized projects can cause Imposter Syndrome in many people, at least it was for me at first.

But working in my own projects I've come to realize, as you say, that your code can become as good, you just need time to polish and evolve it. Maybe at first it won't be very elegant, but with time you'll arrive at better ways of how a class or a method should be.

Collapse
 
nektro profile image
Meghan (she/her)

Mfw I compare a repo I made last week to a project with 50k commits and has been going for 3 years

Collapse
 
evanplaice profile image
Evan Plaice

ProTip: If you're not under the gun of an urgent deadline. It doesn't hurt to take a few weeks to marinate on how the API should be structured.

IMO, the mark of a really well-written project is one where the API rarely -- if ever -- changes.

Historically, JS has been pretty bad about this b/c there was no way to define public vs private API endpoints prior to ES modules. Either way, the 'best' projects were those that seemed to 'just work' despite constant improvements and frequent feature releases.