Ch 2 : Fundamental principles- To code better, faster, stronger..
There are certain tips and tricks that apply at all level of software development, processes that are virtually universal. In previous article we have read about A Pragmatic Philosophy. In this article will bring this ideas and process together from Pragmatic Programming.
We will learn very important key aspects like reversibility, orthogonality, estimations and more topics. By keeping these fundamental principles in mind during development You can write code that’s better, faster and stronger..
1. The Evils of duplication
This Principle warns you not to duplicate knowledge throughout systems.Write a code which is easy to Reuse
Don’t repeat yourself (DRY) — Every Piece of Knowledge Must have A single, Unambiguous, Authoritative representation within a system.
2. Orthogonality
This term is closely related to Evils of Duplication. Its tells not to split any one piece of knowledge across multiple system components
Example :- If two lines are orthogonal if they meet at right angles. The two lines are independent Move along one of the Line, doesn’t change another.
By writing Orthogonal systems you get two major benefits —
- Increased productivity
- Reduced risk.
3. Reversibility — ♻️
This principles say’s There are no final decision’s. Whatever mechanisms you use make it reversible.
If anything is added automatically, it can be taken out automatically as well, No one may know what the future may hold… So enable your code to rock-on-roll to “rock — on ” — When it can, to roll with the purchase when it must.
Nothing is more dangerous than an idea if it’s the only one you have — Email auguste Chartier
4. Tracer Bullets — Ready..fire..aim 🚅
Tracer bullets work because they operate in the same environment and under the same constraints as the real bullet. They Got to the target fast, so the gunner gets immediate feedback.
And from practical standpoint :- They are relatively cheap.. ✅
To get the same effect in code, We’re looking for something similar that get’s us from “A requirement to some aspect of the final system quickly, visibly and repeatably. So, Use Tracer bullet to find Target in code 💻
Advantages of using Tracer bullet while coding :-
- User get’s to see something working early
- Developers build the structure on work
- You have an integration platform
- You have something to demonstrate
- You have a better feel for progress
Though Tracer Bullet’s don’t always hit their Target..
Tracer Bullets help you to prototype more correctly and give Post it with you..
5. Prototype and post it notes —
Tracer bullet talk about style of development that allows you to gather requirements , test design and implement code at the same time. If this sound to good.. to be true it is : Tracer bullet development are not always applicable.
When they are not Prototypes and Post-it notes shows you how to use prototyping to test architecture, algorithm, interfaces and ideas.
You can prototype —
- New Functionality in existing system.
- Third party component tools and component
- Performance issue
- User interface design
- Domain Languages — program close to the problem domain
How Not to use Prototype :
Before you embark on any code based prototyping, Make sure everyone understand taht you are writing a disposable code,
Prototypes are deceptively attractive people who don’t know taht they are just prototype’s..
It’s easy to become misled prototypes and Project manager’s and Sponsors may insist on deploying it.
Remind them — you can make a great prototype of a new car out of balsa wood and duct tape, but you wouldn’t try to drive it in rush-hour traffic! 🚙 🚥
6. Estimating -Keep your bosses happy 😃
Whenever anyone asks estimates .. Don’t guess and give answer in hurry.. Think …!
Estimate to avoid surprises ..! 💥
- Understand What’s being asked?
- Build the model of the system
- Break the model into components
- Give each parameter a value
- Calculate the answers
- If you fail to estimate..? Keep track of your Estimating process. 🛤
- Estimate the Project Schedules -
- Iterate the Schedule with the code ..
What to say when Anyone ask for an Estimate
I’ll get back to you 😃
Summery..
Hope you have a good read. If you have found this useful, then please consider recommending and sharing it with your friends and other developers. Click the 💚 below to show your support and share it with other fellow Medium users. stay tuned..!