PLEX86  x86- Virtual Machine (VM) Program
 Plex86  |  CVS  |  Mailing List  |  Download  |  Computer Folklore

transputers again was: The dissolution of Commodore 2925


VPN Service Provider

David Scheidt ... snipped stuff with silly non-standard quote marks ...

Just to use your example, there are several things that can be done to improve legibility. First, don't overdo the indentation - I find 3 spaces is always adequate. Second, arrange the conditionals so that the else clause is the lengthy one. That makes it easy to follow the indentation up and find out what is really controlling end of that portion.

if (foo) { if (bar) { if (baz) { if (quox) { -stuff } else if (quoxx) { -stuff } } else if (bazz) { -stuff } } }

transputers again was: The dissolution of Commodore 2927
Now consider comparing subroutines with CISC instructions. And look at compilers analyzing statements from an HLL...

I also always give '}' a line for itself, except for the } while of a do-while loop. This differentiates it completely from the while clause of a while loop.

I have taken the above example and converted some of the tests to while and do-while loops as an example:

while (foo) { do { if (baz) { if (quox) { -stuff } else if (quoxx) { -stuff } } else if (bazz) { -stuff } } while (bar); }

Luckily indent can automate all this, at least for C.

transputers again was: The dissolution of Commodore 2926
Ok, people should not write long chunks of code. But a language should provide the...

-- "If you want to post a followup via groups.google.com, don't use the broken "Reply" link at the bottom of the article. Click on "show options" at the top of the article, then click on the "Reply" at the bottom of the article headers." - Keith Thompson


List | Previous | Next

transputers again was: The dissolution of Commodore 2926

Alt Folklore Computers Newsgroups

python was: transputers again was: The dissolution of Commodore 2924