C_Toolshed thanks & ?
3 messages in this thread
Ben,
I've received the C_Toolshed, and after experimenting a little, I've
decided to try coding in the black-belt style. At first, it didn't look
any easier than any other C-code, especially since the only examples I had
to go on were the short routines included on disk, but then I compared a
small program as it was downloaded from CIS, and then formatting it
according to your style standards (by hand). I must admit, it was easy to
figure out where each clause went, etc., and I knew immediately when I was
off.
I also want to say that I really appreciate your flexible license
agreement. I can't take advantage of it, since I don't program the Amiga
for any company, but I definitely appreciate it, since I DO work as a
programmer on a mini-computer, doing development on a PC-Compatible.
I have a couple of questions regarding boiler.c:
switch(question)
{
case 0:
{
You make mention of Power Windows in the comments for
some of the routines. Is this program required to
utilize them?
}
case 1:
{
Regarding your formatting in boiler.c, specifically,
do_wb_args(): It starts out as follows:
Struct WBStartup *WBenchMsg;
{
struct WBArg *arg;
struct DiskObject *dptr;
These _ARE_NOT_ indented from the preceding
beginning brace–is this intentional? If so–why?
}
default:
{
So How'm I doin?
}
}
— Jane H. (Writing, it's easier read than done.)
You're doing well. :^)
I don't indent variables from the brace that contains them. This helps me
see variables and know that they are not code, without reading them.
You should be aware that C allows you to declare variables almost anywhere;
if your C style is such that you will be taking advantage of this, then
perhaps you will want to emulate the way the variables are declared in
Toolshed… I'm not nearly as "sticky" in my opinoins about variable
declarations because (a) they are usually set off ffrom the code, IE in
front ,and (b) because with the advent of the newer compilers, declarations
can have prototyping and other checking functions, features one wouldn't
want to give up for the small benefit (if any) of a particular declaratory
style.
Power windows isn't required for anything, you can always make structures
by hand. However, at about $100, Power Windows can save you many, many
hours when creating an application. I realize you're not at that point, but
if you decide you want to make something with a lot of gadgets, you should
certainly think about purchasing PW.
I'm glad that you could see the difference that the formatting makes. I
have always maintained that for many types of scanning a program, you can
use the "artistic" side of your head to deal with program clauses. The more
visual a style is, the better I like it. Styles that embed brackets
(clauses) make me feel like I have to read every line just to see the
control flow. And in many programs, control is almost everything.
Please note that we will be at the NY AmiExpo from the 15-17th, and that I
will be out of town from the 11th thru the 20th. I have a great deal to do
this next few weeks, but I *will* be back.
Ben
Amateur Radio Callsign is A A 7 A S
Thanks Ben,
— Jane H. (Writing, it's easier read than done.)