• About
  • Archive
  • RSS

Bits of Peter

@brynary's Law of `lib/`

Also known henceforth as The MyTurtleFaceSpace Rule

I recommend any code that is not specific to the domain of the application goes in lib/. Now the issue is how to define “specific to the domain”. I apply a litmus test that almost always provides a clear answer:

If instead of my app, I were building a social networking site for pet turtles (let’s call it MyTurtleFaceSpace) is there a chance I would use this code?

(There are also several good dissenting opinions in the comments.)

  • February 20, 2012, 1:01pm

  • Permalink
← Previous post   Next post →

About

Peter Jaros is a blogger and programmer. He writes about Going Less Crazy at NothingUndone.net.

Blogroll

  • edwardspoonhands
  • merlin
  • dreadgoddess
  • thiswayforeyeway
  • theworstthingsforsale
  • violetsphinx
  • erraticinheels
  • wtfqrcodes
  • staff
  • maggieyorkworth
  • windoodles

Search

Colophon

This tumblelog is powered by Tumblr and was designed by Bill Israel.