2. It is not the language that makes
programs appear simple. It is the
programmer that make the
language appear simple!
3. Class Discussion
4 Coding Principles That I Follow By Dev Adnani
Preparation Principles
Coding Principles
Validation Principles
4. Coding principles are guidelines that an industry, organization, team or
individual adopt to improve software designs and code implementation.
What is Coding Principles?
5. 4 Coding Principles
That I Follow
KISS
Keep It Simple Silly
The Simple You Keep Your Projects The Easier It Your Life Will be When It Comes To
Maintenance
DRY
Don't Repeat Your Self
Your Code Should Be Implemented In Just One Piece In The Source Code
The Opposite of DRY Principle Is WET ("Write Everything Twice")
SOC
SEPARATION OF CONCERNS!
This Principle Is Telling Us To Separate Responsibility Of Single Class To This Class & This
Class Only
YAGNI
YOU AIN'T GONNA NEED IT!
The Philosophy That Most Of The Code You Think You'll Need To Write & The Features ,
You'll Need To Implement Will Actually Turn Out To Be Unnecessary & Garbage
~ Dev Adnani
6. Preparation Principles
Understand of the problem you’re trying to solve.
Understand basic design principles and concepts.
Pick a programming language that meets the needs of the software to be
built and the environment in which it will operate.
Select a programming environment that provides tools that will make your work easier.
Create a set of unit tests that will be applied once the component you code is completed.
Before you write one line of code, be sure you
7. Coding Principles
Constrain your algorithms by following structured programming practice.
Consider the use of pair programming.
Select data structures that will meet the needs of the design.
Understand the software architecture and create interfaces that are consistent with it.
Keep conditional logic as simple as possible.
Create nested loops in a way that makes them easily testable.
Select meaningful variable names and follow other local coding standards.
Write code that is self-documenting.
Create a visual layout (e.g., indentation and blank lines) that aids understanding.
As you begin writing code, be sure you
8. Validation Principles
After you’ve completed your first coding pass, be sure you
Conduct a code walk through when appropriate.
Perform unit tests and correct errors you’ve uncovered.
Refactor the code.
9. That's it for
today's class!
Hope you had loads of fun
understanding coding principles
Dev Adnani IU198380001