|
|
Subscribe / Log in / New account

Kernel prepatch 3.11-rc4

Kernel prepatch 3.11-rc4

Posted Aug 5, 2013 11:01 UTC (Mon) by lkundrak (subscriber, #43452)
In reply to: Kernel prepatch 3.11-rc4 by NAR
Parent article: Kernel prepatch 3.11-rc4

Yoda condition it is.


to post comments

Kernel prepatch 3.11-rc4

Posted Aug 5, 2013 11:57 UTC (Mon) by hummassa (subscriber, #307) [Link] (7 responses)

People usually dislike Yoda conditions, and argue that compiler warnings are effective in avoiding this kind of mistake, but I think it is elegant.

I am obssessed with the whole "repeat until silently compile with -Wall" thing, and yet I think it is a good sign of humility ("I have got this wrong once or twice or a hundred time, I'll be on the watch from now on").

Kernel prepatch 3.11-rc4

Posted Aug 5, 2013 12:02 UTC (Mon) by mpr22 (subscriber, #60784) [Link]

I'd say that it's structurally elegant, but not visually elegant (and that the solution-by-good-design would have been to have := as assignment, == as comparison, and = as a syntax error).

Kernel prepatch 3.11-rc4

Posted Aug 5, 2013 13:14 UTC (Mon) by error27 (subscriber, #8346) [Link] (3 responses)

Messy code is like a dripping faucet or a toothache. It shouldn't make you irritable but it does. People don't go around talking like Yoda, it's annoying.

Kernel prepatch 3.11-rc4

Posted Aug 5, 2013 14:22 UTC (Mon) by hummassa (subscriber, #307) [Link] (2 responses)

My native language (Brazilian Portuguese, the "last flower of the Latium, uncultured and beautiful") has an olympic-gymnast flexibility towards the positioning of the elements in a phrase, and that flexibility has many poetic uses. So, to many poetry-inclined Brazucas like me, it's probably not as annoying.

Kernel prepatch 3.11-rc4

Posted Aug 5, 2013 15:51 UTC (Mon) by Cyberax (✭ supporter ✭, #52523) [Link] (1 responses)

Lots of synthetic languages (Slavic ones, most notably) have completely flexible word order. Yoda-speak sounds contrived in Russian, but not that much unusual - similar sentence constructions are used in official speech and in poetry.

Still, Yoda-assignment looks somehow unappealing.

Kernel prepatch 3.11-rc4

Posted Aug 6, 2013 7:16 UTC (Tue) by dgm (subscriber, #49227) [Link]

Pretty much, a yoda-assignement would not work at all :-P

Kernel prepatch 3.11-rc4

Posted Aug 6, 2013 7:14 UTC (Tue) by dgm (subscriber, #49227) [Link] (1 responses)

Another good sign of humility is using different compilers, as each usually has different sets of warnings. You actually learn a lot about the real C language (as opposed to the naive simplification one has in his mind when learning) by fixing pedantic compiler warnings.

Kernel prepatch 3.11-rc4

Posted Aug 6, 2013 11:54 UTC (Tue) by hummassa (subscriber, #307) [Link]

Oh, I am quite humbled by the sheer number of moving parts that autotools introduce in any simple program... :D


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds