Tuesday, January 15, 2013

Code Today's Requirements Today

In Part 1 of this series, Do You Know What Day It Is? (written a mere 6 months ago, I really ought to update this blog more often), we looked at Ken's First Law of Architecture:

Today's Constant is Tomorrow's Variable


If you do not know this, there are two mistakes you can make.

Mistake 1: You Ain't Gonna Need It


Mistake 1 is creating a variable, option, switch, parameter, or other control for something which as far as we know for today is a constant.  You can avoid this principle if you remember that You Ain't Gonna Need It.

It is this simple: you can invent an infinite number of variables that the user may wish to control in the future, but the chance of guessing which ones they will actually want to control is near zero.  It is a total complete waste of time.

Let's take an example.  Imagine you are asked to do a task.  Any task.  It does not even have to be programming.  The task will be loaded with points where programmers invent decisions that nobody asked them to make.  For example, consider this blog post.

1) Should I have used a different background color up there in that green box?
2) Should I have used a sub-section heading by this point, maybe I should go back and do that?
3) Should this list be numbered or maybe just bullets instead?

Notice that this list is kind of arbitrary.  I did not think of it very hard, I just made up those questions.  Another person might have made up different questions.  The problem is that the list never ends.

This can never be eradicated, it is fundamental to the human condition.  Well meaning individuals will raise irrelevancies in an effort to be helpful and the rules of polite society work against weeding these out.  Committees will put two heads on a horse and you will end up with a bunch of YAGNI options.  But we can still fight against them.

Mistake 2: Constants in Code - Nobody Does That!


It is possible to go the other way, which is to embed constants into your code so that when you need to change them you find it is expensive, difficult and error prone.  Most of us learn not to do this so early that it seems unthinkable to us.  Why even write a blog post about it in 2013?

Well the very good reason to write about it is that we all still embed "constants in code" in ways that we never think about.

For example, if you are using a relational database, then the structure of your table is a "constant in code", it is something that is woven through every line.  Your code "knows" which tables are in there and what columns they have.  When you change the structure you are changing something very much "constant" in your system.   This is why it is so important to use a lot of library code that itself reads out of data dictionaries, so that you have removed this particular "constant in code."

The great problem here is that we cannot see the future, and you never think that a basic feature of your system is an embedded constant in code.  In a simpler period in my life a system lived on a server.  One server, that was it, who ever heard of a server farm?  That was a constant: number of servers=1, and all of my code assumed it would always be true.  I had to weed out that constant from my code.

Those who understand this basic inability to see the future are most at risk of slipping into over-generalization and generating YAGNI features.  It is an attempt to fight the very universe itself, and you cannot win.

Keep it Simple, Keep it Clean


In the end you can only write clean code, architect clean systems, follow the old knowledge and be the wise one who learns to expect the unexpected.

54 comments:

Danilo Piazzalunga said...

Very insightful, as always.

Geoff said...

Both lines of reasoning make sense, but don't they directly conflict with each other? Wouldn't YAGNI argue that if you don't need multiple servers today, you shouldn't code as if you do?

How do you decide when to apply one principle or the other?

Charlene said...

Great!

Joshua Thai said...

Fact!!! Thanks for sharing complete point…one more company has articles about Webdesign Agenter website pixo web design.

Finn said...

Your argument is excellent!! Unique points in the same, here one more website I like joomla development company.

all white said...

I really appreciated with your content and completely agree with you, here also I was visit a company website Digital zona.

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.

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

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.

Joel McKey said...

Thanks for share such a master tips about android app development,android ide,mobile app.your blog is very very useful for us .thank you

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

Anonymous said...

Very informative Post. Thanks you :)
Database if a present and a future. So, Improved Tomorrow With Remote
DBA Metrix Solutions.

Tom Dcruze said...

Hi,
Good 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

Thamizharasi J said...

Hi to every one, the contents present at this site are
actually remarkable for people experience, well, keep up the good work fellows.
Best CAT Coaching in Chennai

dhivya priya said...

Thank you for sharing such a nice and interesting blog with us. I have seen that all will say the same thing repeatedly. But in your blog, I had a chance to get some useful and unique information. I would like to suggest your blog in my dude circle.
Isoft Innovations Company Address
Isoft Innovations Adyar
Isoft Innovations Reviews
Isoft Innovation Chennai
Isoft Innovation

Anil Gupta said...

I am very happy when read this blog post because blog post written in good manner and write on good topic. Thanks for sharing valuable information.
Bangalore Web Designing Company, Web Development Company Bangalore

Prasanth said...

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

Webrifer Technologies said...

It’s a great spot to find new information. Your post is very knowledgeable and it is useful to everyone. Thanks for sharing. - cctv camera installation in chennai, cctv repair and services in chennai

http://www.webrifer.net/cctv-camera-dealers-in-chennai.html

hong hunrak said...

Hello everyone
Welcome To Glub Casino online
Wish Good luck For you
Pleae Click Here Now
gclub

Unknown said...

thank for good post is great...
gclub online
gclub
goldenslot

mada Alarqam said...

Madaalarqam we provide best electronic trade platforms for consumer and reseller. We also develop all types of Programming applications

Dexus Media said...

If you Are looking Best Digital Marketing Company in Jaipur,
SEO Company in Jaipur,
SEO services in Jaipur,
website development in Jaipur

whsss said...

Silahkan di kunjungi ya kawan-kawan 100% Memuaskan
> Hoki anda ada di sini <
1 USER ID UNTUK SEMUA GAME
Kami memberi bukti bukan Janji
Daftar sekarang juga dan dapatkan bonus menarik dari kami :
- BONUS DEPOSIT NEW MEMBER 100%
- BONUS DEPOSIT HARIAN 5.000 - 20.000
- BONUS REFFERAL 2%
MIN DEPO & WD HANYA Rp.50.000,-
BCA - MANDIRI - BRI - BNI - DANAMON
UNTUK INFORMASI SELANJUTNYA BISA HUB KAMI DI :
LIVECHAT TOGEL118.COM 24 JAM ONLINE
Pin BBM : D8AF7278
LINE : togel118
WHATSAPP : +855 92985834
Prediksi">http://prediksibwin.com/">Prediksi Bola
Cerita">http://ceritasemi.com/">Cerita Dewasa
Cerita">http://ceritasemi.com/">Cerita Semi
Cerita">http://ayocoli.com/">Cerita Sex
Prediksi">http://newsprediksi.com/">Prediksi Togel
Judi Online
Agen Bola

Goodman said...

Thank you for sharing valuable information.

SCR888

ACE333

กมลวัน อ่ํางาม said...


Nice article thank you for sharing valuable information.
สมัคร Sbobet

Lsm99

Cynti Zhang said...


Agen Domino
Agen QQ
Bandar Domino
Agen Poker

Unknown said...

วิธีการออนไลน์สำหรับผู้เริ่มต้น

การออนไลน์มีขั้นตอนที่ไม่ยากนักในการเล่นสำหรับมือใหม่ เช่น มีฟุตบอลให้ลง 5 คู่ สามารถเลือกได้ว่าทีมเจ้าบ้านทั้ง 5 ทีมจะเป็นฝ่ายชนะ หรือว่าทีมเยือนจะชนะทั้งหมด ถ้าทีมใดทีมหนึ่งแพ้นับว่าเสีย หรือเลือกว่าทีมต่อทั้งหมดที่เลือกจะชนะหรือทีมรองจะชนะ ถ้าทีมหนึ่งแพ้ก็เสียหมดเช่นกัน นับว่าเสี่ยงกับการเสียเงินมากกว่าว่าคู่เดียวแล้วระบุว่าทีมเหย้าหรือทีมเยือนเป็นฝ่ายชนะไป และอัตราการได้เสียก็คละกันตามแต่เจ้ามือแต่ละโต๊ะจะระบุ ถ้าเราชนะมีสิทธิ์โดนโต๊ะซิงหนีก็มี เราก็อดได้เงินไปเลย และถ้าเป็นหนีมาก ๆ ก็มีสิทธิ์โดนตามล่าเหมือนละครหลังข่าวอีก ลำบากลำบนชะมัด

แทงบอลออนไลน์

doll said...

I know this if off topic but I'm looking into starting my own blog and was wondering what all is needed to get set up? I'm assuming having a blog like yours would cost a pretty penny? I'm not very internet smart so I'm not 100% positive. Any recommendations or advice would be greatly appreciated. Cheersmanaged support services

KingSports said...

Nice article thank you for sharing valuable information.

Lsm99
Gclub
ทางเข้า Gclub
ทางเข้า Lsm99

คนสวย2019 said...

ปรับรูปหน้าเรียว
ฉีดหน้าเรียว ลดริ้วรอย เป็น



ต้องการ



หน้าเรียวทำเป็น



ยังไง



ผู้คนจำนวนไม่ใช้น้อย













คงจะ







กำเนิด



ปัญหา





นี้
และก็







การฉีดลดหน้าเรียวด้วยโบท็อกก็เป็นขั้นตอนการ











รักษาที่ทำเป็น



ง่าย โดยไม่ต้องผ่าตัด
สารารถยนต์



ช่วยลดลางเลือน



ริ้วรอยแล้วก็







ร่องลึกได้ภายในเวลา







เร็วทันใจ







ได้ผล



การดูแลรักษา





ที่น่าพอใจ



ละสร้างความเชื่อมั่นและมั่นใจ










ให้กับผู้มีปัญหาได้อย่างดีเยี่ยม


โบท็อก กังนัม
โบท็อค pantip
โบท็อค ลดกราม

Krystal said...

Nice post. It is really interesting. Thanks for sharing the post!
Domain Registration Company in Singapore
Website design Singapore
Buy SSL certificate Singapore
Business email hosting service Singapore

S Happy said...

Nice post. It is really interesting. Thanks for sharing.
Hotels in Tuticorin, Hotels in Thoothukudi, Best Hotel in Tuticorin

raghav sharma said...

Thanks for your great article friend, i get new information, new ideas to do somethings, i hope you will share again, i keep waiting for next post, thanks. Sales leads

Shanthi Cabs said...

Nice post. It is really interesting. Thanks for sharing the post!
Cabs in Madurai
Madurai Travels
Best Travels in Madurai
Travels in Madurai
Tours and Travels in Madurai
Madurai Cabs

Kurniati Barca said...

Sambung Ayam Bangkok

service care said...

Excellent blog I visit this blog it's really awesome. Blog content written clearly and understandable. The content of information is very informative.
moto service center in chennai
motorola service center in chennai
moto service centre chennai
moto service center
motorola service center
motorola service center near me
motorola mobile service centre in chennai
moto g service center in chennai
motorola service center in velachery
motorola service center in t nagar
motorola service center in vadapalani

Krystal said...

Nice post. It is really interesting. Thanks for sharing the post!
SATHYA Technosoft Pte Ltd
Domain Registration Company in Singapore
Website Design Singapore
Web Development Singapore
Web Design Singapore
Domain Email Hosting Singapore
Professional Email address for Business
SSL Certificate Singapore

shivani said...

A befuddling web diary I visit this blog, it's incredibly grand. Strangely, in this present blog's substance made motivation behind fact and sensible. The substance of information is instructive Oracle Fusion Financials Online Training
Oracle Fusion HCM Online Training
Oracle Fusion SCM Online Training

Unknown said...

Pola 1 dan pola ke 2 ini memang tidak bisa di terapkan kalau anda tetap bertahan di 1 meja yang sama, anda harus berpindah-pindah meja dalam menerapkan pola di atas supaya menang banyak.
asikqq
pionpoker
dewaqq
bandar ceme
sumoqq
hobiqq
paito warna
interqq
forum prediksi

ข่าวกีฬา said...

สล็อต JOKER
HolidayPalace
Gclub

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

thank u for sharing this post
custom software design, custom software development

custom software systems

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

Angkasa Bola said...

Artikel Ini Sangat Bermanfaat sekali ... Jangan Lupa Dibaca Juga Artikel berikut ini :D


Ini dia tempat Terbaik dan Terjitu VipBola88

Pastikan Agen Bola terbaik anda dari Taruhan Bola

Ini bukan Agen Kaleng-kaleng tapi Agen Bola

1 Akun Untuk Semua Permainan
Bonus Deposit 10% Setiap Hari
Cashback Hingga 15%
Referral 2.5%
Casino 0.8%

WA : +855 96 826 9586
LINE : angkasabolacs

super hero said...

We at Strive 2 drive,driving school In Melbourne. Driving School in Melbourne!
Driving School in Melbourne!
is one of the best & safe driving school where you have an ease of access
to a wide array of special driving features. We are focused at your
comfort and so we have put together facilities within the site to ensure
that you get the very best. Driving School in Melbourne!

Kizuna Klye said...

PERMAINAN ONLINE TERBESAR DI INDONESIA

Website paling ternama dan paling terpercaya di Asia ^^
Sistem pelayanan 24 Jam Non-Stop bersama dengan CS Berpengalaman respon tercepat :)
Memiliki 8 Jenis game yang sangat digemari oleh seluruh peminat poker / domino

- Adu Q
- Bandar Q
- Bandar Sakong
- Bandar Poker
- Poker
- Domino 99
- Capsa Susun
- BANDAR66 / ADU BALAK ( GAME TERBARU )

Permainan Judi online yang menggunakan uang asli dan mendapatkan uang asli ^^
* Minimal Deposit : 20.000
* Minimal Withdraw : 20.000
* Deposit dan Withdraw 24 jam Non stop ( Kecuali Bank offline / gangguan )
* Bonus REFFERAL 15 % Seumur hidup tanpa syarat
* Bonus ROLLINGAN 0.3 % Dibagikan 5 hari 1 kali
* Proses Deposit & Withdraw PALING CEPAT
* Sistem keamanan Terbaru & Terjamin
* Poker Online Terpercaya
* Live chat yang Responsive
* Support lebih banyak bank LOKAL


Contact Us

Website SahabatQQ
WA 1 : +85515769793
WA 2 : +855972076840
LINE : SAHABATQQ
FACEBOOK : SahabatQQ Reborn
TWITTER : SahabatQQ
YM : cs2_sahabatqq@yahoo.com
Kami Siap Melayani anda 24 jam Nonstop

Daftar SahabatQQ