EAGLE Netlist conversion

"buck rojerz" <inorbit@outerspace.org> wrote in message
news:Xns94EBCAA92B00ou812@216.168.3.44...
Chuck Harris <cfharris@erols.com> wrote in news:40a7654f$0$3041
$61fed72c@news.rcn.com:

Bill Garber wrote:

The rule is MADS, multiply, add, divide, subtract.
This only applies to figures that are not enclosed
in brackets or parentheses.

No it isn't!

For common arithmetic:

M&gt;y &lt;D&gt;ear <A>unt &lt;S&gt;ally
Multiply, Divide, Add, Subtract.

-Chuck


Ok... Thanks to you as well, Chuck.

buck
more complete: BEDMAS
Brackets
Exponents
Division
Multiplication
Addition
Subtraction

Terru
 
"Chuck Harris" &lt;cfNOSPAMharris@erols.com&gt; wrote in message
news:40b2a1dc$0$3142$61fed72c@news.rcn.com...

When I first started programming in C, I followed the conventions of
the programmers who wrote Unix Edition 6. They liked to show off how
tricky they were and wrote in the most terse way possible. Somewhere
along the journey, I got tired of having to puzzle out my old code, and
started writing code that was easy to understand. The same assembly
code comes out of the compiler either way... well, today's compilers
anyway.
Bravo!
 
On Tue, 25 May 2004 14:25:33 -0700, Terry Given wrote:

1) header blocks that detail the inputs, outputs, memory &amp; stack usage,
interrupt level, execution time etc. along with descriptions &amp; expected
ranges of all input, local, global &amp; output variables
2) description of task to be performed. If a mathematical
simplification/derivation is required, show it explicitly.
3) pseudocode algorithm
4) meaningful, helpful comments interspersed with code.
5) all cunning stunts clearly documented, in both the header and the code.
Specifically mention any prerequisites,eg flags set
6) use meaningful variable names in conjunction with so-called "hungarian
prefix notation" - agree upon a syntax that can describe all the variables
you will need, say AKPUW_current_gain_setpoint[] would be an Array of
Konstant Pointers to Unsigned Words, in this context probably used with
indirect addressing to gain-schedule a current controller (dont forget to
publish the standard. it should be a controlled document, just like a pcb
cad library :)
7) likewise use a standard format for laying out code (indenting etc)
Years ago, I took a VHDL class. At the beginning of the class, we were
covering operators, and I asked what the operator precedence was. "I don't
know," said the instructor, "And I don't care. If you write code that
doesn't make it clear what you're doing, then you're making your code
harder to read, harder to maintain, and more susceptible to mistakes."

He was right. Today, I remain convinced that creating highly structured,
fully documented, _unambiguous_ code and schematics is one of the most
important things I do.

Years before I took the VHDL class, we hired a consultant to write some
code. What we received was 4000 lines of assembly without one single
comment (except the first line, which was the name of the source code
file). A coworker explained this in a way that has been echoed many times
throughout my career: "Job security. If it's not documented, you can't get
rid of him, since he's the only one who can change it."

Bob Lewis, who writes for Infoworld, put job security in much better terms:
Your value to a company is directly proportional to your ability to be
replaced. It seems completely backwards, but I'm convinced it's true. You
can only move to a new project or be promoted if someone can take your
place, and nobody can take your place if you're the only person who can
maintain some inconsistent, unreadable, undocumented pile of crap. If all
you can produce is that aforementioned dungheap, you're pretty near
worthless.

-- Mike --
 
"Chuck Harris" &lt;cfNOSPAMharris@erols.com&gt; wrote in message
news:40b1f342$0$3120$61fed72c@news.rcn.com...
Terry Given wrote:

more complete: BEDMAS
Brackets
Exponents
Division
Multiplication
Addition
Subtraction

Terru

I've never seen division given more precedence than
multiplication.

It's easier and clearer to throw in a few brackets and
eliminate all doubt.

-Chuck
M,D are interchangeable, as are A,S. BEDMAS just reads better than BEMDSA
thats all.

you are not wrong about extra brackets though. Especially when mutilating
equations with ascii

Terry
 
On Mon, 24 May 2004 22:21:14 -0700, Mike &lt;mike@nospam.com&gt; wrote:

[snip]
Years before I took the VHDL class, we hired a consultant to write some
code. What we received was 4000 lines of assembly without one single
comment (except the first line, which was the name of the source code
file). A coworker explained this in a way that has been echoed many times
throughout my career: "Job security. If it's not documented, you can't get
rid of him, since he's the only one who can change it."

[snip]
-- Mike --
I wouldn't accept work-product that isn't documented... circuit
designs OR software code. You are foolish if you do.

I've been recently discovering that I can't remember WHY some of my
old circuits work. I've thus started documenting again like I did in
my 20's, and digging thru my old work and adding documentation ;-)

...Jim Thompson
--
| James E.Thompson, P.E. | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona Voice:(480)460-2350 | |
| E-mail Address at Website Fax:(480)460-2142 | Brass Rat |
| http://www.analog-innovations.com | 1962 |

I love to cook with wine. Sometimes I even put it in the food.
 
Jim Thompson wrote:
On Mon, 24 May 2004 22:21:14 -0700, Mike &lt;mike@nospam.com&gt; wrote:

[snip]

Years before I took the VHDL class, we hired a consultant to write some
code. What we received was 4000 lines of assembly without one single
comment (except the first line, which was the name of the source code
file). A coworker explained this in a way that has been echoed many times
throughout my career: "Job security. If it's not documented, you can't get
rid of him, since he's the only one who can change it."


[snip]

-- Mike --


I wouldn't accept work-product that isn't documented... circuit
designs OR software code. You are foolish if you do.
It's not always that the programmer doesn't want to document, often
his boss has so seriously underestimated the project that there isn't
enough time to do the job, let alone document it. I have had clients
put *serious* pressure on me to "go with the flow" and document the job
in some ficticious time that will be found *later*. I have refused, and
I have gotten fired as a result.

-Chuck
 
On Tue, 25 May 2004 16:29:44 -0400, Chuck Harris
&lt;cfNOSPAMharris@erols.com&gt; wrote:

Jim Thompson wrote:
On Mon, 24 May 2004 22:21:14 -0700, Mike &lt;mike@nospam.com&gt; wrote:

[snip]

Years before I took the VHDL class, we hired a consultant to write some
code. What we received was 4000 lines of assembly without one single
comment (except the first line, which was the name of the source code
file). A coworker explained this in a way that has been echoed many times
throughout my career: "Job security. If it's not documented, you can't get
rid of him, since he's the only one who can change it."


[snip]

-- Mike --


I wouldn't accept work-product that isn't documented... circuit
designs OR software code. You are foolish if you do.

It's not always that the programmer doesn't want to document, often
his boss has so seriously underestimated the project that there isn't
enough time to do the job, let alone document it. I have had clients
put *serious* pressure on me to "go with the flow" and document the job
in some ficticious time that will be found *later*. I have refused, and
I have gotten fired as a result.

-Chuck
Ah, yes. I have been "fired" several times. Rehired as much as two
years later to save the project. Amazing how much that can cost ;-)

...Jim Thompson
--
| James E.Thompson, P.E. | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona Voice:(480)460-2350 | |
| E-mail Address at Website Fax:(480)460-2142 | Brass Rat |
| http://www.analog-innovations.com | 1962 |

I love to cook with wine. Sometimes I even put it in the food.
 
I make no claims to sainthood, but I normally write the comments first, then
flesh them out to details, then as I keep detailing, I end up having to
write code.

Of course it's different when the spec has changed for the nth time.
Keeping the comments in sync with the code is harder.
 
"Chuck Harris" &lt;cfNOSPAMharris@erols.com&gt; wrote in message
news:40b2a1dc$0$3142$61fed72c@news.rcn.com...
[snip comparitively trivial stuff]
When I first started programming in C, I followed the conventions of
the programmers who wrote Unix Edition 6. They liked to show off how
tricky they were and wrote in the most terse way possible. Somewhere
along the journey, I got tired of having to puzzle out my old code, and
started writing code that was easy to understand. The same assembly
code comes out of the compiler either way... well, today's compilers
anyway.

-Chuck
Amen brother. Just because you can be a smart-arse doesnt mean you should ;}

The problem with terse code (and almost all cunning code falls into this
category too) is that its never very well documented. A year or five later,
it becomes someone elses nightmare. Often sooner - programmers move from job
to job, just like everyone else.

My pet peeve is people who (over-) use conditional assignments. Invariably
these compile to the same damn code as a nice IF statement. A terse IF can
be equally bad. I personally favour the following:

1) header blocks that detail the inputs, outputs, memory &amp; stack usage,
interrupt level, execution time etc. along with descriptions &amp; expected
ranges of all input, local, global &amp; output variables
2) description of task to be performed. If a mathematical
simplification/derivation is required, show it explicitly.
3) pseudocode algorithm
4) meaningful, helpful comments interspersed with code.
5) all cunning stunts clearly documented, in both the header and the code.
Specifically mention any prerequisites,eg flags set
6) use meaningful variable names in conjunction with so-called "hungarian
prefix notation" - agree upon a syntax that can describe all the variables
you will need, say AKPUW_current_gain_setpoint[] would be an Array of
Konstant Pointers to Unsigned Words, in this context probably used with
indirect addressing to gain-schedule a current controller (dont forget to
publish the standard. it should be a controlled document, just like a pcb
cad library :)
7) likewise use a standard format for laying out code (indenting etc)


most programmers HATE 6 and 7. I dont know why. yes it takes a bit more
typing (in theory; not much in practice). And it makes debugging and peer
reviews so much easier to do, allowing many obvious faults to be spotted
immediately (why are you writing a byte to that constant signed word? how
come you call that function from two different interrupt levels yet it uses
static local variables? etc). But no, some (most? what do others think?)
programmers behave like primadonnas, throwing hissy fits dare one suggest
such things "its art, you know, dont stifle my creativity". And many
engineering organisations put up with it, where they wont for drawings, cad
libraries etc. Oops, actually IME lots of companies do a terrible job of
controlling things like cad libraries and drawing revisions. And
consequently make numerous stupid, time consuming and costly mistakes.
usually again and again and again....

Cheers
Terry
 
Terry Given wrote:

"Chuck Harris" &lt;cfNOSPAMharris@erols.com&gt; wrote in message
news:40b2a1dc$0$3142$61fed72c@news.rcn.com...
[snip comparitively trivial stuff]

When I first started programming in C, I followed the conventions of
the programmers who wrote Unix Edition 6. They liked to show off how
tricky they were and wrote in the most terse way possible. Somewhere
along the journey, I got tired of having to puzzle out my old code, and
started writing code that was easy to understand. The same assembly
code comes out of the compiler either way... well, today's compilers
anyway.

-Chuck



Amen brother. Just because you can be a smart-arse doesnt mean you should ;}

The problem with terse code (and almost all cunning code falls into this
category too) is that its never very well documented. A year or five later,
it becomes someone elses nightmare. Often sooner - programmers move from job
to job, just like everyone else.

My pet peeve is people who (over-) use conditional assignments. Invariably
these compile to the same damn code as a nice IF statement. A terse IF can
be equally bad. I personally favour the following:

1) header blocks that detail the inputs, outputs, memory &amp; stack usage,
interrupt level, execution time etc. along with descriptions &amp; expected
ranges of all input, local, global &amp; output variables
2) description of task to be performed. If a mathematical
simplification/derivation is required, show it explicitly.
3) pseudocode algorithm
4) meaningful, helpful comments interspersed with code.
5) all cunning stunts clearly documented, in both the header and the code.
Specifically mention any prerequisites,eg flags set
6) use meaningful variable names in conjunction with so-called "hungarian
prefix notation" - agree upon a syntax that can describe all the variables
you will need, say AKPUW_current_gain_setpoint[] would be an Array of
Konstant Pointers to Unsigned Words, in this context probably used with
indirect addressing to gain-schedule a current controller (dont forget to
publish the standard. it should be a controlled document, just like a pcb
cad library :)
7) likewise use a standard format for laying out code (indenting etc)


most programmers HATE 6 and 7. I dont know why. yes it takes a bit more
typing (in theory; not much in practice). And it makes debugging and peer
reviews so much easier to do, allowing many obvious faults to be spotted
immediately (why are you writing a byte to that constant signed word? how
come you call that function from two different interrupt levels yet it uses
static local variables? etc). But no, some (most? what do others think?)
programmers behave like primadonnas, throwing hissy fits dare one suggest
such things "its art, you know, dont stifle my creativity". And many
engineering organisations put up with it, where they wont for drawings, cad
libraries etc. Oops, actually IME lots of companies do a terrible job of
controlling things like cad libraries and drawing revisions. And
consequently make numerous stupid, time consuming and costly mistakes.
usually again and again and again....

Cheers
Terry
At the very least every 'C' and 'C++' file should be headed with

// We don't need no steenking comments!

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
 
A comment:

Tim Wescott &lt;tim@wescottnospamdesign.com&gt; wrote:
6) use meaningful variable names in conjunction with so-called "hungarian
prefix notation" - agree upon a syntax that can describe all the
variables you will need, say AKPUW_current_gain_setpoint[] would be an
Array of Konstant Pointers to Unsigned Words, in this context probably
used with indirect addressing to gain-schedule a current controller
(dont forget to publish the standard. it should be a controlled
document, just like a pcb cad library :)
Personally, I think Hungarian notation is more trouble that it's worth _when
using modern tools_. By that I mean that all the tools I've used in the
past handful of years easily let you click on any object's name and find its
declaration, its actual type, etc. Not only does having something like
AKPUW in front of object names make the overall code less readible, but it
also tends to be at odds with 'information hiding' and 'abstraction' in that
I shouldn't _have_ to know that Current_Gain_SetPoint happens to be an array
of blah blah blah -- the operations I want to do with Current_Gain_SetPoint
should 'just work' because the person who designed the class made that the
case, or the compiler should complain that what I'm attempting isn't doable
anyway. (And while one then might still choose to, say, start performing
typecasting in some quick hack to make the code work, I'm all for throwing
up roadblocks in front of folks before they take the 'hack' route!)

Likewise, I also hate code that looks like this:

class SetpointClass // Skip 'class'
float SetPointSetting; // Skip 'SetPoint' -- sheesh!
....
SetpointClass mySetPointClass;
mySetPointClass.SetPointSetting=5.0;

You could convince me that on microcontrollers with lesser development tools
a SMALL amount of Hungarian notation is useful (e.g., pVar=...), but in my
experience people easily get carried away.

The reset of your suggestions I generally agree with.

most programmers HATE 6 and 7.
I imagine on #7 they don't object to a formatting all the code the same way,
they object to that formatting not being the way _they_ want it formatted!
I.e., they don't object to _a_ standard, they object to _the_ standard. :)

And it makes debugging and peer
reviews so much easier to do, allowing many obvious faults to be spotted
immediately (why are you writing a byte to that constant signed word? how
come you call that function from two different interrupt levels yet it
uses static local variables? etc).
They is the kind of thing that -- with proper design -- a compiler is better
at catching than people are. I'll readily support strongly typed languages,
for instance... although I do think that C++ does a much better job in that
it can be bypassed if you know what you're doing, whereas in VHDL there's no
escape (i.e., in C++ there's plenty of potential for abuse but also
potential for 'common sense,' whereas in VHDL you're simply not trusted,
period).

But no, some (most? what do others
think?) programmers behave like primadonnas, throwing hissy fits dare
one suggest such things "its art, you know, dont stifle my creativity".
If I'm being hired on a contract I'll do your Hungarian notation or whatever
other oddities the man wants. :)

And many engineering organisations put up with it, where they wont for
drawings, cad libraries etc.
I used to work at a place where the PCB layout guy had a directory structure
such that the then-current project was in a directory named "\old
stuff\junk". (He had gotten a newer hard drive -- hence the 'old stuff'
directory -- and the project had grown out of some experiments he started
with in his 'junk' directory.) :-( He also wasn't a believer in version
control software such as PVCS or SourceSafe, and hence had dozens of copies
of the same file ("widget.pcb" "widget old.pcb" "widget 03.pcb" "widget
new.pcb" "widget new new.pcb" arrrgggh!) lying around. Made trying to find
the most current version of any of his stuff most entertaining.

---Joel Kolstad
 
On Tue, 25 May 2004 14:25:33 -0700, "Terry Given"
&lt;the_domes@xtra.co.nz&gt; wrote:

"Chuck Harris" &lt;cfNOSPAMharris@erols.com&gt; wrote in message
news:40b2a1dc$0$3142$61fed72c@news.rcn.com...
[snip comparitively trivial stuff]
%

6) use meaningful variable names in conjunction with so-called "hungarian
prefix notation" - agree upon a syntax that can describe all the variables
you will need, say AKPUW_current_gain_setpoint[] would be an Array of
Konstant Pointers to Unsigned Words, in this context probably used with
indirect addressing to gain-schedule a current controller (dont forget to
publish the standard. it should be a controlled document, just like a pcb
cad library :)
7) likewise use a standard format for laying out code (indenting etc)


most programmers HATE 6 and 7. I dont know why. yes it takes a bit more
I only use hungarian on public and virtuals and the like. I dont see a
real need for it in methods that are not exposed to anyone else. As
for being maintainable, well with good comments on your declerators no
hugarian is really needed. Add to that, within a method everything
that is not declared within the method itself will be a public or
virtual which should already be hugarianised so you know what datatype
it is!!
 
On Wed, 26 May 2004 16:00:08 -0700, "Terry Given"
&lt;the_domes@xtra.co.nz&gt; wrote:
%&lt;

that for debugged circuitry. If you want to learn how to write real good sw
go look at the space shuttle code - 1 bug per 420,000 lines of code. And its
almost all done without writing code, but by careful and methodical
design/review.
Look at their budget and I bet they spend a day writing each line
broken down as follows on an eight hour day:

4hours. Initial meeting
2hours. Initial meeting review
1hour and 30 minutes. Peer review of single line of code
30minutes. coffee break before writing line of code.
OT:
1 hour documenting single line of code
1 min. Write line of code.
1 hour. check into source control and verify.

Then off for a week of testing.


PS, all my assembler uses methods.
 
On Tue, 25 May 2004 16:20:40 -0500, Dave VanHorn wrote:

Keeping the comments in sync with the code is harder.
A former coworker offers that as a reason that no code should be commented.
Since the comments won't be updated, a large percentage of them will be
wrong, and the comments will be worse than no comments at all.

I don't buy it. I write my code and my comments at the same time, or in the
case of a rewrite, I rewrite and recomment at the same time. I'm sure it
takes somewhat longer, but I usually find that writing code is the least
time consuming part of the project - figuring out what to write is the hard
part.

-- Mike --
 
"Mike" &lt;mike@nospam.com&gt; wrote in message
news:1pz5ltmxjxf0.by92z1jx1esz$.dlg@40tude.net...
On Tue, 25 May 2004 16:20:40 -0500, Dave VanHorn wrote:

Keeping the comments in sync with the code is harder.

A former coworker offers that as a reason that no code should be
commented.
Since the comments won't be updated, a large percentage of them will be
wrong, and the comments will be worse than no comments at all.
It's a valid point, but what I don't want in code, is what you're doing. I
can read the code for that.
I want WHY you're doing it. Why you didn't do it the obvious way, Why this
unusual thing was needed. What assumptions you were making about the input
and output, and maybe system status.

I don't buy it. I write my code and my comments at the same time, or in
the
case of a rewrite, I rewrite and recomment at the same time. I'm sure it
takes somewhat longer, but I usually find that writing code is the least
time consuming part of the project - figuring out what to write is the
hard
part.
Exactly.
 
"Mike" &lt;mike@nospam.com&gt; wrote in message
news:1pz5ltmxjxf0.by92z1jx1esz$.dlg@40tude.net...
On Tue, 25 May 2004 16:20:40 -0500, Dave VanHorn wrote:

Keeping the comments in sync with the code is harder.

A former coworker offers that as a reason that no code should be
commented.
Since the comments won't be updated, a large percentage of them will be
wrong, and the comments will be worse than no comments at all.

I don't buy it. I write my code and my comments at the same time, or in
the
case of a rewrite, I rewrite and recomment at the same time.
When rewriting, I often leave the previous code in place behind comment
separators, with a short explanation of what problems it cause, unless the
error is something small in size like an incorrect index, or mispelled word.
 
"Joel Kolstad" &lt;JKolstad71HatesSpam@Yahoo.Com&gt; wrote in message
news:c90ibk$clb$1@news.oregonstate.edu...
A comment:

Tim Wescott &lt;tim@wescottnospamdesign.com&gt; wrote:
6) use meaningful variable names in conjunction with so-called
"hungarian
prefix notation" - agree upon a syntax that can describe all the
variables you will need, say AKPUW_current_gain_setpoint[] would be an
Array of Konstant Pointers to Unsigned Words, in this context probably
used with indirect addressing to gain-schedule a current controller
(dont forget to publish the standard. it should be a controlled
document, just like a pcb cad library :)

Personally, I think Hungarian notation is more trouble that it's worth
_when
using modern tools_. By that I mean that all the tools I've used in the
past handful of years easily let you click on any object's name and find
its
declaration, its actual type, etc. Not only does having something like
AKPUW in front of object names make the overall code less readible, but it
also tends to be at odds with 'information hiding' and 'abstraction' in
that
I shouldn't _have_ to know that Current_Gain_SetPoint happens to be an
array
of blah blah blah -- the operations I want to do with
Current_Gain_SetPoint
should 'just work' because the person who designed the class made that the
case, or the compiler should complain that what I'm attempting isn't
doable
anyway. (And while one then might still choose to, say, start performing
typecasting in some quick hack to make the code work, I'm all for throwing
up roadblocks in front of folks before they take the 'hack' route!)
horses for courses. I am only ever involved with embedded software, (lots of
8051, various DSPs) the tools for which are generally nowhere near as good
as PC tools. The Hitachi SH2 C compiler was a nightmare.....couldnt reliably
make it use its own multiply instruction...ARGH! I have yet to attend a peer
review using anything other than paper that was as successful as the paper,
but I suppose a data projector might work (IME people get all carried away
with the computer, and stop thinking).

This actually opens up the whole 'C' pointer can of worms (pointers are at
the root of almost all programming fuckups (programmers are of course
responsible)). I just want the code to be so clear that ANYONE with a basic
engineering education can read it and understand it. In this regard,
abstraction is a bad thing - there arent that many instances (pun
unintentional) where a routine should not have to know what it is dealing
with (eg abstract data structure). Mostly the routine knows exactly what it
is fiddling with, and the abstraction is merely to comply with some
arbitrary comp.sci. "rule" that says thou shalt abstract.

Likewise, I also hate code that looks like this:

class SetpointClass // Skip 'class'
float SetPointSetting; // Skip 'SetPoint' -- sheesh!
...
SetpointClass mySetPointClass;
mySetPointClass.SetPointSetting=5.0;

You could convince me that on microcontrollers with lesser development
tools
a SMALL amount of Hungarian notation is useful (e.g., pVar=...), but in my
experience people easily get carried away.
I wish they would! vars like i, ii and iii make for horrid-to-read code.
even worse are a,b,c etc. Invariably I want to know what the programmer is
trying to do, followed closely by why.

The reset of your suggestions I generally agree with.

most programmers HATE 6 and 7.

I imagine on #7 they don't object to a formatting all the code the same
way,
they object to that formatting not being the way _they_ want it formatted!
I.e., they don't object to _a_ standard, they object to _the_ standard.
:)

And it makes debugging and peer
reviews so much easier to do, allowing many obvious faults to be
spotted
immediately (why are you writing a byte to that constant signed word?
how
come you call that function from two different interrupt levels yet it
uses static local variables? etc).

They is the kind of thing that -- with proper design -- a compiler is
better
at catching than people are. I'll readily support strongly typed
languages,
for instance... although I do think that C++ does a much better job in
that
it can be bypassed if you know what you're doing, whereas in VHDL there's
no
escape (i.e., in C++ there's plenty of potential for abuse but also
potential for 'common sense,' whereas in VHDL you're simply not trusted,
period).
I had a problem with a table-driven sin(theta) routine once - looked like
the table was wrong. Tried to run it in turbo-C to debug it, which helpfully
forced all my static const array contents to be 32-bit signed integers
rather than the 16-bit signed integers I asked for. which was no use to me.
So I ported it to Delphii. At compile time, Delphi spat the dummy, and
pointed out a whole bunch of out-of-range constants (they were) which is
what I was looking for. SH2 C happily compiled, and sin(theta) over- and
under-flowed as a result. death to poorly typed languages.


But no, some (most? what do others
think?) programmers behave like primadonnas, throwing hissy fits dare
one suggest such things "its art, you know, dont stifle my creativity".

If I'm being hired on a contract I'll do your Hungarian notation or
whatever
other oddities the man wants. :)

And many engineering organisations put up with it, where they wont for
drawings, cad libraries etc.

I used to work at a place where the PCB layout guy had a directory
structure
such that the then-current project was in a directory named "\old
stuff\junk". (He had gotten a newer hard drive -- hence the 'old stuff'
directory -- and the project had grown out of some experiments he started
with in his 'junk' directory.) :-( He also wasn't a believer in version
control software such as PVCS or SourceSafe, and hence had dozens of
copies
of the same file ("widget.pcb" "widget old.pcb" "widget 03.pcb" "widget
new.pcb" "widget new new.pcb" arrrgggh!) lying around. Made trying to
find
the most current version of any of his stuff most entertaining.

---Joel Kolstad
I've worked with guys like that. My favourite was the internal pcb layout
"rules" written by the VP of eng (ME, MIT) where he mentions that there are
3 library symbols for pcb-mount faston terminals, but two of them are wrong
so dont use them. I mean duh, why are they still in the library. No prizes
for guessing that their PCB prototypes werent that great - often bits didnt
fit in the holes.....

I posted a list of my books to ABSE BTW

Cheers
Terry
 
"The Real Andy" &lt;.pearson@wayit_dot_com_dot_au_remove_the_obvious_to_reply&gt;
wrote in message news:ecp7b0p0u4bln0sdv6fj7vfm5dugnbht3j@4ax.com...
On Tue, 25 May 2004 14:25:33 -0700, "Terry Given"
the_domes@xtra.co.nz&gt; wrote:

"Chuck Harris" &lt;cfNOSPAMharris@erols.com&gt; wrote in message
news:40b2a1dc$0$3142$61fed72c@news.rcn.com...
[snip comparitively trivial stuff]
%

6) use meaningful variable names in conjunction with so-called "hungarian
prefix notation" - agree upon a syntax that can describe all the
variables
you will need, say AKPUW_current_gain_setpoint[] would be an Array of
Konstant Pointers to Unsigned Words, in this context probably used with
indirect addressing to gain-schedule a current controller (dont forget to
publish the standard. it should be a controlled document, just like a pcb
cad library :)
7) likewise use a standard format for laying out code (indenting etc)


most programmers HATE 6 and 7. I dont know why. yes it takes a bit more

I only use hungarian on public and virtuals and the like. I dont see a
real need for it in methods that are not exposed to anyone else. As
for being maintainable, well with good comments on your declerators no
hugarian is really needed. Add to that, within a method everything
that is not declared within the method itself will be a public or
virtual which should already be hugarianised so you know what datatype
it is!!
Now implement your ideas in 8051 assembler - oops, look ma no methods. But
yes, if you use sensible variable names the HPN is perhaps unnecessary. My
entire thesis is that software is buggy, so make it easy to debug. Industry
standard practice is 5% error rate for debugged code. Its a lot less than
that for debugged circuitry. If you want to learn how to write real good sw
go look at the space shuttle code - 1 bug per 420,000 lines of code. And its
almost all done without writing code, but by careful and methodical
design/review.

Cheers
Terry
 
On Wed, 26 May 2004 12:06:19 -0700, "Richard Henry" &lt;rphenry@home.com&gt;
wrote:

%&lt;

When rewriting, I often leave the previous code in place behind comment
separators, with a short explanation of what problems it cause, unless the
error is something small in size like an incorrect index, or mispelled word.
This is not possible in some of the projects i've worked on. Leaving
in unused sections of code makes the source bloated and harder to
read. Using good source control eliminates the need to leave unused
code behind.
 

Welcome to EDABoard.com

Sponsor

Back
Top