SMJ
HomeAboutExperienceStackProjectsContactBlog
ResumeAdmin

Shashwat Manglam Jain

Freelance full-stack developer helping teams ship web + AI products.

HomeAboutExperienceStackProjectsContact
GitHubLinkedInXInstagramWhatsAppResume

© 2026 Shashwat Manglam Jain. All rights reserved.

Built with Next.js, Tailwind, NestJS, and Prisma.

← Back to Blog

What Open Source Taught Me About Code Quality

May 01, 2025•3 min read
Open SourceCode QualityBest Practices
What Open Source Taught Me About Code Quality

What Open Source Taught Me About Code Quality

My first open source pull request was rejected. Not because the code did not work, but because the code was not readable. The maintainer left a simple comment: "This works, but the next person who reads this will not understand why." That feedback changed how I write code.

The Review Culture

In open source, your code is read by strangers. They do not have the context you have. They cannot walk to your desk and ask what a variable name means. This forces a level of clarity that most internal codebases never demand.

I learned to write code as if I am writing for someone who will read it at 2 AM during an incident. Variable names should explain intent, not just type. Function signatures should tell you what happens without reading the body. Comments should explain "why," not "what."

What I Learned from Maintainers

Small PRs get merged. A PR that changes 50 lines gets reviewed in a day. A PR that changes 500 lines sits for weeks. I now break every feature into the smallest possible incremental changes.

Tests are documentation. Good test names describe behavior, not implementation. When I read a test suite, I should understand what the module does without reading the source code. This perspective shifted how I write tests entirely.

Commit messages matter. A clean git history is a debugging tool. Each commit should represent one logical change with a message that explains why the change was made. I adopted conventional commits and never looked back.

Patterns I Adopted

  1. Fail fast, fail loud. Validate inputs at the boundary. Throw descriptive errors early. Silent failures are the hardest bugs to track.
  2. Prefer composition over inheritance. Most abstractions I see in open source favor small, composable functions over deep class hierarchies.
  3. Write the interface first. Before implementing a module, define the public API. If the API feels awkward, the implementation will be worse.
  4. Keep dependencies minimal. Every dependency is a liability. I now evaluate whether a 10-line utility function is worth adding a package with 50 transitive dependencies.

The Feedback Loop

Contributing to open source gave me access to feedback from experienced engineers I would never have met otherwise. A senior engineer at a major tech company reviewed my code and pointed out a race condition I did not know existed. That single review taught me more about concurrency than any textbook.

Why Every Developer Should Contribute

You do not need to contribute to a massive framework. Find a tool you use daily, look at the issues labeled "good first issue," and submit a fix. The code review process alone will level up your skills faster than any course.

Open source taught me that code quality is not about cleverness. It is about empathy for the next reader. That lesson applies everywhere, not just in public repositories.

Enjoyed this post?

I'm always happy to connect and discuss ideas.

Contact meView projects