metamerist

Tuesday, February 26, 2008

Curare



Artist: João Gilberto
Song: Curare

Monday, February 25, 2008

Fighting fire with gasoline...

Philip Greenspun wonders about our economic remedies as well:

"The U.S. economy is in a tough spot right now. Historically low rates of interest in the early part of the decade generated the biggest housing bubble in the history of the nation...

We read in the newspaper accounts of the debates of learned economists. They disagree to some extent about how to keep the U.S. from sinking into a depression. What can they all agree on? The cure is to lower interest rates and print more money…."

link

Code Comments & n00bs

Lately, I've found myself pondering and discussing the formatting and commenting of software source code. Steve Yegge made a post on the subject not too long ago, and because he's become frequently cited as a guru, I feel compelled to make a comment or two on the subject.

The post in question demonstrates an alleged difference between the coding and commenting style of inexperienced programmers (n00bs) and experienced programmers. Thing is, in spite of spending over two decades writing software, I can't say I relate particularly well to either case presented, n00b or non-n00b.

Forgiving the n00b example as having a dollop of hyperbole for effect, the experienced case is more interesting to me, because it contains virtually no white space. This isn't the first time I've seen experienced engineers with an aversion to white space. Some coding standards even dictate close placement of braces for the sake squeezing more code on the screen.

Some software creators like their code tightly packed together. Myself, I'm a proponent of white space.

When it comes to published language, the desirability and utility of white space has been well demonstrated--not only by the evolution of the printed word, but in psychological studies as well. Collecting ideas into paragraphs, demarcating blocks of text with white space, titles, subtitles, chapters, headings... It should come as no surprise that these formatting goodies are all fine things that serve important purposes that have stood the test of time. Why do software engineers who eschew whitespace in their code, still use it in their prose?

Programming languages haven't been around nearly as long as publishing, but the use of white space in program code is also encouraged in many computer science classes across the country--as a simple Google search will reveal. The use of white space may not yet be a universally acknowledged good, but the lack of it is hardly an accepted ideal. At best, this is a contentious issue and there are differing schools of thought.

As far as code comments go, the fundamental question in my mind is a question of ROI. Generally, computing problems are solved while you're "in the zone" so to speak. One object of comments in code is to expedite a return to "the zone"--that particular mental state you were in when you wrote the code in the first place. A few well-written comments can save a lot of time towards realizing this end.

It's easy to return befuddled to complex code written a year prior and spend an entire day quizzically wondering what the heck you were thinking--and all the while you'll wish you invested a little more time translating those in the zone thoughts into insightful, useful comments.

When five minutes time from your present self saves your future self a day's work, the ROI is clear (or, if you save some other poor soul's future self a day's work.) At other times, code is so simple and manifestly obvious comments only get in the way as annoying restatements of the obvious.

I see no hard and fast rules on this front. When and how much to comment really boils down to a matter of prudence, but wondering how long it will take you to comprehend the code at hand once you've forgotten it is always a good question to ask--and how much that time might be reduced with a few more comments.

Update: After a little more searching, I found some similar sentiments from Raymond Chen.

Thursday, February 21, 2008

Inside Out



Artist: The Mighty Lemon Drops
Song: Inside Out
Disc: World Without End
Year: 1988

Sunday, February 17, 2008

The Sea and Cake



Artist: The Sea and Cake
Song: Afternoon Speaker

Saturday, February 16, 2008

This Week in Health

Just when we started believing margarine was better for us, we found out it was worse. After that, we began wondering if autoimmune disorders were the result of our being too clean.

And now...

Diet soda makes you fat?

Germs fight cancer?

Dr. Melik: This morning for breakfast he requested something called "wheat germ, organic honey and tiger's milk."

Dr. Aragon: [chuckling] Oh, yes. Those are the charmed substances that some years ago were thought to contain life-preserving properties.

Dr. Melik: You mean there was no deep fat? No steak or cream pies or... hot fudge?

Dr. Aragon: Those were thought to be unhealthy... precisely the opposite of what we now know to be true.

Dr. Melik: Incredible.

from Woody Allen's Sleeper

Friday, February 15, 2008

Vista: Stage 3 of 3 0% Complete


photo by mdumlao98

Besides me, it looks like a number of people got bricked by the latest Vista update (1, 2, 3, 4, 5, &c.)

What happens: Vista does an automatic update and keeps displaying "Stage 3 of 3. o% complete" and keeps rebooting forever and ever, hallelujah, hallelujah.

How to fix it: Reboot, press F8 while starting up, do System Restore, restore your system to before the moment of brickage (and turn off automatic updates in Control Panel so it doesn't happen again (at least until this problem has been addressed).

Note: If you're keeping score, this was on a Dell E1705 laptop.

Tuesday, February 12, 2008

Dancing on Our Graves

Infectious backbeat, mesmerizing guitar, eerie video...



Artist: The Cave Singers
Song: Dancing on Our Graves (mp3)
Year: 2007

Monday, February 11, 2008

Fail

Not sure if it's a sign of budding curmudgeonliness, discriminating taste or mere eccentricity, but I seem to be amused by only 5% of all that is popularly deemed funny.

That said, the fledgling Fail Blog has been killing me. Don't miss 85 fails in the January archives.



link


Friday, February 01, 2008

New Soul

From the new MacBook Air commercial



Artist: Yael Naim
Song: New Soul
Year: 2007

Economics 101

Q: Suppose your economy is in trouble because people borrowed too much money and spent beyond their means. What's the solution?

A: Ignore a nine trillion dollar national debt, borrow even more money and hand it out to your citizens so they can spend it.