Deutsch English Français Italiano |
<vpnr0n$2mq8h$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: David Brown <david.brown@hesbynett.no> Newsgroups: comp.lang.c Subject: Re: Which code style do you prefer the most? Date: Wed, 26 Feb 2025 20:45:27 +0100 Organization: A noiseless patient Spider Lines: 38 Message-ID: <vpnr0n$2mq8h$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> <vpnfmn$2ksdj$1@dont-email.me> <uAHvP.1352960$if26.668481@fx13.iad> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 26 Feb 2025 20:45:28 +0100 (CET) Injection-Info: dont-email.me; posting-host="215b4d371573711d49e34cbf56289f66"; logging-data="2844945"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/4Wsz8e77XL5p8cIkKVewMoycgo5uP0xI=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:GDF4NbJ30qAtiTh8WtmG3z0l9i4= Content-Language: en-GB In-Reply-To: <uAHvP.1352960$if26.668481@fx13.iad> Bytes: 3066 On 26/02/2025 17:47, Scott Lurndal wrote: > David Brown <david.brown@hesbynett.no> writes: >> On 26/02/2025 15:39, Bradley K. Sherman wrote: >>> Just do your best to keep it neat and under 80 columns. >>> >> >> Neat, yes. 80 columns, no - unless you are living in the previous century. >> >> Lines that are too long are hard to read, but the idea that 80 columns >> is a good number or should be a hard limit is /long/ outdated. About >> 100 - 120 columns is a better fit for a lot of code, letting you use >> sensible identifiers without excessively splitting logical lines into >> multiple physical lines. > > I tend to prefer the 80 column constraint. I use vim with > both horizontal and vertical splits to work on a codebase with > several hundred source files; 80-column lines are much easier > to read in that environment, where each split may only be 80 columns wide > with two or three vertical splits available on a wide (16x9) screen. > > Makes it easly to move between files/splits using the keyboard, especially > useful over ssh. I also work with multiple files on-screen at the same time, split in various ways. I also work with ssh and remote files, and use command-line editors on occasion. 80 columns is /not/ a magic number that works well in such situations. Sometimes I want more files on-screen at a time, in which case 80 columns is perhaps too wide. Usually, it is a little too narrow - you end up splitting lines artificially in a way that reduces legibility. If you find that 80 columns works well for you, fine - use 80 columns. I've nothing against rules or styles based on what works for any given person, or even if it's just personal preference. But I don't think much of a rule that exists primarily because of hardware limitations 40 years ago.