From: Ingo Molnar <mingo@elte.hu>
To: "Jörn Engel" <joern@logfs.org>
Cc: David Miller <davem@davemloft.net>,
jirislaby@gmail.com, viro@ZenIV.linux.org.uk, joe@perches.com,
tglx@linutronix.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 109/148] include/asm-x86/serial.h: checkpatch cleanups - formatting only
Date: Tue, 25 Mar 2008 14:38:10 +0100 [thread overview]
Message-ID: <20080325133810.GA10044@elte.hu> (raw)
In-Reply-To: <20080325131258.GC11359@logfs.org>
* Jörn Engel <joern@logfs.org> wrote:
> > The current visual inconsistency between subsystems makes the Linux
> > kernel appear rather unpleasant and unprofessional to new kernel
> > developers. This is not just embarrasing to us (we want to write the
> > best OS on the planet), it is also actively harmful: such a
> > "consistent style does not matter" stance turns away people who have
> > taste and tends to attract people who have no taste - which i'm sure
> > you'll agree with results in a deadly spiral if it gets strong
> > enough.
>
> I disagree with that assertion. My favorite example of where
> CodingStyle has gone too far is this:
> for (i=0; i<10; i++)
> While the official document demands four extra spaces, I _hate_ them.
> Whitespace offers visual grouping. The lack of whitespace around the
> binary operators emphasizes that one kind of grouping is stonger than
> another. Ever since this binary operator testament was added to our
> Holy Canon, I started violating the coding style on purpose. Imo this
> is beyond silly.
you picked an borderline case without showing the full effects of your
choice of style - but still even in this example you are wrong i
believe. Look at how inconsistent this looks:
for (i=0; i<10; i++) {
l = 10;
if (k <= 10)
k = 11;
}
(the inconsistent 'i=0' versus 'l = 10')
so in your style we'd have to write it as:
for (i=0; i<10; i++) {
l=10;
if (k<=10)
k=11;
}
which, on one hand, looks unprofessional (in fixed width font), but on
the other hand, the literals and operators are way too "close" to each
other and operators are easily missed and mis-identified visually -
causing bugs.
For example the 'k' and the '<=' operator may look visually similar and
can be "blended", making it easy to skip over 'k=10' versus 'k<=10' -
while 'k = 10' clearly stands apart from 'k <= 10'. [and syntax
highlighting does not help with this particular problem]
in Documentation/CodingStyle it looks:
for (i = 0; i < 10; i++) {
l = 10;
if (k <= 10)
k = 11;
}
which is certainly reasonable and groups safely.
yes - you can have arguments one way or another, but there's nothing
worse than maintainers each going towards their own _arbitrary_ and
often clearly inferior coding style, which is inconsistent within the
same file.
I at least make the point that i'm trying to converge to
Documentation/CodingStyle. Is it arbitrary? Yes, to a fair degree, but
it certainly conveys a very strong, unambiguous sense of taste.
Ingo
next prev parent reply other threads:[~2008-03-25 13:38 UTC|newest]
Thread overview: 218+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-23 8:01 [PATCH 0/148] include/asm-x86: checkpatch cleanups - formatting only Joe Perches
2008-03-23 8:01 ` [PATCH 001/148] include/asm-x86/acpi.h: " Joe Perches
2008-03-23 10:13 ` David Miller
2008-03-25 8:51 ` Ingo Molnar
2008-03-23 8:01 ` [PATCH 002/148] include/asm-x86/alternative.h: " Joe Perches
2008-03-23 8:01 ` [PATCH 003/148] include/asm-x86/a.out-core.h: " Joe Perches
2008-03-23 8:01 ` [PATCH 004/148] include/asm-x86/apicdef.h: " Joe Perches
2008-03-23 8:01 ` [PATCH 005/148] include/asm-x86/apic.h: " Joe Perches
2008-03-23 8:01 ` [PATCH 006/148] include/asm-x86/atomic_32.h: " Joe Perches
2008-03-23 8:01 ` [PATCH 007/148] include/asm-x86/atomic_64.h: " Joe Perches
2008-03-23 8:01 ` [PATCH 008/148] include/asm-x86/bitops_32.h: " Joe Perches
2008-03-23 8:01 ` [PATCH 009/148] include/asm-x86/bitops_64.h: " Joe Perches
2008-03-23 8:01 ` [PATCH 010/148] include/asm-x86/bitops.h: " Joe Perches
2008-03-23 8:01 ` [PATCH 011/148] include/asm-x86/bug.h: " Joe Perches
2008-03-23 8:01 ` [PATCH 012/148] include/asm-x86/byteorder.h: " Joe Perches
2008-03-23 8:01 ` [PATCH 013/148] include/asm-x86/cacheflush.h: " Joe Perches
2008-03-23 8:01 ` [PATCH 014/148] include/asm-x86/checksum_32.h: " Joe Perches
2008-03-23 8:01 ` [PATCH 015/148] include/asm-x86/checksum_64.h: " Joe Perches
2008-03-23 8:01 ` [PATCH 016/148] include/asm-x86/cmpxchg_32.h: " Joe Perches
2008-03-23 8:01 ` [PATCH 017/148] include/asm-x86/cmpxchg_64.h: " Joe Perches
2008-03-23 8:01 ` [PATCH 018/148] include/asm-x86/compat.h: " Joe Perches
2008-03-23 8:01 ` [PATCH 019/148] include/asm-x86/cpufeature.h: " Joe Perches
2008-03-25 15:30 ` Ingo Molnar
2008-03-25 18:27 ` Joe Perches
2008-03-25 20:15 ` Ingo Molnar
2008-03-23 8:01 ` [PATCH 020/148] include/asm-x86/current_32.h: " Joe Perches
2008-03-23 8:01 ` [PATCH 021/148] include/asm-x86/current_64.h: " Joe Perches
2008-03-23 8:01 ` [PATCH 022/148] include/asm-x86/desc_defs.h: " Joe Perches
2008-03-23 8:01 ` [PATCH 023/148] include/asm-x86/desc.h: " Joe Perches
2008-03-23 8:01 ` [PATCH 024/148] include/asm-x86/div64.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 025/148] include/asm-x86/dma.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 026/148] include/asm-x86/dma-mapping_32.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 027/148] include/asm-x86/dma-mapping_64.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 028/148] include/asm-x86/dwarf2_64.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 029/148] include/asm-x86/e820_32.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 030/148] include/asm-x86/e820_64.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 031/148] include/asm-x86/edac.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 032/148] include/asm-x86/efi.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 033/148] include/asm-x86/elf.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 034/148] include/asm-x86/fixmap_32.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 035/148] include/asm-x86/fixmap_64.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 036/148] include/asm-x86/floppy.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 037/148] include/asm-x86/futex.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 038/148] include/asm-x86/genapic_32.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 039/148] include/asm-x86/geode.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 040/148] include/asm-x86/highmem.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 041/148] include/asm-x86/hw_irq_64.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 042/148] include/asm-x86/hypertransport.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 043/148] include/asm-x86/i387.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 044/148] include/asm-x86/i8259.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 045/148] include/asm-x86/ia32.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 046/148] include/asm-x86/ide.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 047/148] include/asm-x86/io_32.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 048/148] include/asm-x86/io_64.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 049/148] include/asm-x86/ioctls.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 050/148] include/asm-x86/io.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 051/148] include/asm-x86/ipcbuf.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 052/148] include/asm-x86/ipi.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 053/148] include/asm-x86/irq_32.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 054/148] include/asm-x86/irq_64.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 055/148] include/asm-x86/irqflags.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 056/148] include/asm-x86/kdebug.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 057/148] include/asm-x86/kexec.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 058/148] include/asm-x86/kprobes.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 059/148] include/asm-x86/kvm_host.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 060/148] include/asm-x86/kvm_x86_emulate.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 061/148] include/asm-x86/lguest_hcall.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 062/148] include/asm-x86/lguest.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 063/148] include/asm-x86/linkage.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 064/148] include/asm-x86/local.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 065/148] include/asm-x86/mc146818rtc.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 066/148] include/asm-x86/mca_dma.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 067/148] include/asm-x86/mmu_context_32.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 068/148] include/asm-x86/mmu_context_64.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 069/148] include/asm-x86/mmu.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 070/148] include/asm-x86/mmx.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 071/148] include/asm-x86/mmzone_32.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 072/148] include/asm-x86/mmzone_64.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 073/148] include/asm-x86/mpspec_def.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 074/148] include/asm-x86/mpspec.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 075/148] include/asm-x86/msidef.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 076/148] include/asm-x86/msr.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 077/148] include/asm-x86/mtrr.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 078/148] include/asm-x86/mutex_32.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 079/148] include/asm-x86/mutex_64.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 080/148] include/asm-x86/numa_64.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 081/148] include/asm-x86/numaq.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 082/148] include/asm-x86/page_32.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 083/148] include/asm-x86/page_64.h: " Joe Perches
2008-03-23 8:02 ` [PATCH 084/148] include/asm-x86/param.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 085/148] include/asm-x86/paravirt.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 086/148] include/asm-x86/parport.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 087/148] include/asm-x86/pci_64.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 088/148] include/asm-x86/pci-direct.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 089/148] include/asm-x86/pci.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 090/148] include/asm-x86/pda.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 091/148] include/asm-x86/percpu.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 092/148] include/asm-x86/pgalloc.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 093/148] include/asm-x86/pgtable-2level.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 094/148] include/asm-x86/pgtable_32.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 095/148] include/asm-x86/pgtable-3level.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 096/148] include/asm-x86/pgtable_64.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 097/148] include/asm-x86/pgtable.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 098/148] include/asm-x86/posix_types_32.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 099/148] include/asm-x86/posix_types_64.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 100/148] include/asm-x86/processor.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 101/148] include/asm-x86/proto.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 102/148] include/asm-x86/ptrace.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 103/148] include/asm-x86/reboot.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 104/148] include/asm-x86/resume-trace.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 105/148] include/asm-x86/rio.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 106/148] include/asm-x86/rwsem.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 107/148] include/asm-x86/semaphore_32.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 108/148] include/asm-x86/semaphore_64.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 109/148] include/asm-x86/serial.h: " Joe Perches
2008-03-23 8:52 ` Al Viro
2008-03-23 10:20 ` David Miller
2008-03-23 12:06 ` Jiri Slaby
2008-03-23 12:19 ` David Miller
2008-03-23 12:24 ` Jiri Slaby
2008-03-23 12:30 ` David Miller
2008-03-23 12:49 ` checkpatch [was: include/asm-x86/serial.h: checkpatch cleanups - formatting only] Jiri Slaby
2008-03-23 17:36 ` Andi Kleen
2008-03-24 8:09 ` Jiri Slaby
2008-03-24 15:12 ` Jörn Engel
2008-03-24 16:28 ` Will Newton
2008-03-25 8:44 ` [PATCH 109/148] include/asm-x86/serial.h: checkpatch cleanups - formatting only Ingo Molnar
2008-03-25 9:42 ` David Miller
2008-03-25 13:05 ` Ingo Molnar
2008-03-25 13:17 ` Ingo Molnar
2008-03-25 23:09 ` David Miller
2008-03-26 10:25 ` Ingo Molnar
2008-03-26 10:39 ` David Miller
2008-03-25 10:48 ` Ingo Molnar
2008-03-25 11:11 ` Jörn Engel
2008-03-25 12:24 ` Ingo Molnar
2008-03-25 13:12 ` Jörn Engel
2008-03-25 13:38 ` Ingo Molnar [this message]
2008-03-25 13:45 ` Ingo Molnar
2008-03-25 16:07 ` Jörn Engel
2008-03-26 9:52 ` Andy Whitcroft
2008-03-26 10:26 ` Jörn Engel
2008-03-26 11:23 ` Ingo Molnar
2008-03-26 11:41 ` Jörn Engel
2008-03-26 11:48 ` David Miller
2008-03-26 11:58 ` Jörn Engel
2008-03-26 12:01 ` David Miller
2008-03-26 14:18 ` Jörn Engel
2008-03-26 12:03 ` Will Newton
2008-04-03 12:26 ` Vegard Nossum
2008-03-26 10:14 ` [patch] bkl2mtd: cleanup Ingo Molnar
2008-03-26 10:48 ` Al Viro
2008-03-26 10:57 ` Jörn Engel
2008-03-26 11:00 ` Ingo Molnar
2008-03-26 11:02 ` Ingo Molnar
2008-03-26 11:10 ` Ingo Molnar
2008-03-26 11:14 ` Jiri Slaby
2008-03-26 16:30 ` Joe Perches
2008-03-30 4:29 ` style of function definitions (Re: [patch] bkl2mtd: cleanup) Oleg Verych
2008-03-30 5:31 ` Jan Engelhardt
2008-03-31 3:37 ` Oleg Verych
2008-03-25 23:11 ` [PATCH 109/148] include/asm-x86/serial.h: checkpatch cleanups - formatting only David Miller
2008-03-26 9:36 ` Jörn Engel
2008-03-26 10:56 ` Ingo Molnar
2008-03-25 14:03 ` Ingo Molnar
2008-03-26 11:09 ` Christoph Hellwig
2008-03-26 11:28 ` Ingo Molnar
2008-03-25 12:26 ` Andi Kleen
2008-03-25 17:19 ` Peter Zijlstra
2008-03-25 17:28 ` Andi Kleen
2008-03-25 18:23 ` Paolo Ciarrocchi
2008-03-23 8:03 ` [PATCH 110/148] include/asm-x86/setup.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 111/148] include/asm-x86/sigcontext32.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 112/148] include/asm-x86/sigcontext.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 113/148] include/asm-x86/signal.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 114/148] include/asm-x86/smp_32.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 115/148] include/asm-x86/smp_64.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 116/148] include/asm-x86/spinlock.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 117/148] include/asm-x86/srat.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 118/148] include/asm-x86/string_32.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 119/148] include/asm-x86/string_64.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 120/148] include/asm-x86/suspend_32.h: " Joe Perches
2008-03-23 8:57 ` Alexey Dobriyan
2008-03-23 11:16 ` Peter Zijlstra
2008-03-23 8:03 ` [PATCH 121/148] include/asm-x86/suspend_64.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 122/148] include/asm-x86/swiotlb.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 123/148] include/asm-x86/sync_bitops.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 124/148] include/asm-x86/system.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 125/148] include/asm-x86/tce.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 126/148] include/asm-x86/termios.h: " Joe Perches
2008-03-23 12:41 ` Alan Cox
2008-03-23 8:03 ` [PATCH 127/148] include/asm-x86/thread_info_32.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 128/148] include/asm-x86/thread_info_64.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 129/148] include/asm-x86/thread_info.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 130/148] include/asm-x86/tlbflush.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 131/148] include/asm-x86/topology.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 132/148] include/asm-x86/tsc.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 133/148] include/asm-x86/uaccess_32.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 134/148] include/asm-x86/uaccess_64.h: " Joe Perches
2008-03-25 15:25 ` Ingo Molnar
2008-03-25 18:29 ` Joe Perches
2008-03-25 20:17 ` Ingo Molnar
2008-03-23 8:03 ` [PATCH 135/148] include/asm-x86/unaligned.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 136/148] include/asm-x86/unistd_32.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 137/148] include/asm-x86/unistd_64.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 138/148] include/asm-x86/user_32.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 139/148] include/asm-x86/user32.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 140/148] include/asm-x86/user_64.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 141/148] include/asm-x86/vdso.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 142/148] include/asm-x86/vga.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 143/148] include/asm-x86/vm86.h: " Joe Perches
2008-03-23 8:03 ` [PATCH 144/148] include/asm-x86/vmi.h: " Joe Perches
2008-03-23 8:04 ` [PATCH 145/148] include/asm-x86/voyager.h: " Joe Perches
2008-03-23 8:04 ` [PATCH 146/148] include/asm-x86/vsyscall.h: " Joe Perches
2008-03-23 8:04 ` [PATCH 147/148] include/asm-x86/xor_32.h: " Joe Perches
2008-03-23 8:04 ` [PATCH 148/148] include/asm-x86/xor_64.h: " Joe Perches
2008-03-23 9:09 ` [PATCH 0/148] include/asm-x86: " Ingo Molnar
2008-03-25 9:00 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080325133810.GA10044@elte.hu \
--to=mingo@elte.hu \
--cc=davem@davemloft.net \
--cc=jirislaby@gmail.com \
--cc=joe@perches.com \
--cc=joern@logfs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=viro@ZenIV.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox