Re: Essay on PID Motor control
- From: "JGCASEY" <jgkjcasey@xxxxxxxxxxxx>
- Date: 8 Feb 2006 10:37:33 -0800
mlw wrote:
...
In the book, "Relativity, The Special and The General
Theory, A Clear Explanation that Anyone Can Understand"
by Albert Einstein, I see five, and only five, items
that are neither math nor text
And thus it was followed by a plethora of relativity books
with lots of illustrations and graphs by other authors as
the idea that it was a clear explanation that anyone can
understand was being a bit optimistic.
...
<RANT>
Flow charts, IMHO, are no more than the GUI equivalent
of pseudocode, and as valuable as any GUI-fication of
inherently textual information, and pseudocode is as
inherently valuable as any pseudo-anything.
</RANT>
Seriously, maybe it is just that I've been a software
engineer for 20+ years, and I have yet to see a flowchart
outside a sales presentation. pseudo code is better, and
real code is betterer. I have made the real code available.
Perhaps some things lend themselves to flow charts and
other things don't. I remember when first learning programming
I found a flow chart of an expression evaluator helpful in
untangling the code. And I also found it useful when learning
about nested loops. And I found using nested boxes made it
easier to see the overall structure of the code.
+---------------------+
| WHILE |
| +----------+ |
| | IF THEN | |
| | | |
| | ELSE | |
| | | |
| | END IF | |
| +----------+ |
| +---------------+ |
| | IF THEN | |
| | +----------+ | |
| | | IF THEN | | |
| | | | | |
| | | ELSE | | |
| | | | | |
| | | END IF | | |
| | +----------+ | |
| | END IF | |
| +---------------+ |
| END WHILE |
+---------------------+
While learning I wrote a program that would create such boxes
and check that each IF had an END IF etc. automatically fixing
up any indentation required.
I agree real code is better then pseudo code for I found it
a real chore translating it into real code. I even wrote a
program to help with that and fix any indentation mistakes.
eg. psuedo code,
IF A = B THEN
S = S + 1
END IF
became,
if (A == B) {
S = S + 1;
}
As a BASIC programmer I would do silly things like, if (A OR B),
which the automatic translator or experienced programmer would
not do :) The most common mistake I made while learning C was
to remember the semi colon.
Now if, for example, I wanted to explain how the Bresenham's line
drawing algorithm worked I would not just give the code. I would
explain it with words and maybe some illustrations as well so
it was clear how a decision variable was being used to determine
when and where to draw the next pixel. A good explanation would
be sufficient for a programmer to quickly write their own version
without ever seeing a coded example.
Indeed an human language explanation I think is often the best way.
e.g.
Search the list for two items with the closest centroids.
Now the above can easily be translated into code by an experienced
programmer or indeed given the code translated into the above
explanation of what the code was doing. Reverse translation from
code to explanation is however not so easy for a beginner or someone
who has limited programming experience.
I also suspect that a professional programmer can untangle code
faster and with ease compared with an hobby programmer who only
programs on those occasions that require it for some project
but doesn't do it regularly on a wide range of problems. And thus
for a beginner or a hobbyist who has limited programming experience
or know how a human language explanation I think is required.
Also if the person lacks the background knowledge, say in math,
no amount of code or explanation is going to help.
--
JC
.
- References:
- Re: Essay on PID Motor control
- From: Dale T Stewart
- Re: Essay on PID Motor control
- From: mlw
- Re: Essay on PID Motor control
- Prev by Date: Re: not the crypt
- Next by Date: Re: New product makes logic design easy
- Previous by thread: Re: Essay on PID Motor control
- Next by thread: Re: Essay on PID Motor control
- Index(es):
Relevant Pages
|