[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 6502 illegal opcodes questions



Lyrical Nanoha wrote:
On Sun, 4 Jun 2006, Michael J. Mahon wrote:

<snips here and there>

It isn't about beauty--it's about clarity.  And there are *huge*
payoffs in adopting a standard format for programs--as, indeed,
most serious projects do.


I have a format of my own, which I adopted out of necessity - couldn't read my own code when it was all smashed against the left margin!

There is an almost universal appreciation of the value of syntax-
oriented formatting.  Of course, essentially all books show examples
of such formatting.

Capricious or misleading (non-syntactic) formatting would be a
disaster--even in a one-person programming team.  ;-)

Not everyone likes to spell words the same way, either, but we
don't care what they think--the convention is king.


Of course there is no single convention for C; I use braces on separate lines with an indent of 1 space within the braces, and my function headers are one line - and there is a minimum of whitespace against the last margin but it's fairly readable.

But within a programming project, *someone* will have to define a common
convention for all to use--otherwise, there will be lots of errors, and
design reviews will be a nightmare.  ;-)

BTW, programmers shouldn't choose names they "like", either.  Naming
should all be within a simple, rigid framework, so that the semantics
of any name are expressed by the identifier.


I use several metasyntactic names for throwaway variables (foo, bar, grill; travel, travel2, travel3; i, j, k; x, y, z), but usually it's something like "nolin" (number of lines), "curlin" (current line), etc. - an abbreviation, since I don't like to type any more than I have to.

For a small namespace, simple schemes can be workable, but for large
namespaces, with many hundreds of identifiers, naming conventions help
keep things straight, avoiding conflicts and, even more importantly,
providing instant recognition to a reader who understands the naming
convention.

-michael

Parallel computing for 8-bit Apple II's!
Home page:  http://members.aol.com/MJMahon/

"The wastebasket is our most important design
tool--and it is seriously underused."