Posts

Showing posts from August, 2023

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 ...