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

Re: any chance of 2.6.0-test*?


>> Harder to read: The primary code path is polluted with repetative code
>> that has no bearing on its primary mission.
>
> I thought it was easier to read.  For me, I can read "ok, this condition
> happens, I fail"... Or "if this other condition happens, I release my path,
> then I fail"...

over and over, with additions each time?

> Whereas the "goto out" was very unclear.  It made me page down to figure out
> what was going on.
>
> That's the whole point.. To just browse the code.. I shouldn't have to page
> down to understand what the code right in front of me is doing.  "goto out"
> is unclear.  "retun error" is clear.  "path_release" seems like a relatively
> plain english function name and I can guess what it does without knowing
> exactly what it does.  I can also surmise that if I go beyond a certain
> point in the function that I need to path_release() the same way a
> non-kernel programmer might need to free memory allocated inside of a
> function before returning to the calling function.
So you choose to agree with your lessons that goto is bad, but
ignore the other lesson that functions shouldn't have multiple
return paths?  Or didn't have that lesson?
~Randy



-
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を参照したい場合の設定について」
Follow-Ups: References: