Which came First? 23
- CCCCDPIPE
- Coupling (low)
- Cohesion (high)
- Creator
- Controller
- Don’t talk to strangers (mentioned above and replaced with Protected Variation)
- Polymorphism
- Indirection
- Pure Fabrication
- Expert
- CCCC (4 c’s, foresees)
- D (the)
- PIPE (pipe)
So who foresees the pipe? The Psychic Plumber.
The Psychic Plumber??? I know, it’s awful. However, I heard it once in something like 1999 and I’ve never forgotten it.
That leads me to some other oldies but goodies: SOLID, INVEST, SMART and a relative new-comer: FIRST. While these are actually acronyms (not just abbreviations but real, dictionary-defined acronyms), they are also mnemonics.
You might be thinking otherwise. Typically what people call acronyms are actually just abbreviations. And in any case, they tend to obfuscate rather than elucidate. However, if you’ll lower your guard for just a few more pages, you might find some of these helpful.
Your software should be SOLID:- Single Responsibility
- Open/Closed Principle
- Liskov Substitution Principle
- Interface Segregation
- Dependency Inversion Principle (not to be confused with Dependency Inversion)
I think we should change the spelling: SOLIDD and tack on “Demeter – the Law Of. But that’s just me. Of course if we do this, then it is no longer technically an acronym. That’s OK, because my preference is for mnemonics, not acronyms.
When you’re working on your user stories, make sure to INVEST in them:- Independent
- Negotiable
- Valuable
- Estimable
- Small
- Testable
- Specific
- Measurable
- Achievable
- Relevant
- Time-boxed
- Fast – tests should run fast. We should be able to run all of the tests in seconds or minutes. Running the tests should never feel like a burden. If a developer ever hesitates to execute tests because of time, then the tests tests take too long.
- Isolated – A test is a sealed environment. Tests should not depend on the results of other tests, nor should they depend on external resources such as databases.
- Repeatable – when a test fails, it should fail because the production code is broken, not because some external dependency failed (e.g. database unavailable, network problems, etc.)
- Self-Validating – Manual interpretation of results does not scale. A test should * verify that it passed or failed. Going one step further, a test should report nothing but success or failure.
- Timely – tests should be written concurrently (and preferably before) with production code.
So where does this acronym come from? A while back, a colleague of mine, Tim Ottinger, and I were working on some course notes. I had a list of four out of five of these ideas. We were working on the characteristics of a good unit test. At one point, Tim said to me “Add a T.â€
I can be pretty dense fairly often. I didn’t even understand what he was telling me to do. He had to repeat himself a few times. I understood the words, but not the meaning (luckily that doesn’t happen to other people or we’d have problems writing software). Anyway, I finally typed a “Tâ€. And then I asked him “Why?†I didn’t see the word. Apparently you don’t want me on your unscramble team either.
Well eventually he led me to see the word FIRST and it just seemed to fit (not sure if that pun was intended).
Of course, you add all of these together and what do you get? The best I can come up with is: SFP-IS. I was hoping I could come up with a Roman numeral or something because then I could say developers should always wear SPF IS – which is true because we say out of the sun and burn easily. Unfortunately that did not work. If you look at your phone, you can convert this to the number: 73747
If there are any numerologists out there, maybe you can make some sense of it.
In any case, consider remembering some of these mnemonics. If you actually do more than remember them and start practicing them, I believe you’ll become a better developer.
Schuberry’s Greatest Hits indeed! For me personally only hearing you “ctrl-space” me to death is a founder memory than having you throw out Liskov or Law of Demeter.
Good stuff Brett. It seems a lot of developers are always looking for concise no fluff items they can print out and put in their cube wall to act as a reminder. It seems coming up with a big font version of these acronyms and mnemonics would work well.
T’s seem to give you trouble:) The “T” in “INVEST” is for Testable. (See http://xp123.com/xplor/xp0308/index.shtml)
Oh duh on my part. Thank you! ... I’ll fix it.
FIRST… I like it! And thanks for the summary of acronyms.
Regarding Law of Demeter: I think of it as a subset of SRP, as a means to achieve it. But then again, ISP and SRP are also very related, as well as OCP and DIP, so perhaps it’s not a bad idea to emphasize the importance of the Law of Demeter.
You know, I find violating it makes testing very hard (probably obvious). In reality, when I come across a large code base it probably is hard to test AND this is correlated with violation of both LOD and, typically, SRP. But something I only recently became aware of was the effect of TDD on the Law of Demeter.
In my practice, when I use TDD, which is most of the time, I find that the Law of Demeter does not really come into play. By using Test Doubles and mocking libraries, I write without long chains. Because I want to focus my test to a small unit, I plugh in other objects that offer a service rather than a chain of objects I can use. By avoiding the dependencies that make testing more difficult, I happen to not violate Demeter.
The law still has “come into effect” if it is violated by no one. Rather, I think, you mean it is not violated.
pedantically yours, tim
I’ve always known the rule to be that if you pronounce it as a word its an acronym, and if you pronounce each letter, then it is an initialism:
http://lyberty.com/encyc/articles/abbr.html
on’t belittle or humiliate people who didn’t have the chance to learn how to write good code.
News about Apple’s much-delayed white iPhone 4 continues to fly fast and furious, with a new claim from Boy Genius Report suggesting that the model has been canceled entirely instead of merely delayed until next spring as the company announced yesterday.
I was hoping I could come up with a Roman numeral or something because then I could say developers should always wear SPF IS – which is true because we say out of the sun and burn easily.
glad to see you!
glad
Keep your Contacts and SMS safe! Actually, the contacts and SMS have more values than a cell phone’s own value. You can pay money to buy a new iPhone, but cannot buy your lost contacts and SMS back. So it’s important for you to backup your contacts and SMS in iPhone. And we recommend you backup contacts and SMS regularly. Our backup software can help you take a snapshot for your contacts and SMS. Your important personal information will be never lost.
Would you like to banckup iphone SMS to mac, macBook, macbookPro as .txt files? Now a software iphone SMS to Mac Backup can help you to realize it.
good article
internette görüntülü olarak okey oyunu oyna, gerçek kisilerle tanis, turnuva heyecanini yasa.
I am in support of wonderland, this project is seeing very good fame and should be continued.
Wellensteyn-Jacken Wellensteyn werden getragen von qualitätsbewussten Menschen,Wellensteyn Jacken für die Stil und Outdoor-Bekleidung keinen Gegensatz darstellt. So sind die funktionalen Jacken mittlerweile Alltag auf den Straßen Jacken Von Wellensteyn deutscher und internationaler Großstädte.
Swarovski crystal jewelry, on top of that also known as these Austrian Swarovski Crystals, is definitely the most beneficial many costly type of Crystals Swarovski uk . As a result, a majority of these Swarovski Uk items need be adopted special care involving to allow them to last perpetually.
I am carrying this bag myself,Herren Winterjacken when I wear very girly stuff, mine is smaller than large,herren winter still can fit lap top and all I need…I had been looking for it for several years until I found it 3 years ago in UK.Belstaff Jacken I saw it for the first time in the movie “Interpreter”, carried by Nicole Kidmann, and then in “I, Legend” carried by Will Smith.http://www.herrenwinterjacken.com/
Family Family Jordan Retros Family and Friends of Lesbians and Gays (PFLAG).Just last month, New York City Jane Isay wrote an essay, Keeping Marital Secrets Closeted about learning her psychoanalyst psychoanalyst air Jordan 7 psychoanalyst husband was gay 15 years into their marriage in 1965. The couple to keep his coming out from their two sons - aged 10 and and Kid Jordan Shoes and 14 - and stayed in the marriage for the sake of the 72, Isay looks back on that decision with mixed feelings. When they finally
Get to know about C# and C++. In fact, I find there is no much difference between the two. However, If we want to do much better. I need work hard.
Which came First? 21 hoo,good article!!I like the post!36
Which came First? 22 good post151