The Daily Parker

Politics, Weather, Photography, and the Dog

Small classes (geeky)

Andrew Binstock, editor of Dr. Dobb's, has a pair of editorials in praise of and instruction to create small classes:

High levels of complexity, generally measured with the suboptimal cyclomatic complexity measure (CCR), is what the agile folks correctly term a "code smell." Intricate code doesn't smell right. According to numerous studies, it generally contains a higher number of defects and it's hard — sometimes impossible — to maintain. ...

My question, though, is how to avoid creating complexity in the first place? This topic too has been richly mined by agile trainers, who offer the same basic advice: Follow the Open-Closed principle, obey the Hollywood principle, use the full panoply of design patterns, and so on. All of this is good advice; but ultimately, it doesn't cut it. ...

...[Y]ou need another measure, one which I've found to be extraordinarily effective in reducing initial complexity and greatly expanding testability: class size. Small classes are much easier to understand and to test.

In Part 2, in which Binstock responded to people who had written him about the first editorial:

Coding classes as diminutive as 60 lines struck other correspondents as simply too much of a constraint and not worth the effort.

But it's precisely the discipline that this number of lines imposes that creates the very clarity that's so desirable in the resulting code. The belief expressed in other letters that this discipline could not be consistently maintained suggests that the standard techniques for keeping classes small are not as widely known as I would have expected.

Both editorials make excellent points. Every developer should read them.

At the end of the day, these clichés suck

The UK Independent's Jon Rantoul won't be using clichés any time soon:

Normally, though, politicians are the worst offenders. It is not clear how much they themselves are to blame, or how much they are simply overwhelmed by the substandard drafting of civil servants and speech writers. Perhaps they lack the time to put a pen through it and rewrite it themselves. It is a national scandal that the Civil Service provides such ghastly drafting of official documents, full of turgid abstractions that are intended, perhaps unconsciously, to conceal the thinness of the content. As for speeches, what do politicians pay their speech writers for?

The Prime Minister's speech on NHS reform last week was a shocker for clichés: "pillar to post; in the driving seat; frontline; level playing field; cherry picking; one-size-fits-all; reinvent the wheel; let me be absolutely clear; no ifs or buts". If each of those were not on the List [of banned clichés] before, they are now.

The Daily Parker has adopted the list, effective immediately.

Historic airplane lost outside Chicago

A B-17 bomber built during World War II crashed today and was completely destroyed by a post-crash fire. Fortunately, no one was seriously hurt. Unfortunately, the 67-year-old airplane, restored to flying condition just a few years ago, was a total loss:

The B-17, christened the "Liberty Belle," took off from the airport at 9:30 a.m. and made an emergency landing in a cornfield near Highway 71 and Minkler Road in Oswego after the pilot reported an engine fire, according to Sugar Grove Fire Chief Marty Kunkle. Witnesses said he set the plane down between a tower and a line of trees.

One person on the plane was treated at Rush-Copley Medical Center in Aurora and released, hospital spokeswoman Courtney Satlak said.

The plane was one of the world's last surviving WWII bombers. The article had more on its history:

The plane that crashed was manufactured in 1944. It was sold on June 25, 1947 as scrap to Esperado Mining Co. of Altus, Okla. and was sold again later that year to Pratt & Whitney for $2,700, according to the foundation's website.

Whitney operated the B-17 from Nov. 19, 1947 to 1967 to test turboprop engines. It was donated in the late 1960s to the Connecticut Aeronautical Historic Association in East Hartford, but was heavily damaged in 1979 when a tornado threw another aircraft against the B-17’s mid-section, breaking the fuselage, the foundation said.