How this brings back memories. I learned C on a Unix V7 machine
(PDP-11/45) using the original Bell Labs code. I was working for
Pacific Northwest Bell at the time and wrote most of the automated
data-gathering code in C for remote sites all over Oregon,
Washington and Idaho. Since the code ran in the wee hours of the
morning, it had to be fast to gather and compile all the data for
all those sites, so brevity was key there.
Then I went on to learn Pascal at Oregon Heath & Sciences
center. When I finally got my own personal computer in 1977, I
used Whitesmiths C compiler on a Z80 based MP/M system. Wrote a
satellite-tracking program for our ham club and had great fun
re-learning Solid Geometry.
On 07/02/2018 07:46 PM,
I like your rules
My standard for a function or any subroutine is simple do one
I guess that matches your no swiss knives. I call them overloaded
I think the best example of that is the SD library as it drags in
FAT. Its huge
and if all you want to do is read or write blocks FAT is not
needed or even
a file system. Or you can just do tag and bag directory and teach
to use a simpler system to talk to a block device. That is only
Took me a while to tear the whole thing down to
and block_read(blockNum, Buffer) Where buffer is a 512 byte area,
blockNum is a 32bit int. The difference is more than 10K of code!
Global variables are ok if used for that only. Not be cause the
needed a variable to store and intermediate result.
The offense i've seen is long ints when the counter never exceeds
and floats when the value is going to be an integer. Its
people forget the iron they are programing is basically a 8 bit
C and for that fact C++ is a small language, the libraries are
get their shorts eaten. You don't need a full string library for
a little 8bitter.
C seems to be there when others have come and gone. Just about
others are easy (Ruby, Python, Java) if you know C.
A a long time PDP11 user (I have Unix V2.11 and Ultrix V6(BSD
ITs funny to thing the 11 is a near native C machine (very CISIC)
the origin point for C and typically 128K bytes was a big
It teaches one brevity, modularity, and with care clarity.
I still use Small-c on many micros because it is C (more K&R
than ansi but hey
it was the 70s and ANSI was over a decade later) and small. I
like it because
it allows me to get as close to the irn as I care to and yet hide
the iron when I
Ron W7HD - NAQCC#7587 OMISS#9898 KX3#6966 LinuxUser#415320
Editor OVARC newsletter