Hacker News new | ask | show | jobs
by jacquesm 2776 days ago
> When you work without a screen you end up having to build up a mental model of the code, which you keep inside your head. When you navigate the code, you are doing it mentally, inside this cathedral you maintain in your mind.

Interesting! I am not visually impaired (not beyond what can be fixed with reading glasses), but I have always worked like that with code.

1 comments

To get some perspective on the difficulty of building this model, imagine you can see fine, but your screen can only display one word (token) at a time. You can navigate with arrow keys and a list of keyboard short-cuts.

This restriction applies to whether you are coding, browsing the web (on Stack Overflow), reading XML (shudder).

So the importance of a mental model is critical, because without maintaining context of where you are, you can get lost and spend too much time rediscovering your surroundings. The better your model the faster you can navigate and the less effort required in general.

I think you have nailed the reason why I work like that: I learned to program in the days of line editors. So it was quite like what you said, only not with a word at the time but a line at the time which is way too little context so you need something to offset that.
This might be a stupid question, but is there a kind of "modern" line editor, maybe with jump-to functionality, that would only show me one line of code at a time?

I wonder if programming like that would force an improvement in my code: kind of like programming through a keyhole, rather than the information overload of 20 documents open simultaneously.

Maybe an Emacs mode with Intellisense, that only showed a line at a time, with syntax highlighting?

Well, you could always set your window to be only one line high, that would have much the same effect.
Never used it standalone but I'd think that is what "ed" is?