1206: Al-Jazari, an Arab engineer, invented a programmable drum machine that was able to play several drum patterns and rhythms through pegs and cams. Such a drum machine was a musical mechanical automaton. 1801: The Jacquard loom that was invented by Joseph Marie Jacquard (a French weaver) was able to produce different weaves by changing the 'program'. In the 9th century, various code-breaking algorithms were also introduced. An Arab mathematician Al-Kindi gave rise to an algorithm that was able to decipher the encrypted code. The algorithm was known as the Cryptographic algorithm. 1843: Ada Lovelace, a mathematician, published an algorithm for calculating a sequence of Bernoulli numbers. The algorithm was carried out by the Analytical Engine that was given by Charles Babbage. It was the year when the first computer program was dated. 1880: Herman Hollerith, an American inventor, invented the idea and concept to store data...
General coding guidelines provide the programmer with a set of the best methods which can be used to make programs more comfortable to read and maintain. Most of the examples use the C language syntax, but the guidelines can be tested to all languages. The following are some representative coding guidelines recommended by many software development organizations. 1. Line Length: It is considered a good practice to keep the length of source code lines at or below 80 characters. Lines longer than this may not be visible properly on some terminals and tools. Some printers will truncate lines longer than 80 columns. 2. Spacing: The appropriate use of spaces within a line of code can improve readability. Example: Bad: cost=price+(price*sales_tax) fprintf(stdout ,"The total cost is %5.2f\n",cost); Better: cost = price + ( price * sales_tax ) ...
General coding standards refers to how the developer writes code, so here we will discuss some essential standards regardless of the programming language being used. The following are some representative coding standards: Indentation: Proper and consistent indentation is essential in producing easy to read and maintainable programs. Indentation should be used to: Emphasize the body of a control structure such as a loop or a select statement. Emphasize the body of a conditional statement Emphasize a new scope block Inline comments: Inline comments analyze the functioning of the subroutine, or key aspects of the algorithm shall be frequently used. Rules for limiting the use of global: These rules file what types of data can be declared global and what cannot. Structured Programming: Structured (or Modular) Programming methods shall be used. "GOTO" statements shall not be used as they lead to "spaghetti" code, which is hard to read and maintain, except as out...
Comments
Post a Comment