comments edit

The local newspaper sports a comic strip that enjoys every opportunity to mock the modern university’s emphasis on diversity. The strip holds diversity accountable for lowered standards and educational quality. However it ignores the danger of a lack of diversity, namely that a student might not be exposed to new ideas that challenge pre-existing assumptions that would improve the student’s overall education.

Tunnel Vision Likewise, any institution that does not cultivate diverse viewpoints risks being caught in institutional tunnel vision. At times, spending too much time and energy duplicating the efforts of others due to simple ignorance. I sometimes see hints of this within the .NET developer community.

Copping a Borgitude

Over the past several years, there have been a proliferation of developers who have what I call the “Microsoft” mindset, also known as “Microsoftitis” or “Borgitude”. This conditioned is characterized by a general tendency to hold up the Microsoft way of doing things as the holy bible of software development.

Please note that this is not a blanket criticism of the Microsoft way of doing things. For the most part, Microsoft does a bang up job of developing software and their development platform is fantastic. However, not everything they preach is gospel. What works for Microsoft isn’t always going to work as a one-size fits all solution for everyone else. And at times, Microsoft has shown itself capable of completely ignoring prior art.

Test Driven Development

What really got me thinking about this is a while ago was Microsoft’s blunder with their approach to TDDin Team System, here summarized by Sam Gentile.

This is not to say that TDD is gospel either. But in adopting TDD as part of Team System, Microsoft sets the stage to shape how many developers with Microsoftitis will first encounter and view TDD. Rather than abiding by their traditional “Embrace and Extend” philosophy, they decided to “Ignore and Do It Our Way” which will leave many with a skewed view of TDD and its benefits.

This is unfortunate because TDD has a rich history and a lot of prior art spearheaded by the Java and Smalltalk communities. The fact that the source of these practices are not Microsoft should not dissuade a developer with Borgitude from giving them a fair shake. There is a lot to learn from these other communities, and a lot to lose by not expanding one’s experience.

Source Control

Another classic example is source control. To many developers with Microsoftitis (and I was this way for a long time) source control is Visual Source Safe (derisively called Visual Source Crap by its detractors). Other means of version control are unknown to such developers.

Visual Source Safe has its place. For fairly small teams within the same network, it does a decent enough job. But for developers who have a very low tolerance of repository corruption, larger teams, or distributed teams, VSS is not an ideal solution.

The most common reason given for sticking with VSS is that it is free. This is ironic because it isn’t technically free. It merely comes bundled with whichever MSDN subscription your company happened to buy. However the real cost isn’t that subscription fee, it is the lost productivity by being forced to adhere to the pessimistic locking checkout/checkin model of VSS. For large teams this is extremely restrictive. And when VSS corrupts your data (if it hasn’t yet, just wait. You’re sitting on a ticking time bomb) add the cost of downtime and developer time to bring it back. That is the real cost of VSS.

For distributed teams, VSS performs terribly and is basically unusable unless you purchase SourceOffsite made by a VSS competitor.

What really burns my hide is that one of the reasons given for changing the web project model in ASP.NET 2.0 is that large teams complained of lock contention on the project file. This isn’t a problem with the existing web project model, this is a problem with pessimistic locking on a large project! This has led to many complaining about the new project model.

If the real argument for sticking with VSS is that it is free, one should consider Subversion which is orders of magnitude better.

I suspect that the real reason many stick with it is because they are used to it. Many have never actually taken a class or read a tutorial on version control, so the ramp up time for a new system seems daunting.

On one hand, there is nothing wrong with that. If it is really working for you, why change? On othe other hand, VB6 worked for a lot of developers, but there is only so long you can ignore the advantages to moving to VB.NET or C#.

Development Idioms

If Microsoft provides a component, many developers will never evaluate alternatives. This makes sense for many reasons such as dependency avoidance. Who has the time to evaluate other options when one is already built in? Even so, one should have at least some small exposure to other solutions. Especially when they too are free.

For example, in ASP.NET 1.1 it makes good sense to use the built in Tracing mechanism for logging. It is very configurable and extensible and generally meets the needs of most developers. However many developers find it to be extremely slooow and discovered that Log4Net is an even better solution for their needs. By breaking out of Microsoftitis they discover a mature logging framework that meets their functional needs and performance needs.

The fact that it is in essence a port of the java community’s Log4j does not detract from its usefulness. Log4j has been around a long time and that maturity is apparent as they have solved a lot of problems that other roll-your-own logging frameworks are just now discovering.

The Remedy

If you are a .NET developer I am by no means advocating that you switch to Java (though you may want to spend some time programming in Java, Ruby, Python, etc…). I firmly believe that in a language to language comparison, C# is a much better language to write software in than Java.

However, the language syntax itself is not the whole of the development experience. Many of the features we are just oohing and ahhing about in VS.NET 2005 have been in Java IDEs such as IDEA and Eclipse for a long time now. It seems that we are rediscovering the many things that Java and SmallTalk developers take for granted.

So what I am advocating is to diversify your development reading, toolbox and experience. For example, instead of complaining about how expensive Team System is, consider that by using Trac, MbUnit (or NUnit) and Subversion, you have many of the tools that TS provides, but for free. You don’t have to be beholden to the Microsoft way.

Instead of only reading Microsoft Press, read a book on Java or Ruby. Read up on MVC and other architectural styles and decide for yourself whether or not it makes sense to use it on your next ASP.NET project. Read up on REST as an alternate to SOAP and understand the differences and the advantages and disadvantages of each.

Most of all, consider working on an open source project. In the comments to my post on Open Source, Joe Brinkman says it well when he describes the benefits of being involved in an open source project.

In my office, the closest I ever came to some of the best and brightest in the development community was seeing someone speaking onstage or reading their book/blog. Since working on an OS project, I have had the opportunity to trade ideas with some of the best .Net developers in the world.

comments edit

I was reviewing some code when I ran into code that fit this pattern all over the place (simplified to make a point).

string format = “/comments/{0}/{1}.aspx#”;

string url = String.Format(CultureInfo.InvariantCulture, format + entity.Id, entity.ParentID, entity.Date.ToString(“yyyy/MM/dd”, CultureInfo.InvariantCulture));

There are a couple things I want you to notice here. The first is concatenation of the entity id to the end of the format string.

format + entity.Id

Second, notice format string passed into the ToString method of the the entity.Date.

entity.Date.ToString(“yyyy/MM/dd”, CultureInfo.InvariantCulture)

Ok I lied. There is a third thing I want you to notice - the fact that CultureInfo.InvariantCulture has to be specified twice.

My guess is the author of this code was in a hurry and didn’t realize the full power of format strings that can be passed to the String.Format method. It is possible to get all the formatting information in a single string. Here is how I rewrote this.

string format = “/comments/{0:yyyy/MM/dd}/{1}.aspx#{2}”;

string url = String.Format(CultureInfo.InvariantCulture, format, entity.Date, entity.ParentId, entity.Id);

In this rewritten code, I took advantage of the fact that the String.Format method allows you to specify formatting information within the place holders like so.

{0:yyyy/MM/dd}

In this way, the code does not need to call the ToString method of the DateTime instance. The formatting is all in a single format string and that is one less CultureInfo.InvariantCulture you need to type.

This helps make the code more readable and more flexible. The string format for this url is all in a single string.

A useful reference for string formats that I keep at my fingertips is the following blog post by Steve Tibbett. If you use format strings, you will find this reference invaluable.

comments edit

Candy Hearts Read this interesting post by security expert Bruce Schneier on how Valentine’s day is the day when cheating spouses are most likely to trip up.

The gist of the story is that it is the one holiday that pressures people to do something romantic for a spouse or lover. For a cheating spouse, this is a problem as he or she has both.

I can just see the pathetic excuses now.

Ummm yeah, I bought the lacy panties for myself, but tossed them out because they didn’t fit.

comments edit

Multi-Touch UI By now just about everybody is ooh-ing and aww-ing over this demonstration video showing multiple users on a single touch and pressure sensitive graphical user interface.

And rightfully so. This thing is amazing! Who wouldn’t want to be able to organize their photos in the manner they do in the demo? They’ve created a particularly intuitive means for navigating photos, maps, floating lava lamp blobs that is a huge step forward in usability.

Is it Ergonomic?

But there was one small issue that popped in the back of my mind. One other detail that would need to be addressed by such an interface. Is it ergonomic?

For software developers, who typically sit at a computer 8 or more hours a day, the ergonomics of a system are extremely important. Ideally monitors are placed so that the top is a couple of inches above eye level. Your head actually has a significant amount of mass (even more if you have a forehead like mine) so it should remain for the most part balanced on your neck to prevent strain.

What would eight hours a day looking down at a tilted screen do to a person’s body? Either we would develop very strong neck and shoulder muscles like our governator, or we would suffer from shoulder and neck pains along with headaches.

I am not sure what the solution is, but I hope they address it because I definitely would want such a device. Perhaps one option is a dual screen approach where a user could alternate by looking at a non-tactile screen at eye level that mirrors what the user is doing on the touch screen, allowing the user to alternate between screens. Having the touch screen at eye level would only introduce upper arm and shoulder pain. Ever try holding your arms straight in front of you for hours at a time? It is painful. Whatever the solution, I bet they will come up with something better than anything I have proposed.

The Lesson

The lesson here is that great design is hard and there is no perfect design. When trying to design anything, such as a new UI, a compensation plan, etc… You have to consider and try to anticipate unintended consequences.

comments edit

Soccer Ball I’ve joined a group of soccer players attempting to form a team to get into a 30 and over league that hosts games on much nicer fields. These are the fields with that really nice high quality artificial turf, a huge difference over the pock-marked dirt/grass fields of my current league. The play in this league is also at a much higher level than my current league and they are very particular about which teams they let in. They judge teams on ability, sportsmanship, and organization.

Last night we played one of their top teams, if not the top. This team included an ex-Sweden national team player and an ex-MLS/National Team player. Had I known I would have asked for autographs. ;)

For one of their warm-ups, these guys we’re in tight circles of five conducting a one-touch five man weave. The interesting part was that it was one-touch in the air. The ball didn’t touch the ground. Meanwhile we looked like the Bad News Bears with our mismatched jerseys. This was one of several friendlies so that the league could evaluate us, so we don’t have uniforms yet.

In any case, we struck first with a goal and ended up with a one to one tie. A very respectable showing, but between me and you, and I would never admit this normally, but they were a much better team. It was obvious they’ve played together for a long time. It is amazing what a well organized, well coordinated team can do. Just like software teams!

Not only that, every last one of them was fit like Lance Armstrong. This was one of the few games I subbed myself out from time to time to get a breather. Usually you have to drag me kicking and screaming off the field.

In any case, we just got the word that we have been accepted into the league. Woohoo! Hopefully we won’t run into any brawls in this league.

comments edit

Toy Soldier With Bazooka No, this isn’t a revisionist history account attempting to insert the role of software in the Crusades. Today we take a look at Religious Wars in software. Sometimes also referred to as “Flame Wars” and “Holy Wars”.

A religious war is a very passionate conflict or argument in which each side is absolutely convinced of the objective truth of his or her own position on a matter of personal preference. These are typically very heated arguments over very trivial matters in which the only truth is that there is no objectively correct answer. These arguments would make an outsider wonder if we should all be locked up in straight jackets.

Spaces or Tabs

One good example, and I hesitate to even mention it, is the topic of using spaces or tabs for indenting code. True software developers know there is only one right answer and they’ll defend the truth of that answer till they are blue in the fingers, making sure to spread the “One True Indenting Style“ to every forum in every nook and cranny of cyberspace. Obviously I know what the real answer is and that answer is…

Kinda puts the “anal” in anal retentive obsessive compulsive doesn’t it?

Private Member Prefix

Sometimes we lob grenades over a single character or two. Make sure to prefix private member variables with an underscore or be burned at the stake in one camp. Use an m_ prefix or be flayed alive by another camp. Don’t use an underscore at all in yet another camp or be drawn and quartered. I’ve seriously thought of joining the camp that wants to prefix member variables like so:

string HEYThisIsAPrivateMemberVariable___someVariable;

How is that for being explicit? Of course the true code warrior will notice I didn’t explicitely mark the member as private and already has a sniper laser scope aimed at my head.

Holy War Phoenix

The real beauty of religious wars is that they never go away. Sure they’ll sometimes flame out a bit and lie smoldering just under the radar. But wait long enough and they’ll spring back to life in full force. Just look at the Edit and Continue debate in Atwood’s blog.

Another example of a holy war that never seems to die is the VB.NET vs C# debate. This is an interesting one because VB.NET and C# are really good buddies who like to have a pint at the pub together every now and then. They don’t have a beef with each other. It’s certain camps that use these languages who like to beat each other with flames and misinterpreted arguments that thrust these languages into an all out religious war.

Crusaders

At the forefront of these religious wars are the crusaders. I won’t link or call out any in particular lest my blog become the next battleground for the faithful holy warriors. But you recognize them when you see them. They can be found in the trenches of the newsgroups, blog comment sections, and in their own blogs, fighting for the cause with a single minded determination.

They rarely give an inch to the oppositions viewpoint, lest they come across as weak. You are either with them, or against them.

Well Known Religious Wars

No discourse on religious wars would be complete without a list. This list is by no means complete, but simply a list of well known holy wars in software that I can recall. Please contribute others in the comments and I will keep this updated.

  1. Spaces vs Tabs for indenting code
  2. Curly braces on their own line or not
  3. Private Member Prefixes…or not
  4. private keyword or just omitting it
  5. Managed Languages vs Unmanaged
  6. Edit and Continue or Not Edit and Continue
  7. BDUF vs Iterative Design
  8. Interpreted and dynamic languages vs Compiled
  9. VB.NET vs C#
  10. Java vs .NET
  11. vi vs emacs
  12. Windows vs Linux
  13. Tastes Great vs Less Filling

Got any others?

comments edit

So after reading this post by Scott Hanselman, I just had to try it out. He writes about a site called MyHeritage that attempts to match your face to celebrities and relatives.

I thought I might have interesting results since I am bi-racial, but wasn’t expecting much. Here is the photo I uploaded and the two closest look alikes.

Portrait of Me

Look Alikes

Now that is just plain rude! Dare I play the race card here? Just because I am half-Korean with glasses doesn’t mean I look like Kim Jong Il! We don’t all look alike!

In a way they were accurate about my heritage, by having the top two results be a caucasian and a Korean.

Now if you’ll excuse me, the Great Leader wishes to get back to work on some interesting code.

comments edit

Recently I added some seemingly innocent code to Subtext within the Application_BeginRequest method of Global.asax.cs that I adapted from this blog post by Darren Neimke. The purpose of the code is to provide culture aware formatting of dates, times, and numbers specific to the user reading the blog.

// Set the user culture.  Got the idea from

// http://markitup.com/Posts/Post.aspx?postId=52252561-f83d-4463-82f0-769fce82fd82

// but modified it to catch specific exceptions.

//TODO: Make sure we store dates in UTC etc and do the conversion when we pull them.

//        I assume we do this but haven’t checked.

try

{

    if (Request.UserLanguages != null

            && Request.UserLanguages.Length > 0

            && Request.UserLanguages[0] != null)

    {

        Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Request.UserLanguages[0]);

    }

}

catch(NotSupportedException nse)

{

    log.Error(“Error while attempting to set CurrentCulture to ‘” + Request.UserLanguages[0] + “’”, nse);

}

Such a simple snippet of code, yet it introduced a couple of bugs, both which can be seen in this screen capture that Jayson Knight kindly sent me.

Archive Links

The first error, the fact that you see the same month over and over, has been fixed in our codebase, but I have yet to deploy it to my blog. That has to do with how different cultures format dates differently when ordering the month and the day.

The second error is the fact that Jayson is seeing the months in what appears to be Portugese in the first place. At one time, he saw the months in Spanish. I started wondering if somehow a thread from the thread pool with a CurrentCulture already set was servicing his request, but that didn’t make any sense since it should be reset for him.

Then it occurred to me today. Subtext makes extensive use of caching on multiple levels from data caching to output caching. When I added this code, I didn’t go through and update all code that caches data to vary the cache by user language. Doh!

Once again, the law of unintended consequences smacks me upside the forehead.

UPDATE: Jon Galloway points out that Scott Hanselman wrote about this very thing recently. I read that post and totally forgot about it when I made my change. Blogs are good, umm’kay.

comments edit

If you’ve started on module development with DotNetNuke 4.0 and above in Visual Studio.NET 2005, you might run into a problem with trying to add a Web User Control (*.ascx file) to a class library.

The fix is similar to what you had to do with Visual Studio.NET 2003.

For C#, follow these steps.

  1. Close VS.NET 2005.
  2. Open the directory C:\Program Files\Microsoft Visual Studio 8\Web\WebNewFileItems\CSharp (assuming a default installation of VS.NET).
  3. Open the CSharpItems.vsdir file in Notepad. Select the text and copy it to the clipboard.
  4. Now open up the file C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProjectItems\CSharpItems.vsdir and paste the contents of the clipboard underneath the existing text.
  5. Now copy the contents of C:\Program Files\Microsoft Visual Studio 8\Web\WebNewFileItems\CSharp (excluding CSharpItems.vsdir) into the folder C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProjectItems.

Now “Web User Control” should be an option when you select Add | New Item.

comments edit

Lately I have been spending a little bit of time performing maintenance tasks on my blog’s SQL Server. I noticed that OdeToCode’s Scott Allen was in the same mood.

In looking to free up some database space, he took the somewhat drastic step of deleting all referrals and urls before a certain date. Since he doesn’t care about this data, it isn’t really all that drastic. But it makes a data packrat like me shudder. I wanted to free up some space as well so I created an approach that frees up a lot of space, but keeps the data I care about.

Around 90% to 99% of my referrals are from web searches and online blog readers. As a matter of fact, nearly all of these are from Google. Since those referrals are not that important to me as WebHost4Life also tracks that data, I wrote a script to delete them for Subtext. Note that the following SQL script is pretty aggressive, so use at your own risk. You might even think of some search strings that I missed.

DELETE FROM subtext_Referrals

WHERE UrlID IN

(

  SELECT UrlID

  FROM subtext_URLs

  WHERE Url LIKE ‘http://google.%’

    OR Url LIKE ‘http://%.yahoo.%’

    OR Url LIKE ‘http://yahoo.%’

    OR Url LIKE ‘%/Search/%’

    OR Url LIKE ‘%/Search?%’

    OR Url LIKE ‘http://search.%’

    OR Url LIKE ‘http://bloglines.%’

)

 

DELETE FROM subtext_URLs

WHERE Url LIKE ‘http://google.%’

  OR Url LIKE ‘http://%.yahoo.%’

  OR Url LIKE ‘http://yahoo.%’

  OR Url LIKE ‘%/Search/%’

  OR Url LIKE ‘%/Search?%’

  OR Url LIKE ‘http://search.%’

  OR Url LIKE ‘http://bloglines.%’

I then ran the same commands that Scott did after reading his post.

DBCC DBREINDEX(subtext_URLs)

DBCC DBREINDEX(subtext_Referrals)

DBCC SHRINKDATABASE(SubtextData)

In order to run those commands on .TEXT, just replace the “subtext_” prefix with “blog_” and you are set.

Now I haven’t tested this, but I imagine the corresponding script for Community Server would be the following based on its published schema.

DELETE FROM cs_Referrals

WHERE UrlID IN

(

    SELECT UrlID FROM cs_Urls

    WHERE Url LIKE ‘http://google.%’

      OR Url LIKE ‘http://%.yahoo.%’

      OR Url LIKE ‘http://yahoo.%’

      OR UrlLIKE ‘%/Search/%’

      OR Url LIKE ‘%/Search?%’

      OR Url LIKE ‘http://search.%’

      OR Url LIKE ‘http://bloglines.%’

)

 

DELETE FROM cs_Urls

WHERE Url LIKE ‘http://google.%’

  OR Url LIKE ‘http://%.yahoo.%’

  OR Url LIKE ‘http://yahoo.%’

  OR UrlLIKE ‘%/Search/%’

  OR UrlLIKE ‘%/Search?%’

  OR UrlLIKE ‘http://search.%’

  OR UrlLIKE ‘http://bloglines.%’

comments edit

I got a 1099 for my blog yesterday. Now that is a weird feeling. Google giveth, the federal government taketh away.

Google has some tax information regarding ad-sense income. Basically operating this blog has in effect become a small proprietorship small business. I will deduct hosting costs etc… I wonder if I can deduct time spent on Subtext. That would be pretty sweet.

UPDATE: For my readers not familiar with tax regulations in the U.S., I should mention that the 1099 is used to report income other than wages, salaries, and tips. I linked to the Wikipedia explanation for more details.

comments edit

Troll Cap I love this idea from 37 Signals in handling abusive comments. Rather than simply deleting them, they will take the approach of shaming the abusers with a Troll Cap. Though it is doubtful that those who troll will really feel much shame, at least it serves an educational purpose of teaching others what is considered trolling behavior.

This is definitely an idea to put in Subtext at some point.

comments edit

Looks like Jeff Atwood is not content to let dead dogs lie when he revisits Edit and Continue.

Jeff argues that those decrying E&C are promoting a culture of machismo which implicitely states that “Everyone Should Code The Way We Do”.

As I stated in his comments, I think the real argument is not whether or not E&C is dangerous, but whether it should have a higher priority than other features introduced into VS.NET when the discussion first started.

I am not against E&C as I see it as a tool that can be used or abused like any other. When I was a VB programmer back in the day, I found it helpful at times while debugging a unit test. Rather than endure a compile and re-run unit test cycle that could take a couple minutes, I could simply fix a dumb typo in stride and continue on. I didn’t need it, but used responsibly, it saved me time in certain situations.

However, I wonder if there may have been other features that Microsoft could have focused on that would have been more worthwhile than E&C. When using test driven development practices, I find the need to use E&C greatly reduced. Unit tests provide a bigger bang for my development buck in writing better code. If I had a say in it, I would have suggested that Microsoft really focus on getting the test driven development story right, which they’ve completely failed at so far.

So again, for me it is not a question of whether E&C is useful, I believe it is, but whether it has pushed aside more useful features. What do you think?

comments edit

One common approach to having a script method run when a page loads is to attach a method to the window.onload event like so…

window.onload = function() { someCode; }

This is a common approach with methods for enhancing structural markup with Javascript like my table row rollover library, but it suffers from one major problem.

What happens when you include more than one script that does this? Only one of them will be attached to the onload event.

It would be nice if there was a syntax like the C# delegate syntax for attaching an event handler. For example…

window.onload += function() {} //This doesn’t work

However, there is a better way. In looking at the Lightbox script, I noticed the script references a method written about by Simon Willison. He has a method named addLoadEvent(func); that will append the method to the load event, without interfering with any existing methods set to execute on load.

Read about this technique here.

comments edit

Intro

I have a bit of “me” time today to write some code and I thought I’d treat myself to something light and fun by building something purely for its flashiness and aesthetic. Something that does’t have any useful purpose other than it looks good.

I am a big fan of adding effects to html pages by simply adding a reference to a separate javascript file. This keeps the javascript code separated from the HTML, which is a big help in avoiding “spaghetti script”.

This is a technique that Jon Galloway writes about in his post on Markup Based Javascript Effect Libraries which highlights several approaches for adding interesting behaviors to a page without using Flash or DHTML behaviors (which only work in IE anyways). By referencing a javascript file and adding certain semantic markup to html elements, an author can add very interesting effects to a page.

The Row Mouse Over Effect

The effect I will introduce is simple. Adding a javascript file and a couple CSS classes will allow you to add row highlighting to any table. It provides a mean to change the look and style of a row when you mouse over it, and then change it back when you mouse out.

All you need to do is to reference the tableEffects.js javascript file and add the “highlightTable” css class to a table. At that point, each row of the table will have its CSS class changed to “highlight” or “highlightAlt” when moused over. Its CSS class will be reset when the mouse leaves.

In order to actually see a change when you mouse over, you’ll have to style the rows for highlighting like so:

table.highlightTable tr.highlight td
{
    background: #fefeee;
}
table.highlightTable tr.highlightAlt td
{
    background: #fafae9;
}

The script assumes you want to use a different color for alternating rows. If not, you can simply style both highlight and highlightAlt the same.

See It In Action

col 1 col 2 col 3 col 4
Apple Orange Banana Kiwi
Pinto Porsche Peugot Acura
LAX SFO ANC NYC
No Body Look Here
Red Blue Green Alpha

Get the file

Download the file from here (Right click and save as).

If you have any improvements (as I am sure there will be some), please let me know and I will keep my version updated. I named the script “tableEffects.js” because I hope to add more interesting effects.

And remember, though I tend to preach table-less design, there are semantic uses for tables. When using this script, it helps to make sure that your tables are semantically marked up. For example, if you don’t want your header row to highlight, use <th> tags instead of <tr>. The script ignores the table header tags.

comments edit

BeerSoccer
Ball There is something really satisfying about having a beer after soccer. Especially when you can sit down with a Newcastle at the computer and blog about it. I’ve heard many marathoners say that a beer after a long run is helpful for replenishing lost carbohydrates. Yeah, that’s the ticket. It’s a health drink!

This season has been going much better than last season so far. The team has really picked it up a notch. We started off with a four to zero thrashing of the other team in our first game. I had a goal in the first minute of the second half. Fastest goal off of a kickoff I’ve ever been a part of.

Our second game ended in a two to one victory. Unfortunately that was marred by a near brawl. One of their teammates known for causing trouble smacked one of ours in the head after the game was over. Their biggest guy smacked our smallest guy. Who happened to have a brother on our team as well.

Here is the thing with brothers. If you smack someone, his brother will be more upset than the guy receiving the smack. We had to really struggle to pull everybody apart and keep it from devolving into anarchy.

This week we have a bye so today we had a friendly against my Saturday group of pick-up players. It was a long two and a half hour ordeal and I pretty much ran myself ragged in the midfield. I transitioned to striker just to take a break in the last half hour, when we were down a couple players. Unfortunately all that running left me with a slightly pulled quadricep. Now I can limp around the house and try to muster up some sympathy. And another beer.

comments edit

Screen Showing Code The great thing about being involved in a couple of open source projects is that they provide great opportunities to learn and to teach, especially through the vehicle of code reviews.

To enable this within the Subtext Project, I recently set up commit emails within the CVS repository. This makes it possible for more people to review changes to the code. However, this brings up a bit of a quandary. How should we go about conducting the reviews? We don’t have any policy in place.

Ideally I would love to have regularly scheduled code reviews in which a small group of developers gather around the screen and review the code at the same time. But as several of our team are in Europe, that is just not feasible. At least not so soon after the code is checked in. I think it would be helpful to have more immediate feedback.

There are two ways to handle this that I will put forth in the hopes of soliciting feedback.

Make Suggestions In Comments

One approach proposed by Steve Harman is an approach he uses at work. When reviewing code and finding something that might need to be changed, the reviewer puts a comment like so:

//REVIEW: haacked - Ummm... Hey, this violates an FxCop rule. Perhaps you should do FOO instead.{.example}

What I like about this approach is that it is deferential. You can shoot off an email to the person who wrote the code and say something along the lines of …

Hey, the code you checked in looks good. However, I noticed a few things you might want to look at. I put the appropriate comments in the code.

This approach allows the original author the chance to learn from the reviewer comments as well as to defend or elaborate upon the code if he or she feels that the code is indeed correct. Should the original author not have time to change it, the reviewer can return to change it.

Change the Code and Notify

One drawback to the previous approach is that it takes two people to fix code. One thing you’ll find when participating in an open source project is that people are REALLY BUSY. Sometimes a contributor will contribute a piece of code, and then get slammed at work and home, only to return in three months time to contribute again. That’s a long time to wait for code to get corrected.

An alternate approach is one borrowed from certain agile methodologies. Practices such as Extreme Programming promote the concept of “Collective Ownership”. This is an important principle to apply to open source projects, as the code belongs to everyone. Likewise, everyone should feel free to contribute to any piece of code in a project, assuming they use good judgement and understand the code.

In this approach, one would just fix the code and in the source control checkin comments, explain why the change was made. Additionally the reviewer could send the author a quick email mentioning that he made some changes and to keep an eye out on the commit emails.

The benefit of this approach is that the code gets improved immediately, while still preserving the learning opportunity for the original author. This approach also addresses the fact that any code you change in codebase most like at one point or another was written by someone else. Sometimes a reviewer might be looking at code long after it was committed. The reasonable expectation here is that the reviewer should feel free to modify the code, rather than spending time figuring out who wrote it and making the review comments.

Something In Between?

Perhaps there is an even better option that sits somewhere between these two options. What do you think? I would love to hear from you in my comments.

comments edit

I love this post by Steve Yi (found via Raymond Chen) concerning the mysterious things he as eaten. It just goes to show you that us asian (and half-asian) brothers can eat some seriously weird crap.

I have never tried Sea Cucumber (that I know of) nor Kudu Doo-Doo, but I have had everything else on his list. Here is my own list of mysterious things I have eaten.

1. Fermented Soy Bean (aka Natto)

My wife introduced me to this foul smelling Japanese dish. At first I wondered why she was eating the garbage when I first took a whiff, but I realized that others have said the same thing to me when I would bring Kimchee to school back in the day.

So I told myself I would try and acquire the taste since I was curious why she liked it so much. It has worked, as I now love it.

Image of Natto\ photo copyrighted by Matt Wegener.

2. Raw Chicken

For this dish, I have my wife’s brother to thank. Again this is a gift from the Japanese. Apparently there are several places known for serving raw chicken. I suppose if I was to take the risk of eating raw chicken anywhere, it would be Japan. They are well known for their cleanliness and care in crafting food.

It tasted a lot like tuna sashimi (maguro) and was quiet delicious.

3. Blowfish (Fugu)

I guess Japanese food in general is mysterious to me. I wrote about this experience here.

4. Uni (Raw Sea Urchin)

The first time I had this I nearly gagged. But I have since learned that the first one I tried was not of the highest quality. When a master sushi chef prepares Uni, it is smooth like butter.

Uni (raw sea urchin) \ via Matt Wegener

5. Chicken Feet

This one is often served at a Dim Sum restaurant. My Chinese friends might not find this so mysterious, but I sure do. I am not a big fan, and I’ve given it a couple of chances.

I am sure my wife will remind me of even more mysterious things I have eaten. What are yours?

comments edit

As a kid, one of my favorite tools I had was a shiny red cased Victorinox swiss army knife. I’d carry that sucker around with me everywhere, using the main blade to tackle nearly every problem like a caveman with a stick. Until one day I sliced my finger trying to stick a paper cup to a tree so we could throw ninja stars at it, but that’s a story for another time.

As software developers, we have a swiss army knife of approaches to tackling any given problem. And often, we like to pull out the same blade over and over again. For example, one tool that we pull out nearly all the time is the tool of “iterative” development.

As Atwood said in the comments to Micah’s post on harmful requirements, you gotta go “iterative”.

However, sometimes you really do need to pull out a different tool in your swiss army knife. For large projects, breaking it up into phases and iterations makes sense most of the time, but there are times where an iteration itself may be longer than other iterations. Sometimes such an iteration itself becomes a mini project that requires BDUF.

Here’s a scenario to chew on. Suppose an iteration of the project is to produce a report based on data imported from a couple external sources. The report only has to produce a single number based on a calculation applied to the data. This is the type of problem that may not lend itself well to iteration. The client is interested in the final number, not any number in between.

Sure you can have an iteration in which you mock up the report to show the client to get something in front of them, but even this can be dangerous because you’ve set the expectation that you can deliver the report. But do you know that until you’ve analyzed the data?

This is a situation we found ourselves in. The requirements appeared to be describing a specific calculation we needed to produce. But after a careful look at all the fields we were getting in, the data required to produce that report just isn’t there. And we won’t be getting that data. Yet we have to produce this report by Monday. It seems we’ve walked to the blackboard to solve a series of two equations, but each equation has three variables. “Does Not Compute”

It seems to me that this is a classic situation where some up front analysis would have saved our butt and set expectations properly. Unfortunately, we weren’t brought in to this project till later and had to take it on faith that the analysis had occurred, but it was lacking. Someone, anyone, should have looked at the columns of data we would be receiving, and reconciled the data with the calculation we would be producing. I’m not sure how we can iterate ourselves out of that problem.

In our situation, it may well be that the real calculation we need to produce is much simpler and less useful than the one we thought we were going to produce. So we may be out of the fire on this one. But should the stakeholder disagree, we’ve got issues.