Lecture14 - Wednesday, April 29 Project #3 Get moving Be...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
Wednesday, April 29 Wednesday, April 29 Project #3 Project #3 Get moving Get moving Be prepared for Rob’s seminar in class Friday Be prepared for Rob’s seminar in class Friday More changes in the calendar More changes in the calendar
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Today’s topics Today’s topics Linux Kernel Coding Style Linux Kernel Coding Style
Background image of page 2
The Linux Kernel Coding Style Being anal for a good reason. .. Greg Kroah-Hartman SuSE Labs / Novell Inc. gregkh@suse.de greg@kroah.com
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Why care? "Code formatting doesn’t matter." "Why is your style better than mine?" "Doesn’t affect compiled size." "Doesn’t affect execution speed."
Background image of page 4
Proven to matter "It is not merely a matter of aesthetics that programs  should be written in a particular style. Rather there is  a psychological basis for writing programs in a  conventional manner: Programmers have strong expectations that other  programmers will follow these discourse rules. If the rules are violated, then the utility afforded by the  expectations that programmers have built up over  time is effectively nullified."
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
So what are the rules? Documentation/CodingStyle
Background image of page 6
Indentation Use tabs. All tabs are 8 characters.
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Braces No braces for single-statement block if (error != -ENODEV) foo(); else goto exit;
Background image of page 8
Braces if   opening brace on condition line closing brace on separate line if (error != -ENODEV) { foo(); bar(); }
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Braces else on  if  closing brace line opening brace on  else  line closing brace on separate line if (error != -ENODEV) { foo(); bar(); } else { report_error(); goto exit; }
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 38

Lecture14 - Wednesday, April 29 Project #3 Get moving Be...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online