← All posts

Open Source Photonics: What Contributing to laserfun Taught Me

During my Ph.D., most of my “software engineering” was private scripts: quick, dirty, effective, and dead six months later. Contributing to laserfun was different, and genuinely better for how I think about research code.

Code review is peer review

My custom Raman implementation went through maintainer review like a manuscript goes through referees. Some comments stung; all of them made the code better. The difference from paper review: the artifact actually improves after publication instead of being frozen behind a paywall.

Things I changed my mind about

  • Tests aren’t bureaucracy. A regression test comparing against an analytic GNLSE solution caught a sign error I’d introduced during refactoring. In optics, sign errors produce plausible-looking wrong answers, which are the worst kind.
  • Docstrings are papers. If someone cites your library in their methods section, your docstring is part of the scientific record.
  • Small PRs win. Three focused commits merged faster than one heroic 1000-line dump ever would.

Why physicists should contribute upstream

Every hour spent improving a shared solver repays itself across the community. It also it reads better on a postdoc application than “proficient in Python” on a CV ever will. My contributions live in a library other researchers run daily; that’s impact you can point to.