Archive for category Culture

Code Review and the King James Bible

I am a big fan of code review! Whether the software is written in Java, C++, Python, or (shudder!) Fortran, code review serves a number of important purposes in an organization that develops software. When I worked at Smarttalk.com we used a system of code review designed to produce high-quality code quickly. Here were the steps:

  1. When a developer thinks he/she is done with a single code module (one source code file), that developer calls for a code review. The broadcast e-mail and meeting invitation must go out no less than 48 hours before the scheduled review, so the other developers have at least 48 hours to look over the code before the meeting. You can schedule a code review for 3:00 pm on Thursday as long as you click on the Send button by 2:59 pm on Tuesday (and there were a few of those).
  2. The software developer can invite anyone they want to the review, but at least one participant must be at the Senior level. Go ahead and invite your friends! There was some worry about people only inviting people who would be favorable to them, but we quickly learned this principle: Friends don’t let friends write bad software. You are more likely to accept constructive criticism from your friends than from people you don’t get along with.
  3. A quorum is three people: the developer and two other software engineers, one of whom must be at the Senior level. The code review works better with about 4-5 people.
  4. The code file to review must be less than 1,000 lines long. Generally the other developers retrieve the code from the repository.
  5. The meeting will not last longer than 1 hour. If the code review runs overtime, the participants adjourn and re-schedule.
  6. The goal of the code review is to improve the code. All our jobs depend on producing and marketing high-quality software, and it is in everyone’s best interest for the code in the repository to work well and be easily maintained.
  7. Everyone is nervous at first about their work being reviewed, and for this reason there is a Moderator. The moderator makes sure everyone stays on track, watches out for criticism that is not helpful, and ensures that the experience is professionally positive for the developer. The moderator has the power to kick someone out of the meeting if they are being arrogant or derogatory. I never saw that happen, though – usually it is enough to remind someone that the goal of the code review is to improve the code.
  8. Everyone at the review sits around a table with a listing in front of them. The listing is printed with line numbers for easy reference. The developer begins with a brief explanation of the purpose of the code.
  9. The developer leads everyone else through the code, page by page, or subroutine by subroutine. Everything is fair game for improvement. The reviewers speak up in they have comments on a certain section. If not, the review moves on.
  10. It is great for less experienced programmers to attend! They can learn a lot from someone else’s code. Often they make very worthwhile contributions by requesting more extensive comments for some algorithm that is not clear. Sometimes you get people who just watch out for uniform spacing or lines longer than 80 characters. Those people contribute something positive to the process.
  11. Everyone looks for adherence to the coding standards.
  12. Sometimes design flaws are caught in a code review. The script has to sanitize input for web security. The code has to handle Unicode characters. Sometime a subroutine is just too long!
  13. Reviewers can suggest tests that might produce a failure, if they suspect a bug. The developer makes a note of those and will verify later that the software operates correctly, or fixes the bug if it does not.
  14. If extensive changes are requested, then another code review will be scheduled when the first round of changes are complete. This is rare. Even if there are lots of comments, usually the revisions take only a few days to complete.
  15. After the review: When the developer completes the requested changes to the software, he/she adds a note to the header comments of the file saying that the code was reviewed on that particular date by the following people (full names). Then the developer may check in the code, and move on to another file.

The developer under review gets completed feedback in 49 hours. I’m sure our loyal Funmurphys readers can add to this process and improve it. Tweak it for your organization. Remember that the primary purpose of code review is to improve the code. A secondary purpose is to provide on-the-job training for the more junior programmers. From time to time people will see a clever way of doing something, or suggest one, and notice code overlap that can be eliminated.

Those should be reasons enough for any professional software developer to conduct code reviews. But suppose you are out there thinking, “I’m a good engineer! I’ve written code for years, it’s well tested, and there are only a few minor bugs in my work. I’m good! I don’t need code review. It’s just a waste of my time.” Yeah, you’re kind of arrogant, but you have a right to be.

Here’s why you should request and schedule code reviews on your own code. Because someday, when you least expect it, someone else will come along and have to maintain or extend your code. And yeah, they won’t be as smart as you. They won’t understand your brilliance. They won’t take the time to read through your code and figure out how it’s carefully designed to work. What they will do is go to your boss and say the following: “This code that YourName wrote is dog poop! (but they won’t say ‘poop’)! I can’t follow it at all. This code has to be completely re-written!”

Then your boss will be faced with a dilemma. She knows you are a good software engineer and you write good code. She has not heard any problems with your code until now. But the new person is so insistent that your code is dog poop, that it has to be thrown out and re-written from scratch, and the new person uses lots of CAPITAL LETTERS and exclamation marks and derogatory language in his e-mail complaint. I have seen this happen. What should your boss do?

Your boss has to evaluate the complaint. Your boss has to examine the code you wrote with a fine-toothed comb, checking if you are correct or if the new guy has some validity to what he says. Your boss has to call a technical review at which your detractor will be the star witness. You can’t defend yourself very well since you have moved on to another part of the project. You’re under suspicion. Unless . . .

Unless there is a short section in the header saying the following: This code was reviewed on March 28, 2010 by the following people: Ashley Adams, Bob Biltmore, Charlie Chang, and Debbie Dumas. When your boss finds that comment in the code, her course of action is simple: “Sorry, Mr. New Guy, but this code was reviewed by the software development team and found to be acceptable. You can suggest some improvements, but we are not throwing it out and re-writing the whole thing from scratch. If you cannot understand some else’s code, we will send you back into circulation and hire someone who can.”

Yes, code reviews can be held to Cover Your Anatomy. It’s not a great reason to do them. If the good reasons above are not sufficient to urge you to do code reviews, perhaps this bad one will. Enough said.

Now let’s turn back the clock 400 years to post-Elizabethan England, during the reign of King James I. He decided to produce a new translation of the Bible, the Authorized Version that would bear his name. Alister McGrath has written a great book about this period, which you should stop reading this blog to go out and buy, then come back here. The book is “In the Beginning: The Story of the King James Bible and How it Changed a Nation, a Language, and a Culture” (2001). The translators worked in teams. On page 187 we read this account of the actual translation process:

The translation in King James’ time took an excellent way. That part of the Bible was given to him who was most excellent in such a tongue (as the Apocrypha to Andrew Downes), and then they met together, and one read the translation, the rest holding in their hands some Bible, either of the learned tongues, or French, Spanish, Italian, etc. If they found any fault, they spoke up; if not, he read on.

When I read this excerpt I laughed out loud. These guys are doing a code review! They used the same process 400 years ago to produce a good translation of the Bible that we use in modern times to produce good software! They all sat around a table and checked up on each other’s work. When the King James translators found a discrepancy, they worked together to resolve the problem That’s just what we do, too! I am sure that nobody at Smarttalk or any other software company set out to emulate the King James Bible scholars. But we have hit on the same process to produce a high-quality product.

This does not mean that the King James Bible is a perfect translation; the McGrath book documents a few errors that were corrected later. Another example is Hebrews 11:3 in the King James Version, which reads as follows: “Through faith we understand that the worlds were framed by the word of God, so that things which are seen were not made of things which do appear.” But the Greek word used for ‘worlds’ there is Aion (Strong’s Concordance G165), and should be translated into English as ‘eons’ or ‘ages’. God’s word of command caused huge spans of time to come to pass, as well as physical worlds. The KJV is not perfect. Nevertheless, if people are still using my code 400 years from now, my descendants should be very proud!

Maybe someday I will compare and contrast the process of code review with the peer review conducted by scientific journals.

Tags: , , , , , , , ,

Middle School Field Trip – by Airplane?

Even Dads have to grow up.

My daughter in Middle School is taking a field trip to Washington, DC over Spring Break. They will tour our nation’s capital with American Christian Tours, a tour company that emphasizes our Christian heritage throughout history. She earned part of the money for the tour, and I am making her study up on the places she will visit. When she gets to Gettysburg Battlefield she will know who Pickett was, why and who he was charging, and what happened on that fateful day. When she tours the World War II memorial she will know who were the major powers and leaders on each side of the conflict. When she enters the American History Museum she will tell her friends to look for the half-naked statue of George Washington.

All this is normal.

The strange part for me is that she and the rest of the kids are boarding an airplane to fly to Washington, DC. An airplane! We live in Colorado, so Washington DC is too far to drive over the one-week break. It makes sense to fly. But an airplane??!!! For a Middle School field trip? Sheesh, next thing you know these kids will be taking a field trip to the International Space Station!

I grew up in New Jersey, and my class took field trips by bus to Philadelphia and New York City to see the sights. The historical sites were within easy reach. On the Circle Line ferry around Manhattan Island some elementary school kids from the city challenged us to fight: “Get your gang together. We’ll meet you in the boys’ room!” Remarkably, we were mature enough to laugh, politely decline, and ask them where they were from? They were fun kids once we got past the macho thing.

An airplane!

Perhaps Sean call tell us if airline travel has dropped in cost relative to the Consumer Price Index since the 1970s? In any case, this Dad has to let go and realize that times have changed and let my precious daughter fly to Washington DC for a wonderful and educational adventure with friends I know and teachers I trust to take good care of her. It should be a good trip! She’ll bring her cell phone with her. Oh yeah, you bet she will!

Remembering Y2K

Happy New Year’s Eve!
Happy Last Day of December!
Happy Last Day of 2009!
Happy Last Day of the 2000s decade!

Ten years ago today I was working from home, since I was an independent software developer back then. This was The Day that the dreaded Y2K bug was supposed to hit. The End Of Civilization As We Know It, or just TEOCAWKI for short. Remember?

A number of social commentators were predicting that the Y2K computer bug would cause large-scale failures in our computer-based infrastructure, including some Christian conservatives like Michael Hyatt and Chuck Missler. Ed Yourdon predicted that computer systems administrators would head to the hills en masse because they realized that the problem was huge and couldn’t be fixed. My local hardware store carried large electrical generators with signs saying: “Don’t even think of returning this on January 5 if Y2K turns out to be a bust! We’re onto you.” There were tales of survivalists cashing out their retirement accounts, buying a ranch in the mountains, stockpiling guns and ammo, taking their wives and children up to the compound after Christmas, and keeping a loaded gunsight out for looters when the millennium sun peeked over the horizon. Even modern cars weren’t supposed to work. Remember all that?

As a software engineer, I issued my own prediction in March 1999: Y2K will be no worse than a hurricane. Power and basic utilities will be restored within 48 hours. You’ll be able to go back to work in a week. My prediction seemed pretty mild at the time.

I had a plan, too. I stockpiled about one week’s worth of food, water, and firewood for the “hurricane”, taking care to be sure that anything I bought could be used later for camping trips if Y2K fizzled out. Partly it made good sense to be prepared, partly I was fascinated by the social aspects of worried people getting ready for TEOCAWKI, and partly I wanted to reassure those around me. I still have some extra jugs of drinking water and a few packs of candles and lighters left over. All the Ramen noodles and beef jerky are long gone.

During the summer and early fall I received lots of letters from my bank, my insurance company, my utilities, my retirement company, my post office, all declaring that they had been certified as “Y2K Compliant”. Then in November I got a letter from the supplier of my diskette mailers, saying that they were certified as Y2K Compliant and that the supply of diskette mailers would be uninterrupted by the dawn of the new millennium. I just stared at the letter. Diskette mailers. It’s come to this, probably the most trivial and non-essential item that I purchase. That’s when it hit me that Y2K was gonna be a big bust. The alarmists were wrong. Everything’s going to be all right.

New Year’s Eve fell on a Friday that year, leaving an entire weekend for the computer people to fix whatever problems they found. Ed Yourdon was wrong – the computer system administrators (my friends and colleagues) behaved like the responsible professionals they are, working all that weekend to run tests, re-boot machines, and examine diagnostics for signs of any technical Y2K problems. The weather in Colorado was unusually warm.

I filled up all the bathtubs in my house with drinking water. I remember thinking, “Why should I do this? It’s just a waste of water. Nothing bad is going to happen.” But filling up the bathtubs was Part Of The Plan, so I did it anyway. That evening I discovered that the drains in my tubs didn’t seal very well, and I had lost about half my supply already. The best-laid plans . . .

Since I was working from home, I could keep an eye on the TV. Midnight and the Millennium Dawn were sweeping around the globe. The celebrations were wonderful to watch! In Australia they had trapeze dancers swinging from ropes affixed to the top of the Sydney Opera House. Japan had marvelous dancers and costumed performers. China had spectacular fireworks! Then came Thailand, India, and celebrations in Africa. A few minor problems were reported, like weather maps that displayed the year 19100 and some video rental fees not calculated correctly. But everything was coming out fine, even in Italy who had not done much to prepare. I just relaxed, let all the technical concerns slip away, and watched in wonder as the happy festivals spread around the globe with the coming sunshine. Wow!

Praise God! Happy New Year!

Academic and Choral Achievement

Here is an update since Kevin updated the blogging software. In May 2009 I graduated from the University of Colorado at Boulder with a Master’s degree in Atmospheric and Oceanic Sciences. Wow, five years is a long time! There were quite a few speeches during the graduation ceremony, but I didn’t mind a bit! It took a lot of work to get to that ceremony, and I just sat there in the sunshine with my Master’s robe and mortarboard cap and drank it all in. John Roberts (a CNN correspondent) gave an inspiring address about making your dreams come true. When you come up against a wall, this is your opportunity to show the world how much you want something. If you want your goal bad enough, you will go over, under, around, or through the wall to reach your goal! I feel that I have so much potential, and opportunity, and rich possibilities ahead of me. I don’t ever want to lose that feeling. My sister and family came to see the graduation. Maybe someday when my kids get frustrated with school and homework and term papers and exams they will remember the bagpipes and the funny academic gowns and their Daddy graduating and they will understand that it’s all worthwhile.

Kevin, I don’t know if you wrote a thesis when you got your Master’s degree from Stanford University, or if the co-terminal program had some other option. I wrote a 110-page thesis describing my research and model results:

Title: Application of Storm Surge Modeling to Moses’ Crossing of the Red Sea; and to Manila Bay, the Philippines

Abstract:
Storm surge occurs in low-lying coastal areas when strong winds blow the sea surface up onto the land. The resulting inundation can pose a great danger to lives and property. This study uses an Ocean General Circulation Model and the results from a mesoscale atmospheric model to simulate storm surge and wind setdown. Two case studies are presented. A reconstruction of the crossing of the Red Sea by Moses and the Israelites, as described in Exodus 14, shows that the eastern Nile delta of Egypt matches the Biblical narrative and provides a hydrodynamic mechanism for water to remain on both sides of the dry passage. The vulnerability of Manila Bay and the surrounding areas to a Category 3 typhoon is evaluated and shows that the simulated surge heights depend heavily on the wind direction and the coastal topography.

The thesis document is published electronically by ProQuest, and anyone can download the PDF for a fee and read it. I classified the thesis under Biblical studies in addition to Physical oceanography and Atmospheric sciences. It would be cool to hear a little bell every time someone reads my thesis, but scientific publishing has not reached that stage yet.

I also made the national news for having sung in the Boulder Messiah Sing-Along for 17 consecutive years now. On November 3, 2009 the Associated Press published a news story on Messiah Sing-Along events, featuring the Boulder Messiah Chorale and Orchestra. Hallelujah for Handel’s ‘Messiah’ is by reporter Ann Levin. I am the Enthusiastic Choir Member in the story. If that link ever ceases to work, you can Google for: “Carl Drews” Messiah. Nobody has recognized me on the street yet (“Hey, you’re that Messiah choir dude!”), but it is nice to see that our sound is gone out into all lands, at least electronically.

Tags: , , , , ,

Just to Clarify

I’m not anti-intellectual, I’m anti-academic.

For an academic, there isn’t a difference between academic and intellectual. For an intellectual, they differ.

I became an anti-academic in college, and I haven’t seen a reason to change yet.

By the Waters of Babylon

Thanks to Netflix we worked our way through the first season of “Mad Men” last week. I heartily recommend the series: it’s well photographed and well acted and takes you back to the early 60’s. Watching adults drink and (drink and drink and) drive–without seatbelts no less–or children playing “spaceman” with the (these are not a toy!) clear plastic dry cleaning bags reminds you of how much has changed in the last four decades or so.

One episode, entitled “Babylon” ends with a cover of Don Mclean’s Babylon (but get the original) with it’s moving lyrics from Psalm 137:

By the waters, the waters of Babylon.
We lay down and wept, and wept, for thee Zion.
We remember thee, remember thee, remember thee Zion.

YouTube has the segment here http://www.youtube.com/watch?v=w4aAgvQelGI

As I was searching for more information on the song I came across Stephen Vincent Benet’s mesmerizing short story “By The Waters of Babylon” that details a young man’s journey to a ruined New York City, known to his people as “The Place of the Gods” (and the title of the story when originally published in the Saturday Evening Post in 1937). I had read it as a boy and was moved again re-reading this scene:

He was sitting in his chair, by the window, in a room I had not entered before and, for the first moment, I thought that he was alive. Then I saw the skin on the back of his hand–it was like dry leather. The room was shut, hot and dry–no doubt that had kept him as he was. At first I was afraid to approach him–then the fear left me. He was sitting looking out over the city–he was dressed in the clothes of the gods. His age was neither young nor old–I could not tell his age. But there was wisdom in his face and great sadness. You could see that he would have not run away. He had sat at his window, watching his city die–then he himself had died. But it is better to lose one’s life than one’s spirit–and you could see from the face that his spirit had not been lost. I knew, that, if I touched him, he would fall into dust–and yet, there was something unconquered in the face.

Tags: , ,

The World We Live In

Our interpreter (OK, we called them guides) at Northern Tier was in college studying to be an engineer. So naturally I gave him enough wisdom and advice on the subject to last a lifetime. During the conversation, my son piped up with “scientist and engineers run things, right?” I had to correct him.

“We live in a world built by scientists and engineers, but salespeople run it.”

Tags:

Lights, Engineering, Depression

While I find a brisk walk on a cool but sunshiny day to be a wonderful mental tonic, I don’t know that there’s measurable benefit to people who are actually depressed. Dr. Ilardi thinks there is, though.

Hmm, how does this play with the ranking of the least depressing fields: Engineers, Architects, and Surveyors? Maybe including the surveyors who spend most of their time outdoors I imagine, as opposed to we engineers who spend most of our times in human sized mazes under florescent light, is the secret to the lack of depression in those fields. Farming, Fishing, and Forestry isn’t far behind, so maybe there is something to this after all.

No matter, I work in a profession that is fun and productive. Maybe that’s why my fellow engineers are in such good mental health, whether we are like cavemen or not.

Tags:

Moral Depravity

I’m the number one hit for “moral smugness” on Google. I now turn to what I find to be moral depravity -an email sent to Archpundit from a white supremacist. I warn you, it is revolting, not for the obscene language, but for the sentiments expressed. While on a theoretical level I understand that people like Mr. Holt exist, it’s a shock to read such brutal hatred, and another shock to find out this guy was recently on the School Board for St. Louis and currently has a radio show here in St. Louis.

There is some irony to the email – the torrent of abuse on “nigros” and “nigro lovers” was set loose by Archpundit calling Mr. Holt a white supremacist.

Tags:

I Dodged A Bullet (Metaphorically)

I about had a heart attack this morning – the St. Louis Post Dispatch editorialized about the concealed carry law that:

“It would be wonderful if the law were unconstitutional, as Judge Steven R. Ohmer says it is. But it’s hard to read the Missouri Constitution that way without a lot of wishful thinking.”

This is the same editorial board that supported common crook and high handed Speaker of the Missouri House Bob Griffin because he was a staunch supporter of abortion on demand. I have to say it’s great that despite their repeating the claim that concealed carry “is the road to hell” and is “an abomination” (hey, aren’t these the people who hate it when right wingers speak in that kind of language?) they have the intellectual honesty to admit that it isn’t unconstitutional (if they would only do the same about Roe vs. Wade, I really would have a heart attack).

I don’t care that much about concealed carry, but I went from an opponent to a supporter when I looked at the data. It doesn’t lead to shootouts in the streets, people killed over nothing, and an increase in crimes of passion. I don’t think it does much to lower the crime rate, either, though. But what it does do is allow the average citizen, and most importantly the single mom living in a lousy neighboorhood, the ability to choose a firearm as a method to protect herself. That’s me, pro-choice when it really is a choice.

Tags: ,