Weird question about the editor...
이전 댓글 표시
So this might be insanely daft of me to ask...
But most of my code writing takes place in the editor. When writing code/copy pasting stuff into a code comment I can't help but notice that thin line that runs veritcally down in the editor, over about 1/3 of the total lenth of the screen to the right of the code. What is this line? Why does it sometimes word-wrap my comments when it touches the line, and sometimes doesnt? Just a curious cat meowing into the midnight under the moonlight.
댓글 수: 8
"What is this line?"
Aaaaaaah, to understand that right-hand text limit (as it is called in the MATLAB settings) you have to delve into the history of computers. In short, it is because a long time ago computers could only hold/process/print a limited number of characters per line (limited by various technologies):
You can find more detailed history of this line online.
Programmers hold onto that line like a kind of comfort blanket, even though any technical neccessity it might once have had has been irrelevant for more than half a century. Feel free to ignore the line if you want (or change its placement in the settings), with the understanding that programmers are very delicate creatures and are easily surprised by small changes in what they see (in your code, in other languages, etc) and will let you know that you are doing something very very wrong... but are not really able to state exactly what.
Perhaps some of them will reply here.
Spaceman
2024년 3월 10일
Stephen23
2024년 3월 10일
"What do you have yours set to, by chance?"
The default... and I ignore it whenever I wish to.
The modern argument in favor of such a limit is that code lines above a certain length are harder for humans to parse and understand (and hence increase risk of bugs, etc). There is a certain truth to this, but in my experience that length depends highly on the content of that line, the content of adjacent lines, what kind of syntax is being used, etc. Thus out of many years practice I learn to use that limit as a guide but have no qualms about having shorter/longer lines when the context makes that an aesthetically better decision.
Spaceman
2024년 3월 14일
DGM
2024년 3월 14일
Why wait for the cat to step on the keyboard when you can let your IDE spontaneously slap a newline in the middle of what you're typing? With our advanced settings, the right-hand text limit is no longer just a mostly useless distraction, it can now double as a recurring nuisance! Brilliant!
I disabled everything related to the text limit.
Spaceman
2024년 3월 21일
DGM
2024년 3월 21일
To be fair, I've changed my formatting style a number of times over the years, but I never fail to think that I've got it nailed down tight. It's almost like I don't know what I'm doing. :)
Spaceman
2024년 4월 8일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Entering Commands에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!