A few days ago I was doing some research on creating and parsing CSV files, and I came across something called the “1st Law of Internet Communications” which was coined by Jon Postel, an early pioneer of the technology behind today’s web. It reads
Be liberal in what you accept, and conservative in what you send.
What it means for programmers
This phrase has a very specific meaning in the programming world. It means that when you attempt to produce data in a certain file type, you should be as accurate as possible even if you can cut corners, but when you’re reading files you should account for all kinds of problems the file might have and still accept it.
For example, in HTML you can write either <table id=”mystuff”> or <table ID=mystuff>, but Postel’s law says that you should produce the most narrow, accurate, conservative version which is <table id=”mystuff”>. However, when you’re making a program that reads HTML, you should be willing to accept both <table id=”mystuff”> and <table id=mystuff> and even totally wrong things like <table mystuff>. A narrow program would thrown an exception in that case and stop everything, but a good program should be able to overlook problems and inconsistencies and still get the job done.
What it means for everyone else
Postel’s law shouldn’t just apply to coding, however. It’s also a great guideline for human to human communication. We should seek to be as clear and accurate as possible in what we say, but when we are listening, we should not expect the same from others.
Sometimes people have a hard time communicating whether it’s in person or via electronic media. Rather than throwing an “exception” and stopping everything when someone’s data doesn’t meet our specs, we should work really hard to be able to accept and understand as much as possible of what a person is saying.
Be liberal in whom you accept, be conservative in what you believe.