Emacs has many commands designed to understand the syntax of programming languages such as Lisp and C. These commands can
Move over or kill balanced expressions or sexps (Section 24.2).
Move over or mark top-level expressions--defuns, in Lisp; functions, in C (Section 24.4).
Show how parentheses balance (Section 24.6).
Insert, kill or align comments (Section 24.7).
Follow the usual indentation conventions of the language (Section 24.5).
The commands for words, sentences and paragraphs are very useful in editing code even though their canonical application is for editing human language text. Most symbols contain words (Section 23.1); sentences can be found in strings and comments (Section 23.2). Paragraphs per se don't exist in code, but the paragraph commands are useful anyway, because programming language major modes define paragraphs to begin and end at blank lines (Section 23.3). Judicious use of blank lines to make the program clearer will also provide useful chunks of text for the paragraph commands to work on.
The selective display feature is useful for looking at the overall structure of a function (Section 13.9). This feature hides the lines that are indented more than a specified amount. Programming modes often support Outline minor mode (Section 23.8). The Foldout package provides folding-editor features ().
The "automatic typing" features may be useful for writing programs. .