Development - Indenting and Formatting: Difference between revisions

From Bluefish Wiki
Jump to navigation Jump to search
Fal7i (talk | contribs)
m Created page with '__NOTOC__ __NOEDITSECTION__ {{Man2top |lang=en |rev=2.0.0 |st=d |Title=Chapter XII. Development guidelines |prev=Man 2 ch11s05 |Subtitle=Part 3. Developing Bl…'
 
Fal7i (talk | contribs)
mNo edit summary
Line 1: Line 1:
__NOTOC__
__NOEDITSECTION__
{{Man2top
{{Man2top
|lang=en
|lang=en
Line 10: Line 8:
|next=Man 2 ch12s02
|next=Man 2 ch12s02
}}
}}
== Chapter XII. Development guidelines ==
 
<div style="float:right; background-color:#E5ECF9;border:1px solid #3061C2;">
<div style="float:right; background-color:#E5ECF9;border:1px solid #3061C2;">
*[[# Indenting and formating style|1. Indenting and formating style]]  
*[[# Indenting and formating style|1. Indenting and formating style]]  

Revision as of 12:40, 31 December 2009


Work hard but have fun!

1. Indenting and formating style

Indenting can be done with the indent command line tool. Bluefish uses tabs - not spaces, and I'll explain why.

Some programmers prefer a lot of indenting, 8 characters, some prefer less, 3 characters. If Bluefish code was indented with spaces, these programmers had a problem, they would have to change the files to view it in their favourite layout. But because we use tabs, these programmers can simply set the tab width to a different value, and without changing the files it looks good for both programmers!

To indent properly with indent, issue this command:

$ indent --line-length 100 --k-and-r-style --tab-size 4 \
-bbo --ignore-newlines bluefishcode.c

Comment all public functions like it is done in bf_lib.c and gtk_easy.c (javadoc style, with some small differences), this can be used to create a function reference.