The Electric Breakfast Cooker

I must have first come by this little parable in the 80s and I usually refer to it at least twice a year.  Basically it explains the different between Engineers and Computer Scientists. Engineers try to reduce a problem to it most simple form while Computer Scientists will try to solve the a the universal case guaranteeing it solution for all the sub problems.  A great way to write a compiler, operating system, or tools, but a terrible way to design embedded systems.  Unfortunately I  believe that since many Software Engineers take the majority of their classes from the computer science department, that they are tend to think like Computer Scientists.

Anyway so here it is. It is used with permission by Do While Jones. Comments encouraged!

The Breakfast Food Cooker
by Do-While Jones
Once upon a time, in a kingdom not far from here, a king summoned two of his advisors to test them. He showed them both a shiny metal box, with two slots in the top, a control knob, and a lever. He asked his advisors, "What do you think this is?"
One advisor, who happened to be an engineer, answered first. "It is a toaster," he said. The king asked, "How would you design an embedded computer for it?"

The engineer replied, I would use a 4-bit microcontroller to do the job. I would write a simple program that reads the darkness knob and quantizes its position to one of sixteen shades of darkness from snow white to coal black. The program would use that darkness level as the index to a sixteen-element table of initial timer values. Then it would turn on the heating elements and start the timer with the initial value selected from the table. At the end of the time delay, it would turn off the heat and pop the toast. Come back next week and I'll show you a working prototype.

The king had the computer scientist thrown in the moat.

This tongue-in-cheek story exaggerates a basic difference between engineering and computer science. Engineers are trained to make as many simplifying assumptions as possible. They are taught, "Never use a second-order equation when a first-order equation will do." Computer scientists are taught to solve specific problems by considering them to be special cases of a larger, more general problem. Solve the general problem, and all specific instances of the problem are automatically solved.

The computer science approach is reasonable for traditional computer science applications (such as the design of compilers, operating systems, and databases). One can't predict all the possible programs a compiler will be asked to compile, so a compiler has to be designed to handle any general source code. One can't predict how many tasks will need to run at once, or what those tasks will need to do, so operating systems have to be as general as possible. It makes perfect sense to design all peripheral handlers to conform to the same general format. This allows programs to open a peripheral, where "open" has slightly different meanings if the peripheral is a printer, tape drive, or disk drive. There is no way to predict how many keys the user will need to use to access a database, so general access procedures must be provided.

The techniques required for these traditional computer science applications don't work as well for embedded applications. The toaster is one example. A toaster is not a Breakfast Food Cooker. Any attempt to make it one just leads to a product that is over budget, behind schedule, too expensive to sell at a profit, and too confusing to use. When faced with a difficult problem, the proper approach is to try to make the problem simpler, not more complicated.

I'm not against planning for the future. Some thought should be given to future expansion of capability. But when the entire design process gets bogged down in an attempt to satisfy future requirements that may never materialize, then it is time to stop and see if there isn't a simpler way to solve the immediate problem.

ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.