Deutsch English Français Italiano |
<vpp8ag$31ooi$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com> Newsgroups: comp.lang.c Subject: Re: Which code style do you prefer the most? Date: Thu, 27 Feb 2025 09:38:40 +0100 Organization: A noiseless patient Spider Lines: 46 Message-ID: <vpp8ag$31ooi$1@dont-email.me> References: <vpkmq0$21php$1@dont-email.me> <vpl62m$250af$1@dont-email.me> <87frk10w51.fsf@onesoftnet.eu.org> <vpn8vs$2jmv1$1@dont-email.me> <vpn92i$86q$1@reader1.panix.com> <vpodnf$2q6ak$4@dont-email.me> <vpovd0$30d00$1@dont-email.me> <vpp011$30evb$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Date: Thu, 27 Feb 2025 09:38:41 +0100 (CET) Injection-Info: dont-email.me; posting-host="7a301de3e08edcb10ceefde6c0f3fc75"; logging-data="3203858"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ztyhtX5TERcIFGy0el0oS" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cancel-Lock: sha1:fT24DurtFk5kOGNmRCPFypdEEsg= X-Enigmail-Draft-Status: N1110 In-Reply-To: <vpp011$30evb$1@dont-email.me> Bytes: 3483 On 27.02.2025 07:17, Lawrence D'Oliveiro wrote: > On Thu, 27 Feb 2025 07:06:22 +0100, Janis Papanagnou wrote: > >> Another reason (that I mentioned in a recent post) is that you restrict >> your working quality [by not restricting line length] (for details see >> that previous post). > > Somebody is likely to bring this up sooner or later, so I might as well do > so. > > It is a fact that reading text is faster with shorter line lengths. This > is why newspapers have more, narrower columns, as opposed to fewer, wider > ones. So why do I have such long lines? > > In fact, the actual nonblank parts of my lines of source are not often > that long. So my choice of 100-column width is more to allow for levels of > indentation, rather than to be filled with long lines of text. Yes, very true. - Actually I thought about mentioning that myself, but I didn't want to open another can of worms. What I yet did not say is that the texts we operate on in IT are not the prose we find in books. There's more (structural!) factors that play a role and also relevant operational semantics relations. That said; there's still the upthread mentioned factors to consider when readability is concerned. And a sensible line length is crucial. Also note (WRT your newspaper comment) that the column width is even much smaller than in prose books; typically <40 columns. But I don't suggest to write 40 columns source text indented to arbitrary depth. Reality looks different. In my case I use reduced Tab-indentation to mostly 4 columns per indent, sometimes, depending on the source type, just 2 columns. Too deep indenting I consider to be a possible bad structuring effect, so that I sometimes have to refactor source code and put some code in functions to make it better structured and more readable. - I think we all observed such code evolutions, and we all have own standards/conventions to keep our code legible (if only for ourselves). But much (if not all) of that, indenting, line lengths, etc. is just preference anyway, mostly. It has to be sensibly defined or chosen, though, where different people work together. Janis