Ehsan Ghanbari

Experience, DotNet, Solutions

YAGNI, Never Add Functionality Early

As a developer I always pretend that I know about principles, Rules, methods, KISS and YAGNI! But in some cases if you consider my codes you will find out that they are just some best bunch of code for giving an example as introduction dirty code for teaching YAGNI principle!

YAGNI is a principle of extreme programming that says "Never add functionality until deemed necessary". what I mostly make mistake is adding some extra functionality earlier and most of the time they never been used.


                                                                 Never Add Functionality Early


I think YAGNI is something more than coding correctly. Every aspect of task should be considered at the first and requirement must be analyzed. It seems that I'm not the only guys who write extra code! Only 10% of that extra stuff will ever get used, so you are wasting 90% of your time (I don’t remember where I've read this). Code should be ready for unexpected changes and open for modification but it DOES NOT mean to guess and implement the future of the product without any consideration, design, …

We Keep this at the forefront of our mind that practicing good architectures could be more vital on duplicating and guessing extra things. We must implement some generic and common operations of the application for once and cross cut it as we don't need to guess what else is required here or not.

So let's try to implement what we really need!


The meaning of Page Routing in nutshell

One of the most capabilities of modern web-based applications is the ability to swap content of the page without any page reload, Post-back and Request-Response. All of the operations are done by calling from UI and request from server and then changing the existing content of page with the newly retrieved contents.

That's what they call SPA (Single Page Applications),  working with these kinds of User interface is so easier as waiting for post back and refreshing  and replacing the pages sometimes are tedious. Rather than that in single page application most of the business rules are handles in UI and server side analyses are less in comparison to traditional web applications, so it tends to be more faster.   

Application lifecycle management(ALM)

Application lifecycle management is a set of pre-defined process and tools that include definition, design, development, testing, deployment and management to integrate, coordinate and manage the different phases of the software delivery process. It's not just writing code or a methodology to write better code and similar. It's just a continuous process of managing the life of a software application from concept to delivery throughout the entire development process.

By applying to ALM it's easy to coordinate the people, process and information in an iterative cycle of activities throughout the software-delivery supply chain. it help agile teams on making them to make better decision, manage costs and help them about the technical concerns. Throughout the ALM process, each of the software development processes could be easily monitored and controlled.

This first step in ALM is business case development analysis, it happens before the development process begins. Once the business case is approved, application development starts, and governance is now implemented through project portfolio management. The principal role of Application Lifecycle Management is to manage the life of a software application from concept to delivery throughout the entire development process. It provides visibility into product release readiness, automates development processes.

You can read more about ALM here as I did to learn and write this post:

Software development and butterfly effect

If you have developed a large scale system, you have seen that small mistaken changes at one place specially at the earlier steps has damaged the other parts in the future of the system. I'm not going to talk about a solution for it, Actually there is no any way to stop doing this changes and their affects. But you can reduce the amount of these unwilling issues by some technique.

These little changes at the first steps or maybe at a specific parts of software development ,is called butterfly effect which is discussed in chaos theory. Based on chaos theory small change anywhere in the system (requirement, analysis, design, code, testing) can cause a similar change nearby and that will another similar change. Maybe you have heard  that: "Small variation in the initial condition of a dynamic system may produce large variation in the long term behavior of the system", so it's worth to sit and analyze, design completely and then get start coding to reduce the butterfly effect in the future of your system.

This phenomena of sensitive dependence on initial conditions is known in physics as the butterfly effect. Errors in early collaboration, requirements, and design are tenfold as expensive to fix in the coding stage and it will be more expensive in the future. In general early analysis  about requirements at first (agile manifesto!), exact estimation of the project's scope, managing the development team(conventions and collaborations) are all the necessary to reduce the risky changes of a project.


Convention over configuration

Developers only need to specify unconventional aspects of the application and worry only about the unconventional parts of the application and architecture. Convention over configuration is a software design principle, philosophy and technique implied from the structure of the code instead of requiring explicit code. letting the code "just figure it out" from using naming conventions instead of explicit code or finding ways to avoid duplicating information in the system. Developers don't need to use a particular methodology or approach while that approach of methodology is true. During the development process, lots of events could be occurred, so you should follow some conventions and know them. But be careful that Too much convention can make code confusing and make system difficult to understand.

About Me

Ehsan Ghanbari

Hi! my name is Ehsan. I'm a developer, passionate technologist, and fan of clean code. I'm interested in enterprise and large-scale applications architecture and design patterns. I spend a lot of time on software architecture. Since 2008, I've been as a developer for different companies and organizations and I've been focusing on Microsoft ecosystem all the time. During the past years, Read More

Post Tags
Pending Blog Posts
using Elmah in MVC4
Using FluentSecurity in MVC
Strategic design
Factory Pattern
time out pattern in ajax
Redis as a cache server
How to use PagedList In MVC
Multiple submit buttons in MVC
Domain driven design VS model driven architecture
What's the DDD-lite?