Posts

Showing posts with the label portability

Coding best practices - Part 3

Image
Coding best practices Published Version:  1.0 To check the 2nd part click the below link; Coding best practices - Part 2 DRY Principle DRY  stands for  Don't Repeat Yourself . Also known as  DIE :  Duplication is Evil . The principle states: " Every piece of knowledge must have a single, unambiguous, authoritative representation within a system. "  —  Wikipedia The purpose for most applications (or computers in general) is to  automate repetitive tasks . This principle should be maintained in all code, even web applications. The  same piece of code should not be repeated  over and over again. For example, most web applications consist of many pages. It's highly likely that these pages will contain  common elements . Headers and footers are usually the best candidates for this. It's not a good idea to keep copying and pasting these headers and footers into every page. Instead, put that header and footer code  in separate source ...

Coding best practices - Part 2

Image
Coding best practices Published Version: 1.0 To check the 1st part click the below link; Coding best practices - Part 1 Avoid Obvious Comments Commenting your code is fantastic; however, it can be overdone or just be plain redundant . Take this example: Fig 1: Incorrect example with Avoid Obvious Comments When the text is that obvious , it's really not productive to repeat it within comments. If you must comment on that code, you can simply combine it to a single line instead: Fig 2: Correct example with Avoid Obvious Comments Note: If you have to write more than a one-line comment to explain what the code is doing, you should consider rewriting the code to be more readable.

Coding best practices - Part 1

Image
Coding best practices Published Version: 1.0 What Does Coding Really Mean? The definition of " coding " means inputting commands in a language that computers can understand, to build websites, apps and software. Computer coding is the process of using a programming language to deliver instructions to a computer. The code tells the machine what tasks to perform and how to perform them. These detailed instructions are written in multiple lines of code, and a document full of code is called a script . The script directs the computer to carry out your desired actions. You have to ensure your code is correct, simple, clean and readable.  Purpose of Having Coding Standards Maintaining the coding standards is the best practices at the time of coding as because of; A coding standard gives a uniform appearance to the codes written by different engineers . It improves readability, and maintainability of the code and it reduces complexity also. It helps in code reuse and helps to de...