SOLID object-oriented design

Five basic principles of object-oriented design. Not the only five, but five which are, well, SOLID.

Single responsibility – A class should have only a single responsibility.

Open/closed – Open for extension; Closed to modification.

Liskov substitution – Objects can be replaced by instances of their sub-types without breakage or surprise.

Interface segregation – Many, specific interfaces – that is, APIs – are better than fewer, more general-purpose interfaces. (…or “interface” in the worst case.)

Dependency inversion – Depend upon the abstraction. (Not upon the specific concretion.)

 

ɕ

Star Wars machete order

Should you watch the Star Wars movies in numerical order, or released order? Neither – Use machete order: IV, V, II, III, VI

The Star Wars Saga: Introducing Machete Order » Rod Hilton

There are two obvious options for watching the Star Wars saga.

  • Release Order – Watch the films in the order they came out, recreating your experience with the films for someone new to them.
  • Episode Order – Watch the films in the order George Lucas intends, starting with Episode I and going straight through to Episode VI

There are two critical flaws with both of these orders, unfortunately, that prevent either from being appropriate.

~ Rod Hilton from, The Star Wars Saga: Introducing Machete Order

slip:4unote1.

Turns out both of those options suck.

Numerical order, (as Lucas’ suggests,) wrecks the greatest movie reveal in history by spending 3 movies explaining it. And release order is also no good because… well… go. read. machete. order.

Seriously. I can’t do Rod’s article justice without quoting the whole thing.

ɕ

It is done fast enough when it is done well.

This entry is part 3 of 72 in the series My Journey

Getting done right does not mean getting done slow. Getting done right means getting done fast. You will go faster if you do things right. You will go faster if you come down off the “high” generated by the illusion that effort is speed. You will go faster if you calm down, follow your disciplines, and refuse to rush.

~ Bob Martin from, «http://blog.8thlight.com/uncle-bob/2013/03/11/TheFrenziedPanicOfRushing.html»

While he’s talking about software development in general, and test-driven development specifically, this is true for – I think – everything. My experience is that this is true for software development, and other technical work. But it is also true of martial arts practice, parkour, games, building model airplanes… you name it.

The pervasive admonishment should be “do it well,” rather than, “slow down.” Do it well and you’ve – by definition – done it as fast as possible. What’s the point of doing it poorly? What’s the point of rushing to completion; If you didn’t do it well, then it’s not done.

ɕ

Flag Day 2013

Today is Flag Day in the United States.

National Flag Day commemorates Congress’s adoption on June 14, 1777 of the Stars and Stripes as the flag of the United States. Although not officially a federal holiday, Pennsylvania has declared it an official state holiday. (Huzzah Pennsylvania!)

HISTORY

US_Flag_Day_poster_1917

June 14th, 1885 – Bernard J. Cigrand, a then 19 year old grade school teacher at Stony Hill School, placed a 10 inch, 38 star flag in a bottle on his desk and assigned essays on the flag and its significance. He went on to work for decades spreading recognition of June 14th as a nation day of remembrance and observation of the Stars and Stripes. (See also, House Resolution 622.)

May 30, 1916 – President Wilson issued Presidential proclamation 1335, calling for a nation wide observance of Flag Day on June 14th:


Proclamation 1335 – Flag Day
May 30, 1916

By the President of the United States of America
A Proclamation

My Fellow Countrymen:

Many circumstances have recently conspired to turn our thoughts to a critical examination of the conditions of our national life, of the influences which have seemed to threaten to divide us in interest and sympathy, of forces within and forces without that seemed likely to draw us away from the happy traditions of united purpose and action of which we have been so proud, It has therefore seemed to me fitting that I should call your attention to the approach of the anniversary of the day upon which the flag of the United States was adopted by the Congress as the emblem of the Union, and to suggest to you that it should this year and in the years to come be given special significance as a day of renewal and reminder, a day upon which we should direct our minds with a special desire of renewal to thoughts of the ideals and principles of which we have sought to make our great Government the embodiment.

I therefore suggest and request that throughout the nation and if possible in every community the fourteenth day of June be observed as FLAG DAY with special patriotic exercises, at which means shall be taken to give significant expression to our thoughtful love of America, our comprehension of the great mission of liberty and justice to which we have devoted ourselves as a people, our pride in the history and our enthusiasm for the political programme of the nation, our determination to make it greater and purer with each generation, and our resolution to demonstrate to all the world its, vital union in sentiment and purpose, accepting only those as true compatriots who feel as we do the compulsion of this supreme allegiance. Let us on that day rededicate ourselves to the nation, “one and inseparable” from which every thought that is not worthy of our fathers’ first vows in independence, liberty, and right shall be excluded and in which we shall stand with united hearts, for an America which no man can corrupt, no influence draw away from its ideals, no force divide against itself,-a nation signally distinguished among all the nations of mankind for its clear, individual conception alike of its duties and its privileges, its obligations and its rights.

In Witness Whereof, I have hereunto set my hand and caused the seal of the United States to be affixed.

Done at the City of Washington this thirtieth day of May, in the year of our Lord one thousand nine hundred and sixteen, and of the independence of the United States of America the one hundred and fortieth.

1949 – In the summer session of the 1949 Congress, the House and the Senate agreed to H.J. Res. 170, a joint resolution officially recognizing June 14 of each year as Flag Day, and authorizing and requesting the president to issue an annual proclamation informing the American people of the occasion.

ɕ

Eric Idle’s Rules for Reading

Rule 1: Never be without a book.

Rule 2: Skip all Prefaces, Forewords and Introductions.

Rule 3: If you’re bored with a book, chuck it. There are millions of books you will never get to read, so if one doesn’t grab you, put it down.

Rule 4: You don’t have to finish a book. You can always come back to it.

Rule 6: You may read several books at once.

Rule 7: You may skip and skim. This is not a class, this is life.

Rule 8: Try and buy from your local bookshop while you still have one.

Rule 9: There is no rule 9.

Rule 10: Enjoy!

~ Eric Idle from, Eric Idle Blog » Editorial

slip:4ueibo1.

Eric Idle’s – yes, that Eric Idle – ten rules for reading, from Editorial.

ɕ

Onward!

We are at the very beginning of time for the human race. It is not unreasonable that we grapple with problems. There are tens of thousands of years in the future. Our responsibility is to do what we can, learn what we can, improve the solutions and pass them on. It is our responsibility to leave the men of the future a free hand. In the impetuous youth of humanity, we can make grave errors that can stunt our growth for a long time. This we will do if we say we have the answers now, so young and ignorant; if we suppress all discussion, all criticism, saying, ‘This is it, boys, man is saved!’ and thus doom man for a long time to the chains of authority, confined to the limits of our present imagination. It has been done so many times before.

~ Richard Feynman from, Richard Feynman on the Universal Responsibility of Scientists

slip:4ubaie1.

Feynman wrote several great, short books that are not hard science. This, and “Surely You’re Joking, Mr. Feynman!”, are great places to start.

ɕ

Hero training

If you are in a crappy situation, struggling with weight loss, or struggling to change your diet, believe that the Hero version of you is waiting to develop. You’re in the ‘challenge’ part of the story right now. Without that, the Hero part will have no meaning.

Who wants to read the story about the awesome guy that got more awesome? Nobody!

~ Steve Kamb from, Hero Training 101: 4 Steps To Save The Galaxy

slip:4unebo7.

ɕ

High-fructos corn syrup is bad for bees?

Specifically, they found that when bees are exposed to the enzyme p-coumaric, their immune system appears stronger—it turns on detoxification genes. P-coumaric is found in pollen walls, not nectar, and makes its way into honey inadvertently via sticking to the legs of bees as they visit flowers. Similarly, the team discovered other compounds found in poplar sap that appear to do much the same thing. It all together adds up to a diet that helps bees fight off toxins, the researchers report. Taking away the honey to sell it, and feeding the bees high-fructose corn syrup instead, they claim, compromises their immune systems, making them more vulnerable to the toxins that are meant to kill other bugs.

~ Bob Yirka from, Researchers find high-fructose corn syrup may be tied to worldwide collapse of bee colonies

ɕ

Timeless message for teens

The New Zealand Herald reports, Kiwi principal sends teen message viral… 53 years on

According to a 2010 post on the Pierce County Tribune website, the words come from a letter by Judge Phillip B. Gilliam of Denver, Colorado, published on December 17, 1959, which explains why the advice sounds somewhat dated.

Almost 15,000 people shared the link on their own Facebook profiles, attracting the attention of American news website the Huffington Post and fuelling the internet sensation.

Words for teenagers everyone…

Always we hear the cry from teenagers, ‘What can we do, where can we go?’

My answer is this: Go home, mow the lawn, wash the windows, learn to cook, build a raft, get a job, visit the sick, study your lessons, and after you’ve finished, read a book.

Your town does not owe you recreational facilities and your parents do not owe you fun.

The world does not owe you a living, you owe the world something.

You owe it your time, energy and talent so that no one will be at war, in poverty or sick and lonely again.

In other words, grow up, stop being a cry baby, get out of your dream world and develop a backbone, not a wishbone.

Start behaving like a responsible person.

You are important and you are needed.

It’s too late to sit around and wait for somebody to do something someday.

Someday is now and that somebody is you.

~ Judge Phillip B. Gilliam of Denver, Colorado, published on December 17, 1959

ɕ

Europa Report

The brilliance behind this no-nonsense approach is seen the second real problems occur. The first time you witness a member of Europa Ventures (this trip is privately funded) breakdown or let out a tiny yelp, it hits you. Hard. This is coupled by the fact that (almost) the whole movie is filmed from stationary cameras located inside the vessel.

~ IO9 from, Europa Report: At Last, a Space Thriller Worth Taking Seriously

I’m not a big fan of scary movies per se; Scary for scary’s sake? meh. But I do love me a suspenseful, scary space movie. Europa Report reminds me of Alien . . . <shudder>

ɕ

When Should I Admit That I Don’t Understand

Too often we are embarrassed to admit that we don’t understand what we are told. We don’t want to appear stupid to the speaker or others in the audience. But more people should ask questions, because others may be just as confused but not want to speak up. There is no shame in not understanding something, and it’s a good lesson to remember that. Asking for clarification not only helps both the speaker and listener communicate more effectively, it is also a powerful tool in revealing bullshit.

~ Ben Bradford from, The Wisdom of Not Understanding

slip:4uciso1.

Bradford starts off talking about a terrible, new-agey, pseudo-science film which a friend was discussing with him. I’ve had that same conversation, about the same film. So I understand what he’s saying, and I understand the point he’s making. My issue with his assertion is that he doesn’t seem to make the distinction between when one doesn’t understand something versus when one doesn’t understand someone.

Something

This is an important distinction. When one encounters something dubious, confusing, or questionable, (such as the movie What the Bleep Do We Know,) admitting lack of understanding can lead to self-improvement. (yeah!)

[ walking out of a theatre ]
“Craig, what did you think of the movie?”
“Dude, I’m totally confused. How could Rosebud have been [redacted]? How did I miss that?!”
[ …conversation goes on. Happy friend. yeah! ]

Someone

On the other hand, when one encounters someone espousing dubious, confusing, or questionable ideas, one must tread carefully. Unilaterally saying, “I don’t understand,” to friends and family will come across as a back-handed insult. They will interpret, “I don’t understand,” to imply, “you are not making sense,” or worse, “you are stupid.” Bye-bye friends and family. (boo!)

[ entering the coffee shop ]
“Hey Craig, I saw this great movie! It was about a [redacted] named George Orwell and it was looking for some a citizen named Rosebud.”
“Dude, I’m totally confused. How can [redacted] be named George Orwell… I thought he wrote the movie script?”
[ …reflects negatively on friend. Friend is unhappy. boo! ]

Suddenly, (awesome film by the way,) I have to either smile and bear the nonsense, or start picking the nonsense apart bit by bit until my friend realizes they are confused and don’t understand.

I’ve sometimes, (often?,) been accused of lacking social skills. Nay, I suggest that some people’s signal-to-noise ratio is low, and I am simply not interested in fixing everyone I encounter.

(See also Megalomania. But, then, also Imposter Syndrome.)

ɕ

First, be okay with yourself

All of humanity’s problems stem from man’s inability to sit quietly in a room alone.

Blaise Pascal from, Pensées

There are many advantages to having some time alone, (while doing nothing,) each day. Not least of which is some inoculation against the disease of needing to be constantly distracted and entertained.

If you immediately fall asleep when sitting alone, excellent! Your body was trying to tell you it needed sleep, and you weren’t listening. Come back when you’ve finished your cat-nap.

…back? Refreshed?

If meditation seems inconceivable… If the idea of being alone, doing nothing, makes your skin crawl… then start with doing things alone, and work up from there.

You, like many people, might get stuck on the idea that being alone is like having some sort of disease—even if you’re the kind of person that prefers being alone. You might skip movies in the theater if you have to attend in solitude. Or maybe you criticize yourself for eating lunch at your desks instead of with coworkers or friends. Perhaps you spend too much of our time out with others because you just don’t know what to do when you’re by yourself. With a little work, however, you can make your alone time much more productive.

~ Adam Dachis from, How to Use Your Alone Time More Productively (and Actually Enjoy It)

slip:4uliho1.

ɕ

Just act like one

Want to be a man? By which I mean; honesty, integrity, reliability, rectitude, morality, moral fortitude, wisdom, knowledge, circumspection . . .

…uh, yeah, I wish I was more of those things.

Then just act like one. You don’t get to put this off until you feel like getting around to it.

I beat the drum about The Art of Manliness pretty regularly, and here are two more percussive suggestions:

Manliness Doesn’t Just Happen

Want to Feel Like a Man? Then Act Like One

ɕ

Law of sacrifice

Society today tries to deny the law of sacrifice at every turn, promising people that they can fulfill their desires without having to forsake anything at all. “Lose weight without giving up your favorite foods!” “Get ripped without long workouts!” “Get rich without having to work hard!” The denial of the law of sacrifice is at the heart of things like our soaring credit card debt (US citizens currently hold $886 billion of it), not to mention our national debt. The fantasy that you can have whatever you’d like without ever paying for it is an incredibly seductive fantasy.

But it is only a fantasy. There is always a price to pay.

~ Brett McKay from, The Law of Sacrifice

slip:4uaote3.

“What does it cost?”

Over the years, I have talked to hundreds of prospective students who have walked into the dojo and asked about Aikido. One quickly learns that anyone who walks in, has some level of interest. So these are not cold sales calls where you need fast paced, hard hitting, sales tactics. People simply have some specific questions that need answering before the conversation continues to more general topics.

Some people are concerned about the monetary cost. That is important, and money should be discussed. But they should be much more concerned about the time cost of the commitment.

My explanation usually goes like this…

The cost of committing

One class per week is not often enough, and few people can withstand training more than three. So let’s say you’d like to come to class twice per week.

How much time is that? For each class you need at least one hour of padding — pack your bag, drive to the dojo, change before/after class, drive home, unpack, etc. Then the actual class time is about 2 hours per class. So three hours per class, twice per week: We’re talking about, six hours every week.

Now think about your life, and tell me about the six hours every week when you are alone, doing absolutely nothing.

So the real question is: What are you willing to give up from your current life to create those six free hours?

There’s no going back

Once you realize that your time is the limiting resource in your life, you’ll look at everything differently.

How much time do you spend watching TV? Is that time entertainment, family bonding, or what? Do you value anything more than entertainment?

How much time do you spend commuting to work? You clearly value something more than your time. (2 hours a day? 14 hours a week? . . .) What is it that you value so highly you’re willing to commute? …is it your children’s school district? …the size of your paycheck? …your career path?

Do you mow your own lawn? Do you pay someone to mow your lawn? Might you spend time mowing your lawn if it was mentally relaxing? …or if you push-mowed (sans motor) your lawn, and it was a means of exercise?

Do you get enough sleep at night? If not, why not? …are you spending time in the evening/night doing — what? Why do you value that activity more than sleep?

ɕ