Programming for Electronics Engineers

GOTO's are a positive menace. Any language which allows them is a disgrace
to mankind's considerable acheivements in that direction.

They constitute abandonment of essential discipline to complete chaos in
program structure. Helpful only to lazy, soltitary, so-called programmers,
obtaining money under false pretences, who are unable to remember what its
all about the next day. But GOTO's are wicked, useless, obstructions to
bug-finding and maintenance operations carried out by poor unfortunate later
workers who get all the blame for the enormous costs involved.

I first went on a 2-day computer programming course around 1962. Language
was un-named. But there was no GOTO. Never since been on such a course. The
computer was contained in a 5-foot, by 3-foot, by 2-foot case using discrete
transistors. About as sophisticated as a present-day pocket calculator. The
input/output device was a teleprinter using ticker-tape.

So I ought to know!

At the age of 79 and still programming, my favourite language is still the
well-disciplined Pascal. It doesn't have a GOTO instruction except the
in-offensive GoTo(X,Y), where X,Y is a screen coordinate ready for writing
or printing.

The most easy to understand language, of course, is Plain English. We are
still waiting for a compiler. Our Eastern friends, the hard-working
Chinese, look as though they may beat us to it!
----
Reg
 
On Wed, 19 Jan 2005 21:53:42 -0500, keith <krw@att.bizzzz> wrote:

No, it would be more proper to have all math operations be declared
external subroutines:

Div_Int_By_Float(*var1,*var2)

...and you like 'C' because it uses punctuation marks instead of keywords?
shudder
I despise C and 99% of C programs. I'd just like the language carried
to its logical conclusion, all punctuation and no internal operations
at all. Even the variable space and the stack should be external. So
to do a divide, one should properly say

Div_Int_By_Float(*varspace, *stack, *var1, *var2)

Functions then don't have an associated type, or return a value, since
there's nowhere in this language (C--) to return them to.

John
 
On Tue, 18 Jan 2005 19:36:33 +0000 (UTC), "Reg Edwards"
<g4fgq.regp@ZZZbtinternet.com> wrote:

GOTO's are a positive menace. Any language which allows them is a disgrace
to mankind's considerable acheivements in that direction.

They constitute abandonment of essential discipline to complete chaos in
program structure. Helpful only to lazy, soltitary, so-called programmers,
obtaining money under false pretences, who are unable to remember what its
all about the next day. But GOTO's are wicked, useless, obstructions to
bug-finding and maintenance operations carried out by poor unfortunate later
workers who get all the blame for the enormous costs involved.

I first went on a 2-day computer programming course around 1962. Language
was un-named. But there was no GOTO. Never since been on such a course. The
computer was contained in a 5-foot, by 3-foot, by 2-foot case using discrete
transistors. About as sophisticated as a present-day pocket calculator. The
input/output device was a teleprinter using ticker-tape.

So I ought to know!

At the age of 79 and still programming, my favourite language is still the
well-disciplined Pascal. It doesn't have a GOTO instruction except the
in-offensive GoTo(X,Y), where X,Y is a screen coordinate ready for writing
or printing.

The most easy to understand language, of course, is Plain English. We are
still waiting for a compiler. Our Eastern friends, the hard-working
Chinese, look as though they may beat us to it!
----
Reg
GOTO jail. Go directly to jail. Do not pass GO. Do not collect 200
pounds.

Plain English has the phrase GO TO, and makes very good use of it.
Don't be a programming snob.

Computer literacy is the ability of a computer to understand English.

d

Pearce Consulting
http://www.pearce.uk.com
 
On Tue, 18 Jan 2005 21:58:36 GMT, donald@pearce.uk.com (Don Pearce)
wrote:

On Tue, 18 Jan 2005 19:36:33 +0000 (UTC), "Reg Edwards"
g4fgq.regp@ZZZbtinternet.com> wrote:


GOTO's are a positive menace. Any language which allows them is a disgrace
to mankind's considerable acheivements in that direction.

[snip]

The most easy to understand language, of course, is Plain English. We are
still waiting for a compiler. Our Eastern friends, the hard-working
Chinese, look as though they may beat us to it!
----
Reg


GOTO jail. Go directly to jail. Do not pass GO. Do not collect 200
pounds.

Plain English has the phrase GO TO, and makes very good use of it.
Don't be a programming snob.

Computer literacy is the ability of a computer to understand English.

d

Pearce Consulting
http://www.pearce.uk.com
Reg opines as if his opinions have merit. They don't.

...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.
 
"Reg Edwards" <g4fgq.regp@ZZZbtinternet.com> wrote in message
news:csjog1$c45$1@sparta.btinternet.com...
GOTO's are a positive menace. Any language which allows them is a disgrace
to mankind's considerable acheivements in that direction.

They constitute abandonment of essential discipline to complete chaos in
program structure. Helpful only to lazy, soltitary, so-called programmers,
obtaining money under false pretences, who are unable to remember what its
all about the next day. But GOTO's are wicked, useless, obstructions to
bug-finding and maintenance operations carried out by poor unfortunate
later
workers who get all the blame for the enormous costs involved.

I first went on a 2-day computer programming course around 1962. Language
was un-named. But there was no GOTO. Never since been on such a course.
The
computer was contained in a 5-foot, by 3-foot, by 2-foot case using
discrete
transistors. About as sophisticated as a present-day pocket calculator.
The
input/output device was a teleprinter using ticker-tape.

So I ought to know!

At the age of 79 and still programming, my favourite language is still the
well-disciplined Pascal. It doesn't have a GOTO instruction except the
in-offensive GoTo(X,Y), where X,Y is a screen coordinate ready for writing
or printing.

The most easy to understand language, of course, is Plain English. We are
still waiting for a compiler. Our Eastern friends, the hard-working
Chinese, look as though they may beat us to it!
----
Reg
Nothing wrong with Pascal - it just aint that popular- but it most certainly
does allow conditional operations. (The odd prog.may be constructed as a
simple linear, single step, coding but they will be few and far between).
Just because something isn't labelled as a GOTO it doesn't mean that a GOTO
has not been constructed.
However if your understanding of the processes involved is so poor you
probably think that GOTO is unnescessary without realising why it isn't so.
A number of silly fantasies such as this grew up in the very early days of
software.

It is possible to never ever use the word NO in the english language (should
it be so desired).
It is not practically possible to avoid expressing a negative reply to a
question,request, etc.
There may, under different circumstances, be more erudite ways of saying NO,
but not always, and *always* it is a construccted NO.
One must be carefull that the construction is not the more complex and hence
the more prone to mis-interpretation (or should I say erroneous
programming).

Regards,
 
In article <1279u03gtecpr.1ghqmpe08o4gx.dlg@40tude.net>,
Bob Stephens <stephensyomamadigital@earthlink.net> wrote:
[...]
I'll probably regret this, but since you guys are so adamant in your
dislike of 'C', what would you recommend as a replacement? N.B. if you
amswer Visual Basic, I'm writing you out of the will.
I think a new language evolved from Pascal (The Borland version) is the
best direction. APL has too many problems with its lack of checking.
Borland extended Pascal to allow multifile projects and adding libraries.

--
--
kensmith@rahul.net forging knowledge
 
In article <pan.2005.01.21.11.20.24.176445@example.net>,
Rich Grise <richgrise@example.net> wrote:
[...]
I've heard that it's possible to do a "Towers of Hanoi" on a spreadsheet.
You can paint a house with a toothbrush.

--
--
kensmith@rahul.net forging knowledge
 
On Fri, 21 Jan 2005 14:50:35 GMT, Bob Stephens
<stephensyomamadigital@earthlink.net> wrote:

On Thu, 20 Jan 2005 21:37:32 -0500, keith wrote:

On Thu, 20 Jan 2005 10:12:55 -0800, John Larkin wrote:

On Wed, 19 Jan 2005 21:53:42 -0500, keith <krw@att.bizzzz> wrote:

No, it would be more proper to have all math operations be declared
external subroutines:

Div_Int_By_Float(*var1,*var2)

...and you like 'C' because it uses punctuation marks instead of keywords?
shudder


I despise C and 99% of C programs. I'd just like the language carried
to its logical conclusion, all punctuation and no internal operations
at all. Even the variable space and the stack should be external. So
to do a divide, one should properly say

Div_Int_By_Float(*varspace, *stack, *var1, *var2)

That's going to make formulas real cute to read. ...besides the fact that
a divide should be a function, not proceedure (returns a single value).

Though I do have to admit your suggestion would kill the language, and
that would be a good thing.


Functions then don't have an associated type, or return a value, since
there's nowhere in this language (C--) to return them to.

Umm, you described a proceedure, not function. Not only that, but your
proceedure would have to assume a type for data, since it's not specified
anywhere in your API. Operators and overloads are far more elegant and
safer than passing by reference. Ick!

I'll probably regret this, but since you guys are so adamant in your
dislike of 'C', what would you recommend as a replacement? N.B. if you
amswer Visual Basic, I'm writing you out of the will.
Since this thread is "programming for electronics engineers" and not
"programming for people who don't have anything else to do" I nominate
the various versions of PowerBasic.

Programming is a tool and a nuisance for me, so when I do have a
problem that requires software, I want to get it over as quickly and
cleanly as possible so I can move on to get more real work done. A
"professional" programmer will of course have different goals, since
he faces a lifetime of more of the same.

John
 
In article <1279u03gtecpr.1ghqmpe08o4gx.dlg@40tude.net>,
stephensyomamadigital@earthlink.net says...
On Thu, 20 Jan 2005 21:37:32 -0500, keith wrote:

On Thu, 20 Jan 2005 10:12:55 -0800, John Larkin wrote:

On Wed, 19 Jan 2005 21:53:42 -0500, keith <krw@att.bizzzz> wrote:

No, it would be more proper to have all math operations be declared
external subroutines:

Div_Int_By_Float(*var1,*var2)

...and you like 'C' because it uses punctuation marks instead of keywords?
shudder


I despise C and 99% of C programs. I'd just like the language carried
to its logical conclusion, all punctuation and no internal operations
at all. Even the variable space and the stack should be external. So
to do a divide, one should properly say

Div_Int_By_Float(*varspace, *stack, *var1, *var2)

That's going to make formulas real cute to read. ...besides the fact that
a divide should be a function, not proceedure (returns a single value).

Though I do have to admit your suggestion would kill the language, and
that would be a good thing.


Functions then don't have an associated type, or return a value, since
there's nowhere in this language (C--) to return them to.

Umm, you described a proceedure, not function. Not only that, but your
proceedure would have to assume a type for data, since it's not specified
anywhere in your API. Operators and overloads are far more elegant and
safer than passing by reference. Ick!

I'll probably regret this, but since you guys are so adamant in your
dislike of 'C', what would you recommend as a replacement? N.B. if you
amswer Visual Basic, I'm writing you out of the will.
Me? The last time I used BASIC was some 20 years ago when Tektronix
had a very nice version in their Signal Processing Systems (built-in
FFT, RFFT, Convolution, Correlation, etc.). As far as programming
languages go (thus ignoring VHDL), I much preferred PL/I and thought
Pascal was tolerable (other than its lack of I/O). Pretty much all the
programming I've done in the past 20 years has been in assembler. I'm
a hardware type and most of the programming I do is bit-banging on the
metal, thus the choice of assembler.

I've also mentioned that I've used Excel (the only product from M$ that
has a reason to live) for some rather interesting things too. There's
more power in there than most realize.

--
Keith
 
In article <goae86b5f0h9.1p69nwcabtf01.dlg@40tude.net>,
stephensyomamadigital@earthlink.net says...
On Fri, 21 Jan 2005 12:14:50 -0500, Keith Williams wrote:

In article <1279u03gtecpr.1ghqmpe08o4gx.dlg@40tude.net>,
stephensyomamadigital@earthlink.net says...
On Thu, 20 Jan 2005 21:37:32 -0500, keith wrote:

On Thu, 20 Jan 2005 10:12:55 -0800, John Larkin wrote:

On Wed, 19 Jan 2005 21:53:42 -0500, keith <krw@att.bizzzz> wrote:

No, it would be more proper to have all math operations be declared
external subroutines:

Div_Int_By_Float(*var1,*var2)

...and you like 'C' because it uses punctuation marks instead of keywords?
shudder


I despise C and 99% of C programs. I'd just like the language carried
to its logical conclusion, all punctuation and no internal operations
at all. Even the variable space and the stack should be external. So
to do a divide, one should properly say

Div_Int_By_Float(*varspace, *stack, *var1, *var2)

That's going to make formulas real cute to read. ...besides the fact that
a divide should be a function, not proceedure (returns a single value).

Though I do have to admit your suggestion would kill the language, and
that would be a good thing.


Functions then don't have an associated type, or return a value, since
there's nowhere in this language (C--) to return them to.

Umm, you described a proceedure, not function. Not only that, but your
proceedure would have to assume a type for data, since it's not specified
anywhere in your API. Operators and overloads are far more elegant and
safer than passing by reference. Ick!

I'll probably regret this, but since you guys are so adamant in your
dislike of 'C', what would you recommend as a replacement? N.B. if you
amswer Visual Basic, I'm writing you out of the will.

Me? The last time I used BASIC was some 20 years ago when Tektronix
had a very nice version in their Signal Processing Systems (built-in
FFT, RFFT, Convolution, Correlation, etc.). As far as programming
languages go (thus ignoring VHDL), I much preferred PL/I and thought
Pascal was tolerable (other than its lack of I/O). Pretty much all the
programming I've done in the past 20 years has been in assembler. I'm
a hardware type and most of the programming I do is bit-banging on the
metal, thus the choice of assembler.

I agree with you in principle, but Lordy, 'C' has saved me thousands of
hours of effort doing loops, conditionals, string manipulation etc. over
straight assembler.
I don't see these things (with the possible exception of strings) as
being all that difficult in assembler. One tends to do things the same
way each time. When I was doing a lot of MASM I had a toolbox of
macros for strings (and other similar functions) when I had to go
there. The big difference between assembler and HLLs that I could see
was in the eye-candy and computations. I didn't see any advantage for
bit-banging. IMO, assembler is much clearer here.
I've also mentioned that I've used Excel (the only product from M$ that
has a reason to live) for some rather interesting things too. There's
more power in there than most realize.

Care to elaborate?
I've used it for a lot of things, from the normal spreadsheet sorts of
things, to logic simulation and demonstration, to some fairly complex
functions. Someone once wanted a demonstration of ECC, so I coded up
and example (using an SDRAM interface as an example) in a few minutes.
We've done simulations of asynchronous logic with a spreadsheet. Get
one black-box done and block-copy multiple levels. Change a bit and
see the result.

Then there are the obvious spreadsheet type functions. Last year I had
to capture logic verification patterns to be used as input to a circuit
simulator. To do this I had to track the entity declarations of the
circuit's black-box back through several levels of hierarchy to the
signals driving them and generate pin-lists for the capture software.
Formatting the pinlists was a freebie (do it once and copy/paste) once
the signals were traced. As another freebie I output the pinlists for
the waveform viewing tool so we could see what patterns we were
capturing. Not any great shakes here, but all the formatting was
essentially free.

There are also functions buried in there that are quite useful to an
engineer (e.g. FFT).

--
Keith
 
In article <pan.2005.01.19.06.23.14.112876@example.net>,
Rich Grise <richgrise@example.net> wrote:
[...]
And a "GOTO" at the end of it destroys your continuity. A Wend closes the
loop.
"WEND" is short for "What the hell did that END" You have to put a comment
on it to say what it ended.

A GOTO can go anywhere, and is more likely to leave crap on the
stack from the call it's pooping out of.
Someone more expert in C will have to comment on this for C but in Pascal,
no you can't. Jumps out of context are not allowed. Algol had the
"thunk" method to handle the jump out of context. It is quite a good
idea.

It's a serious bug hole, and
hellishly difficult to debug.
Given any program that uses GOTOs, you can recode it as one using a loop
enclosing a "switch" statement with the index of the switch being
reasigned within the cases. Thus it is proven that the ability to assign
to a variable is as bad as the ability to assign to the program counter.



--
--
kensmith@rahul.net forging knowledge
 
On Fri, 21 Jan 2005 18:51:49 +0000, Guy Macon
<_see.web.page_@_www.guymacon.com_> wroth:

For the EE who wishes to program small/cheap 8-bit chips and wishes
to be able to outperform coworkers who are using assembly, Forth.
From what I see at work, I could use FORTH to outperform cow-orkers
using C/C++.

Jim
 
James Meyer wrote...
Guy Macon wrote,

For the EE who wishes to program small/cheap 8-bit chips and wishes
to be able to outperform coworkers who are using assembly, Forth.

From what I see at work, I could use FORTH to outperform co-workers
using C/C++.
Aha, two Forth fans!


--
Thanks,
- Win
 
On Fri, 21 Jan 2005 18:51:49 +0000, Guy Macon
<_see.web.page_@_www.guymacon.com_> wrote:


For the EE who uses Windows and just wants to be able to write
fast, bug-free programs to do calculations and access the PC
hardware for data aquisition, etc,, PowerBASIC Console Compiler.
I use the dos version a lot, mostly for the graphics. PBCC doesn't
have graphics... do you use one of the add-ons? How is it?

I think I have GraphicTools around here somewhere...

John
 
On Fri, 21 Jan 2005 11:13:23 +0000, Rich Grise wrote:

On Tue, 18 Jan 2005 09:59:39 -0500, Keith Williams wrote:

In article <pan.2005.01.18.00.14.33.342425@example.net>,
richgrise@example.net says...
On Mon, 17 Jan 2005 13:15:30 -0500, Keith Williams wrote:

In article <g8pnu01htct4j5v5vntev2met3g44tg9ht@4ax.com>,
jjSNIPlarkin@highTHISlandPLEASEtechnology.XXX says...
On Sun, 16 Jan 2005 22:21:06 -0500, keith <krw@att.bizzzz> wrote:

On Sun, 16 Jan 2005 10:00:06 -0800, John Larkin wrote:

On Sun, 16 Jan 2005 17:18:43 +0000, Danny T <danny@nospam.oops> wrote:

mc wrote:
The starter pack for Visual C# or Visual Basic (about $99) is very nice and
gives you the full power of the .NET Framework.

Is that like a cut down version of Visual Studio?

I use VS at work, but I've grown fond of the new Express packages.
They're lightweight and fast, though still beta (and using the next
version of the framework):

http://lab.msdn.microsoft.com/express/


You have to realize that guys like Jim and I are fulltime circuit
designers. We have an infinite, unlearnable amount of stuff to keep up
with in our own field, and all the work we can handle, often more. If
we do want to write a program to do some math, we need to do it
quickly, without spending a couple years getting up to speed in .NET
and C++ classes and stuff like that.

If you *really* believe this,

Of course I do.

you should be using APL.

Ah. Humor. Arrr Arrr.

None intentionally anyway. APL is a great engineering language.

Yeah, but where do you get the 300-key keyboard?

No need. I used APL on a PC (pre PS/2) keyboard. Before that, 2741s
(essentially ruggedized communicating Selectric typewriters) with APL
keyboards and type-balls. If you can put the character set on a golf-
ball it's not going to take 300 keys.

Well, admittedly, the "300" was a modicum of hyperbole on my part. I've
since been enlightened, since (I don't remember who) posted that, "Yes,
anyone can learn to read APL - it's only impossible to read it _aloud_.

;-)
As long as we're in fill discalaimer mode... I now remember the golf-ball
backing up to do over-strikes, so some characters needed three symbols
transmitted. And they didn't all fit on the ball as unique characters.
Hey, it's only been 20 years since I've touched APL! ;-)

--
Keith

Thanks!
Rich
 
On Fri, 21 Jan 2005 08:32:40 -0800, John Larkin wrote:

On Fri, 21 Jan 2005 14:50:35 GMT, Bob Stephens
stephensyomamadigital@earthlink.net> wrote:

On Thu, 20 Jan 2005 21:37:32 -0500, keith wrote:

On Thu, 20 Jan 2005 10:12:55 -0800, John Larkin wrote:

On Wed, 19 Jan 2005 21:53:42 -0500, keith <krw@att.bizzzz> wrote:

No, it would be more proper to have all math operations be declared
external subroutines:

Div_Int_By_Float(*var1,*var2)

...and you like 'C' because it uses punctuation marks instead of keywords?
shudder


I despise C and 99% of C programs. I'd just like the language carried
to its logical conclusion, all punctuation and no internal operations
at all. Even the variable space and the stack should be external. So
to do a divide, one should properly say

Div_Int_By_Float(*varspace, *stack, *var1, *var2)

That's going to make formulas real cute to read. ...besides the fact that
a divide should be a function, not proceedure (returns a single value).

Though I do have to admit your suggestion would kill the language, and
that would be a good thing.


Functions then don't have an associated type, or return a value, since
there's nowhere in this language (C--) to return them to.

Umm, you described a proceedure, not function. Not only that, but your
proceedure would have to assume a type for data, since it's not specified
anywhere in your API. Operators and overloads are far more elegant and
safer than passing by reference. Ick!

I'll probably regret this, but since you guys are so adamant in your
dislike of 'C', what would you recommend as a replacement? N.B. if you
amswer Visual Basic, I'm writing you out of the will.



Since this thread is "programming for electronics engineers" and not
"programming for people who don't have anything else to do" I nominate
the various versions of PowerBasic.
I've done BASIC, but I wasn't real happy doing it. Like I said in another
subthread, I did like the Tektronix SPS basic, because it had the concept
of a "waveform" and EE type functions built in. That was an EE language!

Programming is a tool and a nuisance for me,
You're kind. I hate programming, other than the widget I'm developing. I
hate programming general-purpose stuff.

when I do have a problem
that requires software, I want to get it over as quickly and cleanly as
possible so I can move on to get more real work done.
Sure. I haven't found that I need to do a lot of "programming" though.
Spreadsheets cover most of the ancillary crap I have to do.

"professional" programmer will of course have different goals, since he
faces a lifetime of more of the same.
Sure, they buy hardware that "works" too. Their job isn't to get it to
work.

--
Keith
 
In article <cssfc201q1r@drn.newsguy.com>,
Winfield Hill <hill_a@t_rowland-dotties-harvard-dot.s-edu> wrote:

James Meyer wrote...

Guy Macon wrote,

Aha, two Forth fans!
Three.

Plus Jerry Avins, who (unfortunately) only posts
here occasionally.

--
Tony Williams.
 
John Larkin wrote:

Guy Macon wrote:

For the EE who uses Windows and just wants to be able to write
fast, bug-free programs to do calculations and access the PC
hardware for data aquisition, etc,, PowerBASIC Console Compiler.

I use the dos version a lot, mostly for the graphics. PBCC doesn't
have graphics... do you use one of the add-ons? How is it?
I never use graphics.
 
On 21 Jan 2005 18:56:02 -0800, Winfield Hill
<hill_a@t_rowland-dotties-harvard-dot.s-edu> wroth:

James Meyer wrote...

Guy Macon wrote,

For the EE who wishes to program small/cheap 8-bit chips and wishes
to be able to outperform coworkers who are using assembly, Forth.

From what I see at work, I could use FORTH to outperform co-workers
using C/C++.

Aha, two Forth fans!
Did you manually change my "cow-orkers" to "co-workers"? Or did your
mail-reader do it for you? If you could see the nimnals I have to work with,
you'd know why they're cow-orkers instead of co-workers.

As an engineer/designer, FORTH appeals to me in the same way a well
stocked parts cabinet does. If I'm building hardware and I can't find a chip
that does exactly what I want, I can put together some lower level chips to do
the job. No signal generator? A quick Wein bridge from op-amps does it.

FORTH is like a well stocked parts cabnet. If there isn't a word that
does exactly what I want, I can either change one that comes close or throw one
together from scratch. With FORTH, I can know exactly what each and every part
of my program does. I don't waste my time trying to massage an ill fitting
library call that the original author never documented or even tested.

Jim
 
On Fri, 21 Jan 2005 23:38:14 +0000, James Meyer wrote:

On Fri, 21 Jan 2005 18:51:49 +0000, Guy Macon
_see.web.page_@_www.guymacon.com_> wroth:


For the EE who wishes to program small/cheap 8-bit chips and wishes
to be able to outperform coworkers who are using assembly, Forth.


From what I see at work, I could use FORTH to outperform cow-orkers
using C/C++.
In what way does FORTH "outperfrom" C/C++? Time to market or processing
speed? Both are obviously important, but I can't imagine FORTH winning
the latter.

--
Keith
 

Welcome to EDABoard.com

Sponsor

Back
Top