[Courses] Re: pesky brackets

Mary Gardiner linuxchix at puzzling.org
Fri Jan 25 21:10:02 EST 2002


On Thu, Jan 24, 2002 at 10:28:40PM -0800, Xp0nential Xp0nential wrote:
> >  2. keep functions fairly short, so you can see where they start and
> >  end.
> depends on what you mean by short.  + thats not always possible

It isn't always possiblem but it's a good thing to try to do. Similar to
the idea that you should avoid GOTO statements where possible -
sometimes it is clean to use them many times not. The fact that it isn't
always possible doesn't mean that we shouldn't advise it where possible.

> one important way to also detect missing brackets is compilation
> errors and debugging. They help a lot once you get used to reading
> them correctly.

It takes a while though, and compilation errors are not written in a
beginner friendly manner. It can take time to work out what they're
saying.

On that note, people who are having problems compiling code should post
it here if at all possible. Post the exact text of the compile error and
the relevant piece of code. Explain what it is part of, what it's meant
to be doing. Be kind to people, preserve the indenting :-)

-Mary.

-- 
Mary Gardiner
<mary at puzzling.org>



More information about the Courses mailing list