101 words every grown-up should know

I'm starting another project! (I think I have five or six now.) This project will be part of my efforts to become a better reader and writer.

Last year my wife purchased this book, 101 Words Every Grown-Up Should Know.  (I'd link to it on Amazon, but it appears to have fallen out of print.)  Ever since she purchased it, it's sharp blue cover has been luring me to delve into the topic: imagine, a standard for "every educated vocabulary."

So, for the next 101 days, every morning I'll use one of the 101 words in a sentence.  You can follow my efforts on Twitter with the #101words hash tag.

July 9, 2009: "Andrew has always been aberrant: until we started giving him Ritalin, he was never able to sit still in class."

Bookmark and Share

Several words of thanks

This morning I was awakened by the sun shining through the windows of my new home: a quaint rambler on the East side of town.

Crowded in by piles of our possessions though we may be, Wifey and I are now settled comfortably into our new digs.

The move, completed over the course of three weeks, is thanks to the gracious help of my friends.

Thanks to Dave and Greg for helping me solve my drainage woes; thanks to Joey for assembling some of the IKEA furniture and helping me to move that stupid piano; thanks to Peter for painting the baby's room; thanks to Danielle for cleaning up Peter's little messes and painting the guest room; and thanks to Scott for helping me move all the stuff that hadn't made it into boxes, and for helping me to keep my sanity throughout the last day.

And a special thanks to my realtor and friend Ron Nallon, who talked us out of several "fix'r uppers" before we found a home we really wanted.

Bookmark and Share

Critical thinking

I grew up in Virginia during the eighties and nineties.  My childhood occurred in the Reagan years - a period during which many conservatives grew to consider the United States a nation of conservative people.  Much to my surprise, Virginia hasn't always been so conservative.  But I'm getting a little ahead of myself.

Growing up, the handful of people who did talk to me about politics were conservative.  So without really earning it, I adopted what I will call a "series of conservative opinions."  In my twenties, I grew to recognize these opinions as being rather more like libertarian ideas than conservative ones, and far right of neoconservative ideals.

As I approach thirty and fatherhood, it is becoming more important that I understand these philosophies and their politics to a much greater depth.  Unfortunately, independent critical analysis doesn't exist - everyone's opinion is biased by nature, from some much more than others'.  So I have decided to make a different approach.

I intend to read two books

  • The Conscience of a Conservative by Barry Goldwater
  • The Conscience of a Liberal by Paul Krugman

For those of you who know neither the books nor the authors, I suggest you head to Wikipedia and play catch-up.  Suffice it to say, these men represent the faithful few: men truly dedicated to the ideals of their political camps.  So I will read them both, and throughout the experience I will measure my reaction as a means of deciding (for now) where my own politics lie.

In short, I will develop my own opinion.

Bookmark and Share

You want to do what with my tax dollars?

In 1961, the world was at war.  The United States and then U.S.S.R. were locked in the dead heat of Mutual Assured Destruction.  In the midst of this silent conflict, great strides were being made in science and technology.  The Russians had beaten us into space; but our nation, captained by JFK, focused and set its sights on a much loftier goal: to put a man on the moon.

On May 25, 1961, as part of a special address to Congress, Kennedy called upon the American people to commit their nation's wealth to the exploration of space.

First, I believe that this nation should commit itself to achieving the goal, before this decade is out, of landing a man on the moon and returning him safely to the earth. No single space project in this period will be more impressive to mankind, or more important for the long-range exploration of space; and none will be so difficult or expensive to accomplish.

To this end, Kennedy proposed that the Senate commit a staggering volume of tax-payer dollars: $531 million in fiscal year 1962, and an additional $7 to 9 billion over the course of the following five years.

That figure, my friends, was in 1962 dollars. Adjusted for inflation in 2008, that sum would have been equivalent to nearly $67 billion dollars.

In times like our own, figures like these are important, because the goals being set by the Obama administration are long-term and expensive:

  • provide an entire nation of people with access to health care, and boost preventive medicine
  • force the domestic automobile industry to stop producing products that exert a dramatic downward pull upon our economic stability and energy independence
  • pump liquidity and cash into domestic and international economies

That's a lot of dough to be spent. In fact, one reasonable estimate places the total amount of money "spent, lent, or committed" at about $13 trillion dollars: about 200 times what Kennedy pledged only five decades ago, and roughly equivalent to our GDP.  All told, we've actually spent about $2 trillion, which is still roughly 30 times the price tag placed on exploring local space.

Thirteen trillion dollars is such a large amount of money, that it exists somewhere beyond our capacity to relate it to anything and reveal its true magnitude.  So instead of focusing on the actual dollar amount, what we could do is focus on results.

If I lend you a dollar and all you do is buy a candy bar, then I've wasted my dollar.  But if with my dollar you buy a pack of seeds, plant a row of tomatoes, and sell the produce for a dollar a pound, I am certain to see a return on my investment.

The greater mission of NASA was to innovate - to use science to benefit mankind.  In it's 60 year history NASA has filed 6,300 patents, and the technologies it developed have been the basis for many every-day products: scratch-resistant lenses, memory foam, long-distance telecommunications, and one of my favorites - cordless power tools, just to name a few.

History has demonstrated that government spending in the interest of innovation - sometimes known as "meddling" or simply "waste" - doesn't always end in disaster. I'm not arguing that every dollar spent on my behalf since 2008 has been in my best interest - some of it has definitely been pork.

What I am saying is that sometimes change must be forced.  Unlike an individual's motivations, our nation is guided by a system.  It has rules and hosts a grand scheme of expectations, some of them more bloated than others. And sometimes the rules must be brought again into balance with the expectations.

Case in point: the domestic auto industry. To date, a combination of free market principals and labor laws have produced a domestic automobile industry that is in the business of producing cars many Americans don't want and none need.  To compound this problem, their system of production has grown prohibitively expensive and absolutely uncompetitive.

The current global recession, which we began to feel in 2008, was the last coffin nail for two of the Big 3 US automakers.  Although it is not the first time that the Federal Government has gone to the aid of the auto industry, the 2008 bailout and subsequent soft bankruptcy for Chrysler differs both in terms of scale and the accompaniment of public policy that will force the industry to retool.

That public policy to which I refer was announced today: that by 2016, the national standard for fuel economy will be 35.5 MPG.  The estimates as announced by the President himself are that the fuel savings accrued between 2012 and 2016 will be 1.8 billion barrels of crude.

Now, that's just a fraction of our total consumption (7.5 billion barrels in 2007), and those savings are spread out over four years.  But the policy is a monumentally important step for a couple of reasons.  First and foremost, it capitalizes on the current economic situation.  When times are "good," change is an irrelevant topic, as no one looks for stability much further beyond the end of the fiscal year.

Second, the new public policy (which will certainly become legislation, if the Democrat-controlled Senate has anything to say about it) is the first policy to set a national standard for fuel economy.  A national standard dramatically reduces the complexity for automakers in manufacturing a scalable product.

So the automakers get to go back to work, and will do so driven to produce the next generation of automobiles. The environmentalists get their reduction in emissions. The green energy proponents get a first step toward an energy-independent United States.  And the world bears witness to a democratic government not afraid to take charge of its economy and society and propel it in the direction it needs to travel.

And all this is possible only because of a willingness to spend when spending made sense.

I can only hope that in the end, I get a tomato, not a lemon.

Bookmark and Share

While everyone else is sleeping, I’m writing PHP code

This is a test of my brand new Twitter plugin for Wordpress.

Why would I want to write yet another Twitter plugin for Wordpress?

Simply put: I wanted it to be simple.  I wanted to be able to edit the Tweet from the Post Editing screen.  And I wanted the link back to be tr.im'd, not bit.ly'd, or tinyurl'd, or any other such nonsense.

Now it's done.  I'll post it up on projects just as soon as all the bugs are worked out. (And just as soon as I get around to creating that projects page.)

Bookmark and Share

Equally important are we all

I clipped this Opus comic from a newspaper back in 2007.  (Click for the larger version.)

opus-center-of-universe

We all feel this way from time to time: we get all self-absorbed, and wrapped up in our own personal "mission statements."  Nations do this, too.  It is a feature of our species: it is human to be so self-absorbed.

It's ironic then how the greatest good is done when we choose to step outside this framework.

Did you do anything today solely to the benefit of someone else?  If you had, you might have made a friend, or even a brother.

When in doubt, give unconditional positive regard a try.  It starts with a smile, and ends with a handshake.

Bookmark and Share

From the iPhone

I can imagine that being able to blog from my iPhone might be handy at some point in the future. But of all the ways to compose content, this is by far the least effective.

Bookmark and Share

Change date formats in Joomla content

This was making me insane, but I learned a couple of things about Joomla in the process.

So I'm using the Blog layout for a Category of Joomla content. (Yes, I realize Wordpress is a better tool for blogging.  Stay with me here.)

By default, the dates displayed with each article title look like this:

Sunday, 29 March, 2009 17:44

I mean, that's great: if you're British.

The first thing that baffled me was the composition of the templates in com_content.  Looks like this (in com_content/views/category/blog.php)

for ($z = 0; $z < $this->params->get('num_columns'); $z ++) :
	if ($z > 0) : $divider = " column_separator"; endif; ?>
 
	params->get('num_intro_articles') / $this->params->get('num_columns')); $y ++) :
	if ($i < $this->total && $i < ($numIntroArticles)) :
		$this->item =& $this->getItem($i, $this->params);
		echo $this->loadTemplate('item');
		$i ++;
	endif;
endfor;

For the life of me, I couldn't figure out what $this->loadTemplate('item') did (mostly because the patTemplate API is buried beneath the Joomla API, and because PHP toolsets just aren't sophisticated enough yet. But I digress).

Google revealed that when you call $this->loadTemplate(String) from within a Joomla template file, the presentation framework looks for a file named "<template>_<name>.php" where <template> is the name of the current template file (in this case, "blog") and <name> is the value passed to the loadTemplate method.

So then, in com_content/views/category/blog_item.php, I found this bit of obscurity

echo JHTML::_('date', $this-&gt;item-&gt;created, JText::_('DATE_FORMAT_LC2'));

Fortunately, this one was easier to follow, but in the end, I still had to use Google to discover that DATE_FORMAT_LC2 is a reference from Joomla's implementation of internationalization. Internationalization is configured with the files stored in the language folder. At this point, the correct way to fix my problem would have been to create a new language zone (e.g., en-US), but instead I decided just to amend the existing source.

In the file language/en-GB/en-GB.ini, you'll find a series of definitions looking something like this

DATE_FORMAT_LC=%A, %d %B %Y
DATE_FORMAT_LC1=%A, %d %B %Y
DATE_FORMAT_LC2=%A, %d %B %Y %H:%M
DATE_FORMAT_LC2=%B %d, %Y
DATE_FORMAT_LC3=%d %B %Y
DATE_FORMAT_LC4=%d.%m.%y
DATE_FORMAT_JS1=y-m-d

Theoretically, all of the core components of the Joomla framework use these definitions for their date formats, and the formats correspond to the PHP date function.  Change these settings to whatever you'd like, and enjoy the convenience of seeing your change applied globally.

Bookmark and Share

Writing bug-free code, and other modern myths

It's almost perfect.

That project you've been working on for months and months or maybe even years is almost into the test system.

You're running down your checklist of features, painstakingly assembled from a series of torn legal pads, post-it notes, and napkins.   So far, everything is perfect.

Then, at 7:21 PM, you arrive back in the same old tired reality.

"I found another bug."  Doh!

There are a number of problems with this scenario.

First, why have you been working on your project for months without putting something in your clients' hands?

There's a great book written by 37 Signals titled Getting RealGetting real means having the right team: small and organized, with a developer, a designer, and a generalist to pull it all together.  Getting real means staying focused: keeping the feature list small, and having a technical non-developer on-hand to establish completion.

But most importantly, getting real means getting real: drop the wireframes; forget about state diagrams; put fingers to keyboard and turn the idea into a product that can be used.

If you've never heard of or read the book yourself, check it out.

Second, if your checklist of features requires anything larger than a single piece of legal paper, then you have too many features planned, especially if you're only on your first release.

At Clutch I'm working on a piece of software that has exactly fifty business rules.  Fifty rules is a lot of rules, but I've been doing this Web development stuff for a while.  I'm seasoned.  Plus, I've got people working with me: someone to do the straight-forward, fingers to the keyboard kind of work; and a crackshot designer to make it look good.

Feature creep begins innocently enough. "Instead of storing the shopping cart in the session, I'll start storing it in the database."

Before you know it, you're worrying about things like scalability, modularity or code reuse, and efficiency; and you're no longer getting real.  Instead, you're tackling all those potential problems before honing any of those fifty business rules; and believe you me: those fifty business rules aren't going to go away: fifty business rules is a lot of rules.

Keep it lean, dude.  Make it better later.

Third, why are you testing your own software?

Newbie mistake numero uno: you can't test your own business logic.

It made sense in your head.  It made sense when you coded it.  It makes sense everytime you push that little button, the application turns green, and you get a record in the database.

But when your client pushes that other button, your application turns red, and the database disappears.  Suddenly, things stop making sense.

The only test you should do yourself is to push the play button on your unit testing code.

Unit testing code?  As the name implies, unit testing code is code that tests other code in units or modules.

Say you have an application that allows its users to shop for widgets.  The phrase "shop for widgets" implies all sorts of micro processes: loading records from the database, routing user requests, validating input, storing new records, sending e-mail, handling errors - the list goes on and on.

Each one of those micro processes is or is composed of units of work; and if you're coding the sane way, you're testing each one of those units independently of the whole.

It's much easier to detect a faulty feature in a data access object when the test doesn't involve the Web application interface - trust me.

These days, you can find a unit testing framework for any platform: JUnit for Java, SimpleTest for PHP, and NUnit on the .NET enterprise.  I can't vouch for NUnit, but JUnit and SimpleTest are absolutely indispensible tools in my toolkit.

Once you're unit testing, you might as well start doing test-driven developmentTest-driven development is development that is driven by tests.

First, you write some unit testing code that relies on a valid business process, e.g.,

    public void testMaximum() {
        assertEquals("The maximum of 4 and 2 is 4.", Math.max(2, 4), 4);
    }

Then, you write the code that enacts the business process.  You go back and run the test, and if the test passes, then you're free to move onto the business rule.

This formula for composing code puts the application's story ahead of the pages on which it's written.  If you focus first on what the application is supposed to do, getting it there will feel more like winning the game than fighting an endless battle with yourself.

Fourth, why are you working at 7:21 PM?

Well, perhaps it's for the same reason that I'm writing this blog article at 10:49 PM: sometimes the creative juices just flow faster in the evening.

But if you're anything like me, you've also probably been at it since 8 AM; and even though you feel like the code is flowing easily, the reality is much more stark.

You're creating tomorrow's messes, today.  Hooray for your stamina!

Always remember the rule of thirds: one-third of your life will be spent asleep (if you're lucky); one-third of your life will be spent at work; and the other third should be spent eating, doing things purely for fun (like sex), creating, or resting (sleeping some more, maybe?).

As developers who love to develop, we find it easy to be lulled into a sense of being creative through our work - that our work itself is part of that creating time belonging to the third-third of our lives.

Get real: work is work.  And though it ain't like diggin' ditches, programming is hard on the body.  Checked your posture lately?  How do your eyes feel right now?  Can you pinch an inch of fat around your midsection?  That's what I thought.   Believe me, I'm right there with you.

So the next time you look down and realize that you should have left work thirty minutes ago, try to remember the fifth thing that's wrong with our shared scenario.

Your code will never be perfect.

It is for this reason that Rands invented the Larry Test.   Because Larry would never have been done, unless his test told him so.

As Rands explains, when left to his own devices, a developer's job is never done.  We refine, recode, refactor, reevaluate, and recode some more, until we think we've achieved perfection.

But perfection never comes.

Perfection doesn't exist in our world any more than it does in the world outside the CPU.  At a high level like JavaScript, everything is ones and zeros.  With enough effort, you can probably herd all of those ones and zeros into a straight line, write a program to interpret them, and prevent cross-site scripting attacks along the way.  Perfection seems achievable.

But were you aware that when you depress a button on an electronic device, there's a program somewhere, patiently and carefully waiting for the electrical switch to stop shaking wildly back and forth?  Waiting patiently to take the final reading, and establish a one or a zero?

What happens if that one or zero never comes?  It is, after all, nothing more than electricity.  A stray magnet, and EMP of one variety or another, a lighting bolt.  Any one of these will drive the voltage right of the charts, leaving that little program with nothing to measure and no way to recover from the failure.

Every single piece of code we write rests atop a stack of hardware: an inescapable electrical reality, confining our perfect programs to a dimension of physical randomness.

At the end of the day, fifty lines of code are probably just as efficient as five.  It's only when your user base increases by an order of magnitude that the game becomes something different.

Consider how long its been since Twitter rolled out a new feature.   Surely they have some good ideas on hand.   But the developers at Twitter are busy doing one thing and one thing only: scaling their core feature set to 100,000 new users a month.  Their idea of perfection is a Twitter than can stand the test of the 2008 elections, or the next Super Bowl, or a natural disaster of Katrina proportions.

---

So, the next time you embark on a new development project, remember these basics:

  • Get real as soon as possible: make it your mission to create a physical manifestation of your ideas
  • Keep the feature list small and allow your project to evolve iteratively
  • Do not test your own software: start with code that expresses your business processes and work backward
  • Go home at the end of the day: exercise, eat well, and invest your free time in another human being
  • And for the love of peat, stop chasing perfection because it doesn't exist; and if you keep pursuing it, neither will you.
Bookmark and Share

More information is comforting

For some people, information creates stress.  Not so for the Collegemans.

One of the greatest sources of stress during Wifey's pregnancy has been a lack of information.  Wifey actually has quite a bit of experience with hospitals and babies.  In Mexico she was studying to be a doctor, and her public service (a requirement of her high school education) was four hours at an orphanage, every Friday, for three years.

Still, there have been a number of aspects of her own pregnancy that have been a bit murky.  For one, we have elected to have a few tests run at the end of the first trimester (this week, in fact).  These tests may, at a later stage, necessitate an amniocentesis - essentially a sampling of the amniotic fluid.  Needless to say, the idea of using a needle to sample fluid from the womb is scary.

Another source of anxiety is in knowing that Wifey will most likely need to deliver through Cesarean section, this due to some unfortunate problems she had with her bowels as a child.  As routine as it may be, delivering through an incision is somewhat more invasive than natural delivery, and implies a longer recovery time.

Dummies to the rescue

I never thought I'd see the day.

A Dummies book?  More helpful than real experience?  More useful than a text book, or something written for folks with better than average vocabularies?  Well, yes, actually.

More specifically, it was the video version of Pregnancy for Dummies that brought the most relief to Wifey's mind (and by extension, my own).  The four-part series is well put together, and is on par with the likes of Discovery Health.  The series takes you from conception to birth to the first three months of life.  It is very informative, entertaining, and not the least bit dumbed down.

If you have a Netflix account, you're in luck: you can watch the entire series instantly, online.

Perhaps this will be the first and only Dummies book I buy?

Bookmark and Share