![Blog entry image](assets/img/blog/blog-1.jpg)
Top-Down versus Bottom-Up
One direction is bottom-up, from concrete to abstract � working up from the specific operations in the problem domain that you know ...
Feature-packed and incredibly easy to work with, this template, powered by Twitters' Bootstrap framework, has you up and running in no-time.
Built with the principles of Mobile-first in mind, this template is 100% responsive and looks great on any device, from smartphones to widescreen monitors.
A truly unique, modern and eye-popping design, combined with smooth animations & razor-sharp graphics lets you stand out from the crowd.
Every branch of engineering and design has technical cultures. In most kinds of engineering, the unwritten traditions of the field are parts of a working practitioner's education as important as (and, as experience grows, often more important than) the official handbooks and textbooks. Senior engineers develop huge bodies of implicit knowledge, which they pass to their juniors by (as Zen Buddhists put it) �a special transmission, outside the scriptures�. Software engineering is generally an exception to this rule; technology has changed so rapidly, software environments have come and gone so quickly, that technical cultures have been weak and ephemeral.
There are, however, exceptions to this exception. A very few software technologies have proved durable enough to evolve strong technical cultures, distinctive arts, and an associated design philosophy transmitted across generations of engineers. The Unix culture is one of these. The Internet culture is another � or, in the twenty-first century, arguably the same one. The two have grown increasingly difficult to separate since the early 1980s, and in this book we won't try particularly hard.
Unix's durability and adaptability have been nothing short of astonishing. Other technologies have come and gone like mayflies. Machines have increased a thousandfold in power, languages have mutated, industry practice has gone through multiple revolutions � and Unix hangs in there, still producing, still paying the bills, and still commanding loyalty from many of the best and brightest software technologists on the planet.
One of the many consequences of the exponential power-versus-time curve in computing, and the corresponding pace of software development, is that 50% of what one knows becomes obsolete over every 18 months. Unix does not abolish this phenomenon, but does do a good job of containing it. There's a bedrock of unchanging basics � languages, system calls, and tool invocations � that one can actually keep using for years, even decades. Elsewhere it is impossible to predict what will be stable; even entire operating systems cycle out of use. Under Unix, there is a fairly sharp distinction between transient knowledge and lasting knowledge.
Confident predictions that Unix would wither away, or be crowded out by other operating systems, have been made yearly since its infancy. And yet Unix, in its present-day avatars as Linux and BSD and Solaris and MacOS X and half a dozen other variants, seems stronger than ever today.
Outsiders have frequently dismissed Unix as an academic toy or a hacker's sandbox. One well-known polemic, the Unix Hater's Handbook, follows an antagonistic line nearly as old as Unix itself in writing its devotees off as a cult religion of freaks and losers. Certainly the colossal and repeated blunders of AT&T, Sun, Novell, and other commercial vendors and standards consortia in mispositioning and mismarketing Unix have become legendary.
Even from within the Unix world, Unix has seemed to be teetering on the brink of universality for so long as to raise the suspicion that it will never actually get there. A skeptical outside observer's conclusion might be that Unix is too useful to die but too awkward to break out of the back room; a perpetual niche operating system.
But perhaps the most enduring objections to Unix are consequences of a feature of its philosophy first made explicit by the designers of the X windowing system. X strives to provide �mechanism, not policy�, supporting an extremely general set of graphics operations and deferring decisions about toolkits and interface look-and-feel (the policy) up to application level.
Unix's other system-level services display similar tendencies; final choices about behavior are pushed as far toward the user as possible. Unix users can choose among multiple shells.
The �fun� factor is not trivial from a design point of view, either. The kind of people who become programmers and developers have �fun� when the effort they have to put out to do a task challenges them, but is just within their capabilities. �Fun� is therefore a sign of peak efficiency. Painful development environments waste labor and creativity; they extract huge hidden costs in time, money, and opportunity.
If Unix were a failure in every other way, the Unix engineering culture would be worth studying for the ways it keeps the fun in development � because that fun is a sign that it makes developers efficient, effective, and productive.
It's hard to avoid programming overcomplicated monoliths if none of your programs can talk to each other.
Unix tradition strongly encourages writing programs that read and write simple, textual, stream-oriented, device-independent formats. Under classic Unix, as many programs as possible are written as simple filters, which take a simple text stream on input and process it into another simple text stream on output.
A program should care as little as possible about the program on the other end. It should be made easy to replace one end with a completely different implementation without disturbing the other.
GUIs can be a very good thing. Complex binary data formats are sometimes unavoidable by any reasonable means.
We observed above that software is transparent when you can look at it and immediately see what is going on. It is simple when what is going on is uncomplicated enough for a human brain to reason about all the potential cases without strain.
Data is more tractable than program logic. It follows that where you see a choice between complexity in data structures and complexity in code, choose the former. More: in evolving a design, you should actively seek ways to shift complexity from code to data.
The easiest programs to use are those that demand the least new learning from the user � or, to put it another way, the easiest programs to use are those that most effectively connect to the user's pre-existing knowledge.
Pay attention to your expected audience. They may be end users, they may be other programmers, or they may be system administrators. What is least surprising can differ among these groups.
One of Unix's oldest and most persistent design rules is that when a program has nothing interesting or surprising to say, it should shut up. Well-behaved Unix programs do their jobs unobtrusively, with a minimum of fuss and bother. Silence is golden.
Software should be transparent in the way that it fails, as well as in normal operation. It's best when software can cope with unexpected conditions by adapting to them, but the worst kinds of bugs are those in which the repair doesn't succeed and the problem quietly causes corruption.
Well-designed programs treat the user's attention and concentration as a precious and limited resource, only to be claimed when necessary.
In the Unix tradition, code generators are heavily used to automate error-prone detail work. Parser/lexer generators are the classic examples.
These philosophical principles aren't just vague generalities. In the Unix world they come straight from experience and lead to specific prescriptions.
We'll see the Unix design rules, and the prescriptions that derive from them, applied over and over again in the remainder of this book. Unsurprisingly, they tend to converge.
Well-designed programs treat the user's attention and concentration as a precious and limited resource, only to be claimed when necessary.
One direction is bottom-up, from concrete to abstract � working up from the specific operations in the problem domain that you know ...
Which end of the stack you start with matters a lot, because the layer at the other end is quite likely to be constrained by your ...
On an unseasonably warm November night in Manhattan on our way to get ice cream, we stumbled upon what appeared to be a vintage ...
My secret to a long, healthy life is to always keep working. It keeps me busy and happy, and gives me a reason to stay alive
Designing a textual protocol tends to future-proof your system. One specific reason is that ranges on numeric fields aren't implied by ...
A Web browser's glue layer has to mediate not merely between specification and domain primitives, but between several different external ...
For transmission and storage, the traversable, quasi-spatial layout of data structures like linked lists needs to be flattened or ...
Our offices are located at:
795 Folsom Ave, Suite 700
San Francisco, CA 94107
Looking for a partner for your exciting new project or do you just want to inquire about our services? In any case, send us a message at info@fragment.com or use the contact form below and we�ll get back to you ASAP!
“ The fact that structural information is conveyed by field position rather than an explicit tag makes this format faster to read and write. ”
“ Usenet news is a worldwide distributed bulletin-board system that anticipated today's P2P networking by two decades. ”
“ Non-Unix programmers might have automatically tried to design a fast binary format in which each newsgroup status was described. ”