For a few decades I have had some ideas on what I’d like to see in an editor. I’ve also revised that and added to it over time. Some things I’d love to see in all editors include (but it might as well start with Codea):
- Half-height display of blank lines.
Why? Because UI experience in the last twenty years has demonstrated the value of “white space” (less is more). I make great use within my own code of blank lines between code blocks to help the developer-reader distinguish blocks of related code. But that also wastes a lot of screen space. I’d like to use white space to separate blocks of code, while being a little less wasteful of limited screen real estate. It would also be useful to separate code with varying lengths, depending on relative logical connection, like a 1/2 line or full line or 1 1/2 lines… the worst I’ll do now is one line versus two lines, or two blank lines with a one-line comment in between.
- Faded borders around logical code blocks.
Why? For decades (which seem like eons), programmers have used indentation (a manual workaround, maybe the first “hack” ever in computer programming) to distinguish “if/then” and loop code blocks. As time went on, editors added different colors for reserved words like “if” and “for”, and automatic indentation (which can be purposely or accidentally defeated, but mostly works).
But what I’d love to see is a very faded, almost barely visible border drawn around each code block (particularly for longer blocks, which are bad programming style to be avoided, but still always happen):
+---- if condition then -----------+ | print("Yes!") | | +--if other condition then -+ | | | print("Yeah!") | | | +--end-----------------+ | |---- else ----------------------| | print("Nuh uh") | +------------------------------+
Caveat: This is the kind of idea that might look great in my head, but in practice may just clutter the screen, and can be hard to do (like handling special cases, what if a developer puts an if statement all one line, like:
if true then print("true") else print("false") end
- Colors by type of variable
Okay, this does exist in many editors, just not Codea, but I’d like to see another color (or, if we’re running out of colors, a font style like bold or italic) IF the syntax reveals that a particular variable is a parameter versus local variable versus global. That can be tricky, because the editor will need some low level of syntax evaluation to figure that out, which is a lot of work for an editor. Other environments do do that (like XCode, Eclipse, IntelliJ) But it’s a really, really useful feedback to see that a variable has NOT been defined as local (you forgot to do it, which can cause really bad, hard to find bugs), or that it was passed in as a parameter.
But, as I said, doing this could be really tricky, so not a requirement…