Where is your preferred column width?
Poll is CLOSED
<80 characters
14%
80 characters
25%
100 characters
22%
120 characters
16%
>120 characters
15%
something else (comment below)
9%
198 votes
9 Comments
Time DescendingWell let's see. The options are thus:
- we pretend that we'll need to travel to 1987 and use an 80 column terminal to edit our work, unleashing the nightmares of stumping on stuck keys on long worn out Data General terminal keyboards
- we pretend that we'll need to edit our work in portait mode on a phone, unleashing the claustrophobic nightmares of errant-clicking an OSK with raspy, calloused thumbs in the haze of presbyopia
- or (god forbid) we format our work to suit a reasonable display for actual productive desktop work in this century.
I tend to format things around 100-120 characters per line, even in cases where the editor pane of the IDE is only half the screen width. I used approximately the same width even when I was still running glass at 4:3, so the excuses are paper thin at this point.
I don't like the MATLAB editor automatically splitting lines for me or putting a vertical line down the right column so I usually set those two preference settings high, like 222. If it's not, it might automatically split the line at 75 characters but I only had one word to add and I want the comment to be all on the same line with 80, not one line with 75 and another line with 5 characters. So I essentially turn it off. I'll split the lines myself, where I want, manually thank you.
GOOD
Column width for what? The Editor? For me that depends on the number of open files. I like it to be wide enough to see all tabs.
I no longer have a predetermined fixed line length (even Fortran now has gone to free format) although I find that with high res monitors and reasonable font/size about 120 charachters fits nicely leavig room on the display for the base desktop to also be accessible (to get to the command window for trying out something, say).
Given that real estate is now available my coding style has evloved that code itself is probably 90% <60 characters on a line but comments are now (vertically aligned) at the end of line.
I just learned (by testing it in R2024b and R2025a) that MATLAB has a cap for this option: 160.
On the other hand, there is no minimum, other than that it has to be a positive number. I am not sure why having a column delimiter at one character would be useful, but it is allowed.
Sign in to participate