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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/19/06 06:05
Read: times


 
#124527 - Is there a difference?
Responding to: ???'s previous message
Ian Bell said:
I was reading a microcontroller assembler book the other day where the author gave an example of scanning a keyboard a key at a time. The code was a huge list of bit test and branch instructions followed by...

That indicates a poor choice of algorithm, not a separation of logic and algorithms. An algorithm is an implementation of logic, and there are good choices and bad choices of algorithms for implementing the same logic.

The author's point was that many problems which are normaly solved by logic (if then else type of constructs) are often better solved (smaller & faster) by recognising that an algorithm can be used.

An algorithm is a specific implementation of a logic problem.

Code size was about one tenth and speed constant irrespective of which key is pressed using this algorithm.

Contrived example. If what you seek is an efficient algorithm for mapping keystrokes to led outputs, just use a lookup table.

The point I want to make is that many software books talk almost exclusively about logic but rarely is the algorithmic approach given much if any space.

Software books that are any good present only algorithms, since they are implementations of logic. See Donald Knuth's The Art of Computer Programming for an example.

It amazes me that there are so many practicing software engineers who haven't yet glommed on to the fact that software engineering is applied mathematics. And mathematics is codified logic (see, for example, Russell and Whitehead's Principia Mathematica).



List of 13 messages in thread
TopicAuthorDate
Logic or Algorithm            01/01/70 00:00      
   So what was your "Algorithm"?            01/01/70 00:00      
      back to Hurley            01/01/70 00:00      
         Programming 101            01/01/70 00:00      
            sometimes it's not bad to remember history            01/01/70 00:00      
      My Algorithm            01/01/70 00:00      
         Lost            01/01/70 00:00      
            Think think think .....            01/01/70 00:00      
               Hurley again            01/01/70 00:00      
   well only today            01/01/70 00:00      
   Is there a difference?            01/01/70 00:00      
      Terminology - Ian?            01/01/70 00:00      
         Calculation vs Data Structures vs Logic            01/01/70 00:00      

Back to Subject List