A few more comments about ...Why Is the Phone on Fire?
Posted on March 14, 2011
by Tommy McGuire
Since I gave such a ringing endorsement of If I Only Changed the Software, Why is the Phone on Fire? (at least as ringing as I plan on getting), there are a few more comments I can make related to the book.Network protocols
Header | Address | Message ID | Group ID | Data Length | Data | CRC |
---|---|---|---|---|---|---|
4 bytes | 4 bytes | 1 byte | 1 byte | 1 byte | 0-27 bytes | 2 bytes |
Raw Data Message Formats | ||
---|---|---|
Message Name/ID | Data Length | Data Format |
DATA_CHAR/5 | 1 byte | Single char |
... | ||
DATA_INT_ARRAY/11 | 1+(0-n) | Num ints (1 byte), raw int data |
... | ||
Formatted Data Message Formats | ||
Message Name/ID | Data Length | Data Format |
... | ||
BLOOD_PRESSURE/21 | 24 | Timestamp, 10 samples bit-packed (4 chars, 1 int) |
... |
Since a part of the problem being discussed is a tight network-bandwidth bound, ditching the useless data length byte plus an unused byte in the data would allow another sample to be sent in the pulse-oxygen message, reducing the original bandwidth used from 120kbps and the solution's 29kbps to 27kbps, a reduction of about 6%.
(Strangely, Simone cites TinyOS in the discussion of the message format. I have no idea why.)
Tips
Despite providing another example of the Heavenly Emporium of Benevolent Knowledge, Simone's list of tips has some interesting features.
Find a sounding board (doesn't have to be a live person!) - talk through ideas to quickly identify good ideas and discard bad ones.
Surprisingly effective. Also found in The Psychology of Computer Programming, where Gerald Weinberg advised talking to a stuffed bear. Or you can try a rubber duck, according to Del.Use visual aids (flowcharts, graphs, function call trees)....
The opposite of a correct statement is a false statement. But the opposite of a profound truth may well be another profound truth. - Niels Bohr.I come from the land of Dijkstra, where flowcharts and such are frowned on, for good reason. However, visual aids can easily show parallel structures, or the lack thereof, in the system.