[Coco] C VS Basic Coco

Rob Rosenbrock bester at adamswells.com
Wed Feb 14 13:41:54 EST 2018


> "*What's hard to find about that?*" - Find? Nothing's hard. Understand
> what
> "5000" means?  Impossible without reverse-engineering it (i.e. reading the
> code).  Keeping in your head what routines at what line numbers do for
> large program with 1000's of routines is not something I could do. :)
> Well
> (descriptively) named routines and variables can go a long way to making a
> program more easily understood and maintained.  You may understand what
> "5000" means now, but another developer looking at it probably won't, and
> the you 5 years in the future might not either.
>
> That said, I agree that the curly brackets don't necessarily add to the
> readability.  Proper indentation, naming of routines and variables, and
> spacing between routines can go a long way.  Unfortunately, CB/ECB/DECB
> doesn't allow for indentation nor naming (2 letters in no way allows
> proper
> naming).  I'm not familiar with Basic09 to know what it brings to the
> table.

Right: Readability!

While I don't think it's fair to compare an old interpreted BASIC to a
modern C (or even BASIC) compiler, I've run across far too many C programs
that are just too obfuscated to follow along. I once gave up trying to
read someone else's C code because I grew tired of wading through 50
different include statements!

I know most of us dislike adding comments. It's our code, and we know what
we did, right? I was taught to preface my (sub)routines with code that
explains its function, parameters, and the result to be returned. This has
helped a lot when coming back to my old code and trying to remember how it
was supposed to work. If I get hit by a bus tomorrow, someone will be able
to carry on my work.

I know what you mean about variable names. I used to keep a chart to
remind me what each variable represented. Now I use actual descriptions
for variables.



More information about the Coco mailing list