in application across various instances, as evidenced by the markup.ts application component used to beautify HTML, XML, and related technologies for the Pretty Diff tool. Programming code formatting Programmers often use tools to format programming language source code in a particular manner. Proper code formatting makes it easier to read and understand. Different programmers often prefer different styles of formatting, such as the use of code indentation and whitespace or positioning of braces. A code formatter converts source code from one format style to another. This is relatively straightforward because of the unambiguous syntax of programming languages. Code beautification involves parsing the source code into component structures, such as assignment statements, if blocks, loops, etc. (see also control flow), and formatting them in a manner specified by the user in a configuration file. Code beautifiers exist as standalone applications and built into text editors and integrated development environments. For example, Emacs' various language modes can correctly indent blocks of code attractively. HTML Lisp pretty-printer An early example of pretty-printing was Bill Gosper's "GRINDEF" (i.e. 'grind function') program (c. 1967), which used combinatorial search with pruning to format LISP programs. Early versions operated on the executable (list structure) form of the Lisp program and were oblivious to the special meanings of various functions. Later versions had special read conventions for incorporating non-executable comments and also for preserving read macros in unexpanded form. They also allowed special indentation conventions for special functions such as if. The term "grind" was used in some Lisp circles as a synonym for pretty-printing. Project style rules Many open source projects have established rules for code layout. The most typical are the GNU formatting and the BSD style. The biggest difference between the two is the location of the braces: in the GNU style, opening and closing braces are on lines by themselves, with the same indent. BSD style places an opening brace at the end of the preceding line, and the closing braces can be followed by else. The size of indent and location of whitespace also differs. Example of formatting and beautifying code The following example shows some typical C structures and how various indentation style rules format them. Without any formatting at all, it looks like this: int foo(int k){if(k<1||k>2){printf("out of range\n"); printf("this function requires a value of 1 or 2\n");}else{ printf("Switching\n");switch(k){case 1:printf("1\n");break;case 2:printf("2\n");break;}}} The GNU indent program produces the following output when asked