Two Dimensional Coding

Two dimensional coding is the idea to 'use horizontal spacing to vertically align similar text in code to improve readability'. quote from Todd Plessel

Or the idea could also be to 'make each page of code look like a picture of what it represents'. -- JonGrover

A good start has been made I believe by Todd Plessel, Lockheed Martin / US EPA. This CodingStandard can be found at http://www.cs.unc.edu/~smithja/MIMS/DataModel/development/plan/c_and_c++_coding_standard.html

Some day I hope to prepare a set of CodingStandards for this practice. -- JonGrover

My own attempt at this sort of standard is at http://www.kiva.net/~jgrover/style/Jonstyle.html. -- JonGrover


Discussion

It does not work, if you are using proportional font.

That's true and that may be a reason not to use it. In my experience, some people find color to be useful in programming, some like to see things arranged in two dimensions, some like very tiny fonts, some like a very regular standard, and I'm sure some people find programming easiest with a proportional font. I personally prefer everything in two dimensions. Another possible idea would be to write all programs using html hypertext, and strip out the tags before compiling. LiterateProgramming

And hence, the one use of tabs... but we all know how much trouble that'll get you into.


Before I became a rabid fan of TableOrientedProgramming, I had the habbit of lining up parameters in function calls (tables are in my genes it seems). The biggest problem of putting the entire code in tables is indendation. Perhaps if a tree-editor were used for the block structures (if and loop blocks), then tables for much of the rest, at least for repeating portions. Some combination of tree editor, table editor, and free-form text would have to be nicely integrated to pull it off it seems. Maybe the whole nested block sub-paradigm needs some rethinking. When I spot trees I start to get a little itchy. -- top


Couldn't 2-d coding also refer to BefungeLanguage, PathLanguage, or SnuspLanguage? -- KarlKnechtel


See also: ControlTable


EditText of this page (last edited May 23, 2004) or FindPage with title or text search