Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/13/05 14:32
Read: times


 
#99338 - One exception
Responding to: ???'s previous message
Erik Malund said:
Now, it is, of course, fun now and then to do some really fancy code, that's fine, just do not let the people that pay you suffer for that reason.

I generaly agree with everything you have said Erik. As a rule, fancy code only creates problems. I have only come across one possible exception to this rule. For many years I worked on hand held label printers. These were mass produced so were very cost sensitive. The customer wanted as large a set of characters as possible . This takes up more ROM and leaves less space for code. To fit more charcaters in we used various methods of compressing bit maps. Even so, in a typical product we had 12K of font data and 4K of code. The customer also wanted to do fancy things with the characters like italic, bold and outline styles. No way could we store these as separate fonts, we could not afford the ROM, so they had to be generated algorithmically from the base font data.

The code that did these data manipulations consumed the largest proportion of cpu time available per print cycle so the algorithms they used and the way they were coded had to be as efficient as possible to avoid needing a higher speed and more expensive processor variant. It was important that intermediate values were kept around for the next print cycle because that would need them too. Also the font data was several bytes long so reducing fetch times with indexing was important too and of course the data needed to be de-compressed at the same time too. As much RAM as possible had to be left for the text editor so we could not just read in a few columns of data and work on that.

All in all a very challenging piece of code that required a deep understanding of the processor machine code in order to produce the fastest smallest code (no compiler on earth could look far enough ahead in the code to achieve the same level of optimisation). We were proud of the results and I thought the code could be described as elegant. It did nothing stupid or dangerous but in its own way was rather fancy. Several million units were made and it never crashed.

IAn



List of 57 messages in thread
TopicAuthorDate
defensive coding how and why            01/01/70 00:00      
   What do you mean?            01/01/70 00:00      
      Elegant            01/01/70 00:00      
         Paradox?            01/01/70 00:00      
      clarification            01/01/70 00:00      
         Remember            01/01/70 00:00      
            Absolutely, and even then should be avoi            01/01/70 00:00      
            Absolutely, and even then should be avoi            01/01/70 00:00      
            extrodiaray?            01/01/70 00:00      
                extrodiaray?            01/01/70 00:00      
                  Goooooogle            01/01/70 00:00      
                     No, he does not            01/01/70 00:00      
                        proofreading            01/01/70 00:00      
                     Another challeneg            01/01/70 00:00      
                        another challenge            01/01/70 00:00      
               OK, I can not Spell            01/01/70 00:00      
                  this is my point            01/01/70 00:00      
                     I sure you could, But            01/01/70 00:00      
                        Really?            01/01/70 00:00      
                           professors and classes            01/01/70 00:00      
                           Really !            01/01/70 00:00      
                              Hmmm            01/01/70 00:00      
            defensive commenting            01/01/70 00:00      
         Don't know            01/01/70 00:00      
            Ok, let me get away from that word            01/01/70 00:00      
               Gotcha            01/01/70 00:00      
                  and I came to truly despise that word wh            01/01/70 00:00      
                     Just like driving            01/01/70 00:00      
            Elegant equals...            01/01/70 00:00      
               that it            01/01/70 00:00      
               Oh, how true...!            01/01/70 00:00      
                  It's never the author's problem            01/01/70 00:00      
                     I knew a person who told me about a real            01/01/70 00:00      
                        A blissful existence            01/01/70 00:00      
                  Your bugs versus my bugs (or vice versa)            01/01/70 00:00      
                     common wisdom has it that the average pr            01/01/70 00:00      
   One exception            01/01/70 00:00      
      exceptions            01/01/70 00:00      
         vice versa            01/01/70 00:00      
            what is obvious            01/01/70 00:00      
               your mileage may vary            01/01/70 00:00      
                  that is the very same            01/01/70 00:00      
                     competent            01/01/70 00:00      
                        please define "working"            01/01/70 00:00      
                           competent programming => working program            01/01/70 00:00      
   i'm new            01/01/70 00:00      
      if you move your eyeballs a bit to the l            01/01/70 00:00      
         Coding Bible            01/01/70 00:00      
            Precedence vs. explicitness            01/01/70 00:00      
   Outlaw coding!            01/01/70 00:00      
      a program it is, by definition, asynchro            01/01/70 00:00      
         Methinks the point was missed            01/01/70 00:00      
            "Easy?"            01/01/70 00:00      
            but we agree            01/01/70 00:00      
      VIPER?            01/01/70 00:00      
      What does "timing" mean?            01/01/70 00:00      
         excuse the foreigner, if he was not clea            01/01/70 00:00      

Back to Subject List