Maker Pro
Maker Pro

Programming for Electronics Engineers

D

Danny T

John said:
Modern OS's have gone a long way to making
programming something only pros have time to learn.

It's actually the *exact* opposite. Every year it gets easier and easier
to program. All the time, we're deciding it's too much work to do simple
jobs, so we add more and more levels of abstraction through more and
more languages.

I started to write a Tetris game in C++ once. I gave up before I got
anywhere, but writing to the screen was a massive task in itself. Today,
we have C# with Managed DirectX that allowed even a newbie like me to
create a 3D world containing meshes, and moving a camera around in 3D.
This in less than a few screenfulls of code.

Sadly, it means more and more people out there to take my job from me ;-(
 
J

Jim Thompson

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.
[snip]

Yep, I actually have other things to do besides start political flame
wars; although, I must admit, it certainly is great fun ;-)

...Jim Thompson
 
C

Charles W. Johson Jr.

John Larkin said:
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. We're solving math problems, so
user interface isn't important. The only eye candy that's really
useful to us is graphing data so we can get a feel for the dynamics of
a system, and even then we can dump a comma-delimited file to a
grapher program. Some of the stuff I do is very compute intensive, so
a pig like Visual Basic would be unusable. So what we need is a
simple, quick, easy to learn and easy to use language that runs fast.
And, at least for me, can do hardware i/o without requiring me to
write device drivers.

I think pRogramming should be the fourth 'R' of basic education,
something everybody can do. Modern OS's have gone a long way to making
programming something only pros have time to learn.

If I wanted to spend serious hours learning a new computer skill, it
would be learning Linux.

John

I see your point and for that I'd say a command line basic, compiled or not,
would be better than VB.

Charles
 
R

Rene Tschaggelar

John said:
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. We're solving math problems, so
user interface isn't important. The only eye candy that's really
useful to us is graphing data so we can get a feel for the dynamics of
a system, and even then we can dump a comma-delimited file to a
grapher program. Some of the stuff I do is very compute intensive, so
a pig like Visual Basic would be unusable. So what we need is a
simple, quick, easy to learn and easy to use language that runs fast.
And, at least for me, can do hardware i/o without requiring me to
write device drivers.

I think pRogramming should be the fourth 'R' of basic education,
something everybody can do. Modern OS's have gone a long way to making
programming something only pros have time to learn.

If I wanted to spend serious hours learning a new computer skill, it
would be learning Linux.

John,
I'm in the same situation and found Delphi(successor of
Turbopascal) very easy to use and remember. The driver part
is not doable. I thus was never able to write a PCI driver,
but use serial, serial_over_USB (aka virtual comport), and
Ethernet.
I'm glad my idustrial customers have no intention yet to
move to WinXP, nor DotNet.

Rene
 
J

John Larkin

John,
I'm in the same situation and found Delphi(successor of
Turbopascal) very easy to use and remember. The driver part
is not doable. I thus was never able to write a PCI driver,
but use serial, serial_over_USB (aka virtual comport), and
Ethernet.
I'm glad my idustrial customers have no intention yet to
move to WinXP, nor DotNet.

Rene


If you run in real mode, under DOS or '98, you can do some simple BIOS
calls to find a PCI card and drag it down into an uncached hole in the
640k-1m real addressing space, then you can flail its registers all
you want. We've even persuaded PCI bus masters to blast block-transfer
data directly into our arrays.

John
 
R

Rich Grise

I'm a Senior Web Developer, and around 80-90% of what I know has come
from the internet (for free)! When I was learning during
GCSEs/A-levels), I couldn't afford to buy books on subjects that may not
make me money, so I used the web. I'd highly recommend it over any book,
since you can read the opinions of a thousand people for free, not one
for £30. It's also full of up-to-date information - something a book (in
a non-electrical form) can never rival!

Don't forget Sturgeon's Law: "Nine tenths of everything is crap."

And the Internet corollary: 99% of everything on the internet is crap.

Cheers!
Rich
 
K

Ken Taylor

Rich Grise said:
Don't forget Sturgeon's Law: "Nine tenths of everything is crap."

And the Internet corollary: 99% of everything on the internet is crap.

Cheers!
Rich
I think you underestimate the level of crap around.

Ken
 
R

Rich Grise

.
I think pRogramming should be the fourth 'R' of basic education,
something everybody can do. Modern OS's have gone a long way to making
programming something only pros have time to learn.

If I wanted to spend serious hours learning a new computer skill, it
would be learning Linux.

With what you know now, you'd spend about four serious hours getting a
Linux system up and running, with all the tools you could ever want, built
in. Which language do you like?

C
C++
8086 assembly
Pascal
Fortran
perl
php
python
There may be more, this is OTTOMH.

And I'm pretty sure there's a way to do arithmetic in a shell script.

With Linux itself, there's very little you need to learn. I use Slack, but
I guess there are others that are recommended for "beginners". I've
tried Redmond^H^H^H^HHat, but found it too windows-ish for my taste;
other than that, you'd have to look around.

FWIW, the first time I downloaded and installed Linux (late 1990's), I
looked at the array of distros available, and decided on Slackware,
because I liked the name. :)

Have Fun!
Rich
 
K

Kryten

Rich Grise said:
On Sun, 16 Jan 2005 16:37:07 +0000, Danny T wrote:

Don't forget Sturgeon's Law: "Nine tenths of everything is crap."

What about my crap?

Is 10% of it something I don't know about?
 
K

keith

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, you should be using APL. It is *the*
engineer's language. Be warned though, it is write-only.
 
R

Rich Grise

What about my crap?

Is 10% of it something I don't know about?

Not exactly - it's just that part that you haven't _yet_ identified as
crap. :)

Cheers!
Rich
 
K

Ken Smith

John Larkin said:
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. We're solving math problems, so
user interface isn't important. The only eye candy that's really
useful to us is graphing data so we can get a feel for the dynamics of
a system, and even then we can dump a comma-delimited file to a
grapher program. Some of the stuff I do is very compute intensive, so
a pig like Visual Basic would be unusable. So what we need is a
simple, quick, easy to learn and easy to use language that runs fast.
And, at least for me, can do hardware i/o without requiring me to
write device drivers.

This sounds a lot like Borland Pascal.

It is a compiled language so it runs fast. The DOS IDE that came with it
is simple to use and easy to learn but very powerful and has a good
editor. Range checking is good for making sure you don't end up with a
nonsense result. Hardware I/O is easy to do. You can use 80 bit
"extended" variables to gain speed and accuracy in the results (no
rounding build up). It is not case sensitive so you don't need to be
quite as careful when typing.

example: (that actually does something)

{ <-- this is a comment --> }
var
q, p, r : extended; { Make my variables }

i : integer; { The usual loop counter }

{remember := is needed to assign }
begin
write('Q = '); readln(q); { Read in the values }
write('P = '); readln(p);

p := abs(p); { The sign doesn't matter }
q := abs(q);

if (p=0) and (q=0) then halt; { Don't use silly values }

if p<q then begin { p must be the bigger component.
r := p; p := q; q := r;
end;

if q<>0.0 then begin
for i := 1 to 10 do begin
r := q/p;
r := r*r;
r := r/(4+r);
p := p + 2*r*p;
q := q*r;
end;
end;

writeln('The radius is ',p);
end.


[....]
If I wanted to spend serious hours learning a new computer skill, it
would be learning Linux.

Get a good install disk, install it on a computer and use Open-Office.
You are at that point offically using Linux. Then you can learn things as
needed.
 
K

Ken Smith

John Larkin said:
If you run in real mode, under DOS or '98, you can do some simple BIOS
calls to find a PCI card and drag it down into an uncached hole in the
640k-1m real addressing space, then you can flail its registers all
you want. We've even persuaded PCI bus masters to blast block-transfer
data directly into our arrays.

Yes and win98 does the EMM386 stuff so you can access far more than the
640K, page by page and work with large amounts of data if you have to.

Also a DOS RS232 driver running in the "full screen mode" can keep up with
19200 baud data. If the Windows GUI is writing to the screen, you will
loose characters.

Note: This is not true on many laptops. On those laptops you also have
to unhook one of the vectors on the 18.2Hz interrupt so it doesn't run
with the interrupts off for so long. The vector does the power save
function.
 
K

Ken Smith

Rich Grise said:
And I'm pretty sure there's a way to do arithmetic in a shell script.


Under bash:

SUM = $(( $A + $B ))

It only does integers and the spaces have to be there.
 
K

Ken Smith

keith said:
If you *really* believe this, you should be using APL. It is *the*
engineer's language. Be warned though, it is write-only.

Back when I did APL, I could read it just fine. You can't read it aloud.
This is the mistake that people make.
 
B

Bjarne Bäckström

[...]
example: (that actually does something)

{ <-- this is a comment --> }
var
q, p, r : extended; { Make my variables }

i : integer; { The usual loop counter }

{remember := is needed to assign }
begin
write('Q = '); readln(q); { Read in the values }
write('P = '); readln(p);

p := abs(p); { The sign doesn't matter }
q := abs(q);

if (p=0) and (q=0) then halt; { Don't use silly values }

That's BAD user interface!

var
q, p, r : extended; { Make my variables }

i : integer; { The usual loop counter }
flag : boolean;

{remember := is needed to assign }
begin

repeat
flag := true;
write('Q = '); readln(q); { Read in the values }
write('P = '); readln(p);
if (p=0) and (q=0) then { Don't use silly values }
begin
writeln('Illegal value(s)');
writeln;
flag := false
end
until flag { = true } ;
p := abs(p); { The sign doesn't matter }
q := abs(q);


if p<q then begin { p must be the bigger component.
r := p; p := q; q := r;
end;

if q<>0.0 then begin
for i := 1 to 10 do begin
r := q/p;
r := r*r;
r := r/(4+r);
p := p + 2*r*p;
q := q*r;
end;
end;

writeln('The radius is ',p);
end.


[....]
 
J

John Larkin

[...]
That's a lot of trouble to avoid a couple of GOTOs. I never understood
the anti-GOTO religion.

Someone said that GOTOs were a bad thing and everyone believed him.

I feel that GOTO can be valid in a certain circumstances.

Such as GOTO <special exit point>.

However people will abuse anything they are offered, so
GOTO <valid local jump>
gets used a
GOTO <any place I damn well please anywhere in the entire program>

Given the scope for appalling abuse, it might be wise to recommend very
sparing usage.

I heard of a guy who's immediate boss (the company boss's son) thought all
code should use GOTO almost entirely, and tried to force everyone else to do
so.

I prefer very flat programs controlled by conditional GOTOs (or JMPs,
in assembly) that operate as state machines. After all, not many
computers have curly brackets in their native instruction sets. What
language you use, and how you use it, just depends on how you think.

John
 
J

John Larkin

Lower case helps even in assembly. The shape of the letters is easier
to distinguish so you can read it more easily.


No. Listings printed on my fanfold dot-matrix printer are much easier
to read in uppercase.

John
 
S

Spehro Pefhany

No. Listings printed on my fanfold dot-matrix printer are much easier
to read in uppercase.

John

I don't think I've printed a full program listing in years- last
fair-sized assembly project I wrote would have been close to 300 pages
single-spaced. Sometimes a few pages (one function, perhaps) in 9 pt
on the laser printer so I can pour over it at lunch. Pore over it,
too.


Best regards,
Spehro Pefhany
 
Top