[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Coding style - (Was Re: any chance of 2.6.0-test*?)


[Most of a discussion about coding style removed]

> As someone else pointed out, it's provable that goto isn't needed, and
> given that C is a minimalist language, I'm not sure why it was included.

It's worth keeping in mind, when coding in *any* language, that
concepts such as loops, functions, and any kind of 'structured'
programming, are all completely artificial concepts.

Microprocessors are essentially based around:

Loading discrete values to registers.
Loading discrete values into memory locations.
Copying a value from a register or a memory location, to another
register or a memory location.
Pushing and poping values on to and off of the stack.
Jumping to another location based on whether a register contains zero
or a non zero value.

The only thing that can really be considered anything like structured
programming is the stack, (and possibly interupts).

> But at least the code is "readable" when you do that.

Assember for a simple microprocessor such as a Z80 is arguable easier
to understand than C source code for something like the Linux kernel.

It's not the language, or how it is indented, that determines how
difficult code is to read.  It's the logic in the code.

John.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo _at_ vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


この情報があなたの探していたものかどうか選択してください。
yes/まさにこれだ!   no/違うなぁ   part/一部見つかった   try/これで試してみる

あなたが探していた情報はどのようなことか、ご自由に記入下さい。特に「まさにこれだ!」と言う場合は記入をお願いします。
例:「複数のマシンからCATV経由でipmasqueradeを利用してWebを参照したい場合の設定について」
References: