Saturday, June 30, 2012

Do You Know What Day It Is?

Have you ever sat in on a meeting like this?

Person 1:  The customer wants a green background on this page.

Person 2: Do we know they're going to stick with green?  Maybe we need a configuration option for background color.

Nobody wants to disagree and the manager never comes to these boring design meetings so there is quiet before somebody says...

Person 3: A configuration option just for background color is kind of weak, we'd be better off allowing choices for all colors.

Person 4: Is this an instance level configuration, or do we let the end-user pick her color?

Person 2 (the original troublemaker): well it really has to be instance level, but the end-user can override, that way we satisfy all possibilities.

From here the debate continues until they've decided to create a skinning system with lots of UI color pickers and other stuff, and they wrap up with:

Person 6: Well this sounds great, but what should we make the default background color?

...and nobody can remember that:

The customer specifically asked for green, only green, and nothing but green.

Is this an exaggeration?  Perhaps, but I've sat in meetings that come close.  Seems to me that I've sat in meetings that were worse, but I'd hate to slander anybody, and being as I'm not perfect myself, we'll leave that one alone for now.

So anyway, there were many things going wrong in that meeting, but we're going to stick with the simple fact that nobody there knew this one simple rule, the first rule of system design, which should be burned into your brain, which you should repeat before and during any design or architecture meeting:

Today's Constant is Tomorrow's Variable.

This is not so much a rule as an observation, but when you realize that it is true on almost any level, it can become a guiding rule, something that actually lets you make decisions with confidence, decisions that turn out to work well.

The problem is that most people in technology don't know what day it is.  They make one of two mistakes, they either:
  1. constantly plan, estimate, design, or program for tomorrow's variable when all they need to do is handle the simpler case of today's constant.
  2. or they don't realize that when "the customer changed the requirements!!!" the customer is doing what everybody does, taking something simple from yesterday and making it a bit more complex today.
So you can turn this around and say, "Everything I do today will get changed tomorrow.  It will become more complicated.  Everything I think is fixed or constant will float or become a variable."


What It Means

We've all learned (hopefully) that you don't embed constants in code because it makes the code difficult to change.  We define the constants in headers, or we accept all values from outside sources as parameters.  This makes the code more flexible, and it is a good thing.  The code is more robust, it can handle more cases without breaking or needing alteration.

The trick to using Ken's first and only rule of system design, "Today's Constant is Tomorrow's Variable" is to recognize the many forms of "constants" that we build into our systems in hard-to-reach places, making it hard to change them when tomorrow comes and they are no longer fixed and constant.

Another trick to using the rule is to always know what day it is.  Most of what I do today will involve features that may never change.  It is extremely easy to see how they might change, but impossible to know for sure.  So we leave them constant for today.


Back To That Meeting

Let's go back to that meeting we started with.  Here is how it goes when somebody knows that "Today's Constant is Tomorrow's Variable."


Person 1:  The customer wants a green background on this page.

Person 2: Do we know they're going to stick with green?  Maybe we need a configuration option for background color.

Our Hero:  We don't know they are going to stick with green because we never know if any customer is ever going to stick with anything, and we all know that today's constant is tomorrow's variable.  However, I hope we've put the styles into a style sheet and not embedded them directly into the HTML so we can change it later if we have to, right?


Somebody mumbles that yes in fact we do use style sheets, and the meeting moves on.


Is That  Lame Example?

That's a pretty lame example really, who doesn't use style sheets?  And who embeds constants in their code?

Well kiddies it turns out that we didn't always use style sheets.  When I got interested in web pages CSS was still optional (Yes! Believe it!) and you put your style information directly into tags, which was basically embedding constants into code, and it didn't take long before you intuitively realized this was not right, and you discovered CSS.  

It is amazing how often that basic pattern repeats itself, trying to identify what you thought was a constant, realizing it is "buried in code", and turning it into a variable.

Today's Post Is Tomorrow's Promise


I'll be posting a lot more on this subject, using a very reliable and strict schedule based on a host of variables that mostly comes down to whenever-the-hell-I-feel-like-it(TM).  

Cheers.

78 comments:

JulesLt said...

A key point to remember is that it is relatively easy to change a consistently used constant to a variable - less so hard-coded values of #00DD0000.

I'd also say "Today's variable is tomorrow's function" - and of course you'll never predict the function parameters - "we want custom backgrounds on major holidays".

KenDowns said...

Jules, agreed on all points, the rule is stated in a form that was as compact and easy to remember as I could get it, but it really does apply in all kinds of cases.

Your example of the function is exactly what I was going for, and what will be expanded upon in later posts.

Once upon a time there were no clusters (n=1) now we ask "How many boxes in the cluster?" Once upon a time a box ran an OS (n=1) now we say, "how many virtuals are on that physical?"

Anyway, more posts to come.

Anonymous said...

I think these rules should be applied generally. You never over engineer a solution -- there is no value in programming features before they are used. You should however accomodate future features, and this really just means writing clean, easy to maintain code. In the case of constants it means having the constant defined only one time.

Andy Lester said...

The most insidious YAGNI features are those we invent ourselves.

Phil Mayes said...

The rule I use is that the code should not contain any numbers other than 0 and 1.

Laptop Reviews said...

there is no value in programming features

Anonymous said...

Nice to see you posting again. I learned a lot by reading your posts, but of course do not agree with you on all points :). Just want to say thank you. Best wishes.

Cory Isaacson said...

The question to add on to this example came to mind where someone says, "Will we still want green if our business triples in size over the next six months?" Surprising how often scalability planning is overlooked.

Anonymous said...

According to me there have nice information

about Data service .Data service is

business increment process service. We get

and make business growth in market and also

get easy and good with best price and also

with customer requirement as. So Today I get

good Data service in UK .

Thanks & Regards
Data Supply Services UK

Genti Disha said...

The post is very interesting, I partly agree with you, please see my latest post at my blogger http://myprogrammingexamples.blogspot.com/

Earl said...

Hard coding is a almost always an error. The customer seldom knows what they want so I would suggest that variable are used to the extreme. Secondly, if you have the same situation twice (from different customers) maybe design a subroutine or function.

Anonymous said...

Agree with all the commenters. I do database work for clients in insurance and agriculture in both Regina and Saskatoon and never ever do I take what they say and set it in stone
Jvic31

Qadir Shaikh said...

hello sir,
thanks for sharing thia graet information.

Regards :
Qadir Shaikh

Tegar Fajar said...

Prediksi Bola | Judi Online | Bursa Taruhan Casino | Taruhan Bola
Judi Bola Terpercaya | Bandar Bola Online | Agen Taruhan
Prediksi Bola | Judi Online | Agen Casino | Taruhan Bola
Casino Online | Agen Bola | Prediksi Dan Berita Sepakbola
Agen Bola Online | Bandar Bola | Agen Casino| Situs Judi
Agen Bola | Taruhan Online | Bandar Judi Terpercaya
Agen Bola | Taruhan Bola Online | Agen Casino Terpercaya
Taruhan Bola | Judi Online | Agen Casino Terpercaya
Agen Bola Online, Situs Judi Casino Online, Bandar Taruhan Bola
Agen Casino | Judi Online | Bursa Taruhan | Bandar Bola
Agen Judi Bola | Bandar Bola Online | Casino Online
Informasi Terupdate | Sumber Berita | Sumber Inspirasi
Berita Terbaru | Inovatif
Berita Bola | Prediksi Bola Jitu
Hanya Untuk Anda Pecinta Dunia Maya
Info Masa Depan | Ulas Bola Hari Ini
Info Terupdate | Berita Inovatif | Berita Pilihan
Prediksi Skor | Berita Bola | Jadwal Bola
Prediksi Bola | Pasaran Bola | Berita Bola Online
Informasi Terkini | Prediksi Dan Berita Sepakbola
Info Berita Terbaik | Bursa Taruhan
Berita Terhangat | Info Masa Depan
Berita Terupdate | Sumber Berita
Hasil Skor | Prediksi Bola Terpercaya
agen texas poker dan domino
bola pelangi agen bola sbobet
Judi Online
Taruhan Bola
Agen Casino
Bandar Bola
Agen bola, poker, judi on-line, Prediksi bola, togel

Tegar Fajar said...


Info Skor Hari Ini | Update Bola
Prediksi Online | Bursa Taruhan Bola
Berita Terkini | Informasi Akurat Berimbang
Jadwal Dunia Sepak Bola | Prediksi Skor
Dapatkan Info Berita Bola Terbaru
Informasi | Berita Terbaru Era Masa Kini
Harian Bola | Bursa Online dan Berita Bola
Info Terakurat dan Terpercaya
Opini Info Terkini
Info Terkini | Kumpulan Informasi
Info Online | Berita Bola | Prediksi Skor | Cerita Dewasa
Semua Tentang Bola dan Khusus Dewasa
Portal Berita Bola | Prediksi Skor
Berita Informasi Terkini | Harian Bola | Ulas bola
Info Akurat | Prediksi Bola - Berita Bola - Jadwal Bola
Info Berita Bola | Prediksi Skor | Cerita Dewasa
Sumber Informasi Terkini | Cerita Dewasa
Berita Akurat Bola | Cerita Sex dan Foto Bugil | Prediksi Bola
Info Akurat | Cerpen Dewasa | Foto Seksi
Info Bola | Bursa Bandar Bola | Dewasa News
Prediksi Bola Malam | Berita Bola
Berita Baru dan Selalu Update
Informasi Terkini | Prediksi Dan Berita Sepakbola
Berita Terkini Dan Terpecaya
Bocoran Togelria.com | Prediksi Togel Singapura | Hongkong | Macau
Info Asia Skor | Prediksi Skor | Berita Bola
Info Berita | Prediksi Skor | Berita Bola | Tips Dan Trik
Ulas Bola Hari Ini | Prediksi Skor | Jadwal Bola
Agen Bola Sbobet
Agen Bola Sbobet - Judi Online | Bursa Taruhan Bola
Agen Bola Terpercaya | Judi Bola | Taruhan Bola Indonesia

Tegar Fajar said...



Buahpoker.com Agen Poker Domino Online Uang Asli Tanpa Robot
BUNDAPOKER.COM Agen Texas Poker dan Domino Online Indonesia Terpercaya
DaunPoker.Net Agen Poker Domino Online Indonesia Terbaik Terbesar dan Terpercaya
SaranaPoker.COM Agen Texas Poker Dan Domino Online Indonesia
GLOBALBOLA.COM Agen Bola Piala Dunia 2014 SBOBET IBCBET Casino Poker Tangkas Togel Online Terbaik Terbesar Dan Terpercaya
Buahpoker.com Agen Poker Domino Online Uang Asli Indonesia Terpercaya Tanpa Robot
DAUNPOKER.NET AGEN POKER DOMINO ONLINE INDONESIA TERBAIK TERBESAR DAN TERPERCAYA
Buahpoker.com Agen Poker Domino Online Uang Asli Indonesia Terpercaya Tanpa Robot
Daunpoker.net Agen Poker Domino Online Indonesia Terbaik Terbesar Dan Terpercaya
BUNDAPOKER.COM AGEN TEXAS POKER DAN DOMINO ONLINE INDONESIA TERPERCAYA
SARANAPOKER.COM AGEN TEXAS POKER DAN DOMINO ONLINE INDONESIA TERPERCAYA

Rafatta 99 said...

wow artikelnya HOT bagus bagus... tetap lanjut...
saya lg blogwolking klo berkenan kunjungi website saya... min... terimakasih

Agen Vimax Asli Original Canada.
KLG Pills Obat Pembesar Penis.
Vigrx Plus Obat Pembesar Penis.
Vimax Obat Pembesar Penis.
Vakum Pembesar Penis.
Boneka Full Body.
Penis Ikat Pinggang.
Obat Kuat Maximum.
Obat Kuat Viagra USA.
Vagina Senter.
Perangsang Potenzol.
Vakum Pembesar Payudara.
Penis Tekuk Manual.
Cobra Oil Pembesar Penis.

Kepuasan Customer Adalah Perioritas Bagi Kami. Terima Kasih
Selamat Berbelanja.

Affity Solutions said...

Thanks for your ideas. You can also find the details on Affity Solutions, at the System Programming. The main object of the Affity Solutions is to provide quality web services and is among the few software development company in Nagpur.

wakhid wicaksono said...

share, tips and trick how to make website with PHP 100%

obat herbal ambeien akut said...

cara mengatasi berbagai macam penyakit secara alami
Obat Herbal Penurun Darah Tinggi Obat Herbal Ambeien Akut Obat Herbal Batu Empedu Tanpa Operasi Obat Herbal Sinusitis Kronis Obat Herbal Tumor Otak Jinak Obat Herbal Wasir Kronis Tanpa Operasi Obat Herbal Liver Kronis Paling Ampuh Obat Herbal Bronkitis Kronis Obat Herbal Usus Buntu Tanpa Operasi Obat Herbal Eksim Paling Ampuh Obat Herbal Gagal Ginjal Kronis

obat herbal glaukoma said...

pengobatan penyakit glaukoma secara alami tanpa operasi

Obat Herbal Glaukoma

obat herbal kanker hati tanpa operasi said...

cara alami mengatasi penyakit kanker hati tanpa operasi
Obat Herbal Kanker Hati Tanpa Operasi

obat herbal tbc said...

your post is very interesting
thank you for sharing
i really liked

Obat Herbal TBC

obat herbal polip hidung said...

excellant post

Obat Herbal Polip Hidung

Tom Dcruze said...

Hai, its a very useful information.
A well-managed email database is by far the best way to boost sales without risking budget waste because it appeals to consumers who have already opted in to receive marketing information from you. Germany Mailing Lists

Reena S said...

Thanks for sharing this information,

keep updating more :)

Dot Net Training in Chennai

sindhuja sindhuja said...

Thank you for taking the time to provide us with your valuable information. We strive to provide our candidates with excellent care and we take your comments to heart.As always, we appreciate your confidence and trust in us
SEO Company in India

Anil Gupta said...

The blog is absolutely truly incredible. Lots of large information and inspiration, both of which we all need.
Web Designing Company in Bangalore, Web Development Company Bangalore

Prasanth said...

Thank you for posting the great content…I was looking for something like this…I found it quiet interesting, hopefully and you will keep posting such blogs….Keep sharing.
UI Design Company Bangalore, Web Application Development Services in Bangalore

mageswari j said...

Very Nice Blog I like the way you explained these things.
Indias Fastest Local Search Engine
CALL360
Indias Leading Local Business Directory

mageswari j said...

GREEN WOMEN HOSTELGreen Women hostel is one of the leading Ladies hostel in Adyar and we serving an excellent service to Staying people, We create a home atmosphere, it is the best place for Working WomenOur hostel Surrounded around bus depot, hospital, atm, bank, medical Shop & 24 hours Security Facility



Ajay Raj said...

Nice Posting...

Nice posting with useful information..

Red Hat Linux Training in Chennai
Rhce Training in Chennai

Unknown said...

thank the good topic.

gclub
gclub online
goldenslot

Freddie King said...

Thank you for taking the time and sharing this information with us. It was indeed very helpful and insightful while being straight forward and to the point.
www.mcdonaldsgutscheine.net/ | www.startlr.com/ | www.saludlimpia.com/

vijaya raghavan said...

Excellent blog,thanks for sharing such a wonderful information...
IOS Training in chennai

Ancy merina said...
This comment has been removed by the author.
ggwebstudio said...

I have read your blog its very attractive and impressive. I like it your blog.
AC Mechanic in Chennai
Auditoriums in Chennai
Automobile Batteries in Chennai
Automobile Spares in Chennai
Money Exchange in Chennai
Soft Skills Academy Chennai
Ceramics Showroom in Chennai
Yoga Class Chennai
Ladies Hostel Chennai
Computer Sales and Service

ggwebstudio said...

Excellent Article
AC Mechanic in Anna Nagar

Anonymous said...

nice blog has been shared by you.
Weblogic Administration Training

Peter Johnson said...

I Just Love to read Your Articles Because they are very easy to understand.Very Helpful Post And Explained Very Clearly About All the things.Very Helpful. Coming To Our Self We Provide Restaurant Equipment Parts Through Out US At Very Affordable Prices And Also We Offer Same Day Shipping In US.We Offer Only Genuine Products.Thanks For Posting.HAve a Nice Day!

seo said...

This Blog is very helpful and useful,came to know that i should be strong in my basics and this blog helps me to improve it,Urgent Care Services Provided by Us.Thanks For Posting.I Am refereed by my friend to this blog and i also want to refer my other friends to this blog.

Lathika Honey said...

I Just Love to read Your Articles Because they are very easy to understand US Medical Residency thanks for posting

24Layouts said...

Thanks For Posting......

Vizag Real Estate

suresh H said...
This comment has been removed by the author.
bhadra said...

I am happy to find this post Very useful for me, as it contains lot of information.... Web Development Services

Unknown said...

Best selenium online training institute `

Anoushka Sakthi said...

I have never read more interesting articles than yours before. You make me so easy to understand and I will continue to share this site. Thank you very much and more power!
French Classes in Chennai
French Course in Chennai
French Language Classes in Chennai
French Training Institutes in Chennai
French Class in Chennai
French Training

doll said...

There are some fascinating deadlines in this article but I don’t know if I see all of them center to heart. There may be some validity but I will take hold opinion till I look into it further. Good article , thanks and we want extra! Added to FeedBurner as wellImport Project Forecasts

Splendid Interiors said...

Ah,so beautiful and wonderful post!An opportunity to read a fantastic and imaginary blogs.It gives me lots of pleasure and interest.Thanks for sharing.
Find the Interior Designers in Vijayawada

Praylin S said...

Awesome post with great content! Looking forward for more posts from you. Thanks for sharing.
Ionic Training in Chennai | Ionic Course in Chennai | Ionic Training Course | Ionic Framework Training | Ionic Course | Ionic 2 Training | Ionic 2 Course | Ionic Training | Ionic Corporate Training

help with essay writing said...

Thank you for this information, I think it will be useful for me in the future.

Unknown said...

شركة تنظيف مجالس بالدمام

رجب البرنس said...


بسم الله الرحمن الرحيم تقدم لكم شركة الكمال جميع خدمات رش المبيد يجميع انحاء المملكة بافضل انواع

المبيدات للقضاء على جميع الحشرات الطائرة والزاحفه كالصراصير والفائران والنمل الابيض والبق

والذباب والناموس
شركة رش مبيدات بالطائف
شركة رش مبيدات بجازان
شركة رش مبيدات بحائل
والسلامه عليكم ورحمة الله وبركاته

Industrial IoT Shop said...

This is an excellent post I seen thanks to share it. It is really what I wanted to see hope in future you will continue for sharing such a excellent post

raspberry pi

Automation 2Solution said...

Great post. I was once checking constantly this weblog and I'm impressed! Extremely useful information specially the closing part. I maintain such information much. I was once seeking this specific information for a very long time. Many thanks and best of luck.


Mbus gateway

homework help said...

Very useful information for people, I think this is what everyone needs.

swashthik said...

Outstanding blog thanks for sharing such wonderful blog with us ,after long time came across such knowlegeble blog. keep sharing such informative blog with us.
oneplus mobile service centre
oneplus service center near me
oneplus service
oneplus service centres in chennai
oneplus service center velachery
oneplus service center in vadapalani

Industrial IoT Shop said...

Wow...this was really interesting!!!

Greetings! Very helpful advice within this post! It is the little changes which will make the greatest changes. Thanks for sharing!


Raspberry PI

Sharon Wood said...

Avast Support
Norton Contact Number
McAfee Contact Number

Jason said...

Looking for the best writing service online but lost in the number of fake reviews and don’t know who to believe? We at ScamFighter publish only genuine reviews on all writing service from the web. Look at the last review on https://scamfighter.net/review/papersowl.com

research topic in economics said...


Great and useful article. Creating content regularly is very tough.Thanks you.Write more.

Dale Morris said...

Norton helpline number
McAfee antivirus phone number
Malwarebytes support contact
Hp printer support chat
Canon printer support online

Unknown said...

In case you are struggling with such complexities and looking for someone to assist you with the finest English homework help online, come to us.

Unknown said...

Perlu diketahui bahwa sebenarnya tips diatas ini adalah tips yang sudah sayacoba dan saya uji langsung. Hasil yang di dapatkan pun memang berbuah positif.
asikqq
pionpoker
dewaqq
bandar ceme
sumoqq
hobiqq
paito warna
interqq
forum prediksi

bandar ceme online said...

tempat main ceme disini tempatnya

shivani said...

An overwhelming web journal I visit this blog, it's unfathomably amazing. Unusually, in this present blog's substance made inspiration driving truth and reasonable. The substance of data is enlightening
Oracle Fusion Financials Online Training
Oracle Fusion HCM Online Training
Oracle Fusion SCM Online Training

sriharsha byreddy said...
This comment has been removed by the author.
Lord Mark said...

Are you tired of being human, having talented brain turning to a vampire in a good posture in ten minutes, Do you want to have power and influence over others, To be charming and desirable, To have wealth, health, without delaying in a good human posture and becoming an immortal? If yes, these your chance. It's a world of vampire where life get easier,We have made so many persons vampires and have turned them rich, You will assured long life and prosperity, You shall be made to be very sensitive to mental alertness, Stronger and also very fast, You will not be restricted to walking at night only even at the very middle of broad day light you will be made to walk, This is an opportunity to have the human vampire virus to perform in a good posture. If you are interested contact us on Vampirelord7878@gmail.com

AllHelplineNumber said...

Xbox Customer Service Support Phone Number 1-800-382-3046 can also help you get any problem solving issue at our helpline number. Any assistance regarding your xbox then just dial for fast and reliable helpline number of many people prefer to go into a store before buying an expensive item so that they can have a demonstration of the product. If you are buying something for portability you will want to pick it up and hold it to make sure it is right for what you need.
Xbox Support Phone Number

JAck Ponting said...


Among all of its products ms office is the decisiveIT solution, which has lots of sub products like ms word, ms excel, power point, access etc.Ms Office gives a free rein to its productive tools and it is can be used in any work setup, be it home, school, office, or business
www.norton.com/setup
norton.com/setup
Norton Com Setup
Norton Setup Key

Office Setup
www.office.com/setup
office.com/setup

www.webroot.com/safe
webroot.com/safe
webroot Download

Anna Bean said...

Click here for solution
Click here for solution
Click here for solution
Click here for solution
Click here for solution
Click here for solution

Realtek Consulting said...


Thanks for sharing the valuable information here. So i think i got some useful information with this content. Thank you and please keep update like this informative details.


erp software development company in us
erp software company in us
list of erp software companies in us
erp in chennai
list of erp software companies in chennai
Latest CRM Software

All Customer Service Number said...

AOL Customer Service Support 24*7 for email issues is available for all your technical and connection support needs. Just Dial +1-800-382-3046 and get the assistance from our experts.

All Customer Service Number said...

The specialists at Brother Printer are here to address any inquiries you have about Brother items, frill, OS similarity, wellbeing information, reusing programs, a great deal more. Call to Brother Printer Support Number +1-855-499-1999 and they can give you the best answer for your concern happened in your brother printer.

All Customer Service Number said...

Welcome to Norton. Get FREE support for all your norton products. Norton protect your PC

against Viruses, Threats, Malware, Spyware, Ransom Ware and other Online Threats. For

immediate help you can contact to us and our support team is always available to give you

the best solution. You can easily update/download your norton antivirus from the links given

below.

Norton.com/setup.
www.norton.com/setup.
Norton com setup.

Here, you can also get the MS Office instance Support from the experts.

Office.com/setup.
www.office.com/setup.
office com setup

Merry said...

Click for more
Click for more
Click for more
Click for more
Click for more
Click for more

Merry said...

Click for more
Click for more
Click for more
Click for more
Click for more
Click for more
Click for more

Athulya Cute said...

Its really an Excellent post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog. Thanks for sharing....

software Providers
erp software
crm software
best software company in chennai
software company in india
Top software company in chennai