Most open source software programs have been:
You can easily discern code of low quality by the following signs:
Read code selectively…
…with a goal in your mind. Are you trying to learn new patterns, a coding style, a way to satisfy some requirements? Alternatively, you may find yourself browsing code to pick up random gems. In that case, be ready to study in detail interesting parts you don’t know: language features (even if you know a language in depth, modern languages evolve with new features), APIs, Algorithms, data strucutres, Architectures, and design patterns.
The strategy for selectively dealing with parts of a large systems is outlined below:
Types of for loops:
Break and continue:
To determine the effect of a break statement, start reading the program upward from break until you encounter the first while, for, do or switch block that encloses the break statement. Locate the first statement after that loop; this will be the place where control will transfer when break is executed. Similarly, when examining code that constrains a continue statement, start reading the program upwards from continue until you encounter the first while, for, do loop that encloses the continue statement. Locate the last statement of that loop; immediately after it will be the place where control will transfer when continue is executed. Boolean expressions && and && operator (conjunction) the first expression to evaluate to false will terminate the whole expression –> yield false result expressions on the left of the expression you are examining are true!! operator (disjunction) the first expression to evaluate to true will terminate the evaluation of the whole expression yielding a true result expressions on the left of the expression you are examining are false
goto statement and spaghetti
Labels and goto statements should immediately raise your defenses when reading code. They can be easily abused to create “spaghetti” code: code with a flow of control that is difficult to follow and figure out. Therefore, the designers of Java decided not to support the goto statement. Fortunately, most modern programs use the goto statement in a small number of specific circumstances that do not adversely affect the program’s structure.
Readability and efficiency of codes…
There is no need to sacrifice code readability for efficiency. While it is true that efficient algorithms and certain optimizations can make the code more complicated and therefore more difficult to follow, this does not mean that making the code compact and unreadable will make it more efficient.
Pointer usage in C programs:
Common middleware architectures: