Conservative vs. Liberal Programming Practices
January 23, 2013
Listening to the discussion about UVM extensibility today on the Accellera VIP-TSC call, I was reminded of a great post from Steve Yegge of Google.
It's *very* long, but a good read. In summary, Steve proposes that there are two competing world views when it comes to programming:
"Conservative" programming views
- Software should aim to be bug free before it launches.
- Programmers should be protected from errors.
- Programmers have difficulty learning new syntax.
- Production code must be safety-checked by a compiler.
- Data stores must adhere to a well-defined, published schema.
- Public interfaces should be rigorously modeled.
- Production systems should never have dangerous or risky back-doors.
- If there is ANY doubt as to the safety of a component, it cannot be allowed in production
- Fast is better than slow.
"Liberal" programming views
- Bugs are not a big deal.
- Programmers are only newbies for a little while.
- Programmers figure stuff out amazingly fast when their jobs depend on it.
- Succinctness is power.
- Rigid schemas limit flexibility and slow down development.
- Public interfaces should above all else be simple, backward-compatible, and future-compatible.
- System flexibility can mean the difference between you getting the customer (or contract) vs. your competitor nabbing it instead.
- Companies should take risks, embrace progress, and fiercely resist ossification.
- Premature optimization is the root of all evil.
Steve's point is that everyone falls somewhere on the spectrum between conservative and liberal (programming), whether they realize this or not.
On the Accellera VIP-TSC, and often in our everyday verification work, each of us often has debates where one side or the other claims a technical position assuming their position is based on a fundamental law of nature. It can be useful to admit to yourself that there are different views of acceptable programming practices, and there are pros and cons of each. Understanding this can improve your interaction with your team members, and can allow a team to more efficiently make conscious decisions about preferred styles as we move through a development process.