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.

comments edit

Last month, I wrote about some frustrations I had with Microsoft Money. I am pleased to report that everything has been resolved and I want to take the time to thank members of the Microsoft Money team.

It turns out that the Microsoft Money group is more accessible than I thought. It is unfortunate that the Microsoft website doesn’t highlight this more, but there is an active community that participates in the microsoft.public.money newsgroup. One customer also maintains a FAQ.

It turned out that the password character length in Microsoft’s records varied with those given by the bank a while ago. Russ on the Money team was able to confirm this and a patch was out in a matter of days. The final trick to getting it to work was I needed to refresh the online service setup. I was given the following instructions.

  1. Open Money.
  2. Select Account List.
  3. Select the financial institution you want to re-brand in the Account List.
  4. Under Common Tasks click Connect to bank and click the institution’s services link.
  5. Select For Financial Institution Name under View contact information.
  6. Select Update advanced Web settings on the left navigation bar.
  7. Hold down ctrl + shift and then click Restore Defaults.
  8. Click OK and then click Done.
  9. Select the New online services are now available link.
  10. Select the Update Services link to the left of your financial institution name.
  11. Continue through the rest of the Update Services screens.

So now Money is happily integrated with my online broker. Money rules!

P.S. I probably shouldn’t have made that crack about switching back to Quicken. Word on the street (and in my comments) is that Intuit engages in some underhanded practices with their software and that Money is much better than Quicken. I can’t corroborate the underhanded practices, but I did switch to Money from Quicken many years ago and haven’t regretted it.

comments edit

Basement Gamers Video
Screenshot Make some time for this one. This is an eleven minute mockumentary of two hardcore fantasy role playing gamers. If you’ve ever rolled the icosahedron^1^ dice (or live with someone who has), you’ll find this extremely funny, and perhaps painful.

I swear I was never this bad. Really.

Watch it if you dare.

[Via The Old New Thing]

^1^ icosahedron is 20-sided.

comments edit

Micah delves into the dark side of requirement documents. I am glad he is taking on writing about some of the challenges we’ve faced in starting a new company. I’ve been planning to write about many of these challenges as well, but I wanted to give myself more time. Perhaps I was a bit too shell-shocked by all the difficulties to give it a proper treatment. Perhaps I was afraid I would violate the one blogging rule we have, don’t be stupid.

Fortunately, Micah has the bravery to delve into the deep dark dirty recesses of real world project management. Read it at your own risk and hold tight to your sanity.

comments edit

A while ago I told you that I was starting a company with my business partner, Micah. Well the good news is that we’ve officially added another partner/employee, the indefatigable Jon Galloway.

In the link to Micah breaking the news, he says he is really glad our clients don’t pay us to look pretty or we’d be broke. He can speak for himself, because if he read the fine print on the contract I’m working on, being pretty is indeed one of the requirements.

comments edit

This article in Boing Boing about how World of Warcraft (WoW) moderators are warning groups not to adverties their guilds as “GBLT-friendly” (Gay, Bi-sexual, Lesbian, Transgender friendly) got me thinking.

Suppose they allow characters in WoW to publicly declare their sexuality within the game. Now suppose other groups within the game form with the goal of attacking such players completely within the online game (assuming the game allows players to attack other players).

Would that constitute a hate crime?

sql comments edit

My friend Jeremy (no blog) pointed me to these two useful articles on how to perform dynamic WHERE clauses and ORDER BY clauses without using dynamic SQL. These were written long ago, but I had never thought to use COALESCE in this way. Very cool!

I will post them here so I can find them later.

UPDATE: This technique may not be as performant as hoped for. Marty in the comments noted that he saw table scans in using COALESCE in this way. Jeremy showed me an example that demonstrated that the execution plan changed from an index seek to an index scan when using COALESCE. As always, test, test, test before rolling this out.

open source comments edit

This is part 3 in this series on copyright law and open source licensing. If you haven’t already, consider reading Part 1 and Part 2 of this series for background before tackling this topic.

To properly license open source source code, the license agreement must be included prominently with the source code. Many simply put a license.txt file in the root of the source tree and publish the license on their project website. Others take the extra step to include the license text in a comment within every source file.

Take a look at the license for DotNetNuke (DNN), a very popular open source portal software for the .NET platform. In particular note the very first section:

DotNetNuke® - http://www.dotnetnuke.com
Copyright (c) 2002-2005
by Perpetual Motion Interactive Systems Inc. 
( http://www.perpetualmotion.ca )

Notice that Perpetual Motion Interactive Systems Inc. owns the copywrite to the DotNetNuke codebase. “How can that be? How can a corporation own the copyright to code that is open source?” you might ask. Don’t worry, there is nothing sinister going on here.

In part 1 of this series I stated that when you write code, you own the copyright to it (with a couple of exceptions such as work for hire). By default, when you contribute source code to an open source project, you are agreeing to license the code under the terms of that project, but you still retain the copyright.

In some cases, this is fine. But it makes it difficult for the project should they decide they want to relicense or dual-license the project as they have to get permission from every copyright holder. Or if there is need to enforce the copyright, the project would need every affected copyright holder to be involved.

What many projects do is require that contributors assign copyright to a single legal entity or person which then has the power to enforce the copyright without requiring everybody get involved. Keep in mind that although this person or entity then owns the copyright, the code has been released under a license that allows free distribution. Thus the fact that the copyright has been assigned to an individual entity does not make the code any less open.

For example, suppose Perpetual Motion decides they want to exercise their copyright and make a proprietary version of DotNetNuke. They certainly have the right to do so, but they cannot stop others from freely viewing and distributing the code under the pre-existing license up to the point at which they close the source. At that point, contributors would be free to fork the project and continue development under the original license as if nothing had occurred.

According to a lawyer Fogel talked with…

For most, simply getting an informal statement from a contributor on the public list is enough—something to the effect of “I hereby assign copyright in this code to the project, to be licensed under the same terms as the rest of the code.”

Is sufficient. Some organizations such as the Free Software Foundation, on the other hand, apply a very formal process requiring users to sign and mail in paperwork.

In any case, some open source projects do not have such a copyright assignment policy in place, but it makes sense to do so. As Fogel points out, should the terms of the copyright need to be defended, it is much easier for a single entity to do so rather than relying on the cooperation of the entire group of contributors, who may or may not be available.

Having the copyright assigned to a corporation also protects individual developers from exposure to liability in the case of a copyright infringement suit.

Public Domain

This section added in 2013/07/17

Another possibility that I did not originally cover is to have nobody own the copyright by dedicating a work to the public domain. This effectively surrenders any rights to the code and gives the code to the public to do with it as they wish.

In some regards, dedicating a work to the public domain is unusual. Typically, works in the public domain have had their copyright expired or were inapplicable (such as government works). As Wikipedia points out:

Few if any legal systems have a process for reliably donating works to the public domain. They may even prohibit any attempt by copyright owners to surrender rights automatically conferred by law, particularly moral rights.

The Unlicense template is one approach to dedicating a work to the public domain while serving as a fallback “license” for legal systems that don’t recognize public domain. The CC0 license from Creative Commons is another such effort.

comments edit

If Visual Studio .NET 2003 completely crashes during one more debug session in the next hour (I need to be reasonable here), I am going to throw my freaking computer through the window (figuratively speaking).

Thanks for letting me vent.

open source comments edit

This is part 1 in a three-part series on copyright law and open source licensing. After this, continue onto Part 2 and Part 3 of the series.

Disclaimer

Book
Cover As is customary when a non-lawyer attempts to discuss the finer points of the law, I must start with a disclaimer. I know some fine lawyers, but I, sir, am not a lawyer. So please do not consider this to be legal advice. It is merely a rough primer on copyright law as it pertains to software based on my readings and conversations. If you need specific legal advice, talk to your own damn lawyer.

Intro

After finishing the Fogel book, “Producing Open Source Software”, I followed up by reading “Understanding Open Source and Free Software Licensing” by Andrew M. St. Laurent.

This book combined with previous readings serves as the inspiration and source for this series. I will focus on the issues pertinent to software developers who wish to get involved in open source development. For a more complete treatment of the topics, I recommend reading the books mentioned.

In this first post in this series, I will discuss the basics of copyright law. This will set the stage for part 2 in which I will discuss software licensing.

In countries that support the Berne Convention, as soon as you set pen to paper, brush to canvas, or fingers to that dirty keyboard, the work you create is automatically afforded protection by copyright law. This assumes that your creation is not itself infringing on another’s copyright such as plagiarism. Also, there must be a small degree of creativity in the work. For example, you cannot simply jot down and copyright names copied from a phone book. Additional copyright protection is available through registration with the copyright office, but registration is not required.

Note that copyright applies to a particular expression of an idea, not to the idea itself. You can copyright a specific drawing of a penguin, but your copyright does not apply to drawings of penguins in general. Trademarks and patents are used to provide legal protections for concepts, ideas, facts outside of the scope of copyright law, but that is a topic out of scope for this post.

So exactly what rights do you have to copyrighted works? Well the obvious right is the right to copy. A copyright gives the owner full and exclusive rights to control who may copy or create a derivative of a work and how that may be done. As a copyright owner, you may state that nobody is allowed to copy or make derivative versions of your work (though the doctrine of “fair use” allows some non-infringing uses such as quoting from the work in a book review). A copyright gives the owner exclusive rights to a work, but this protection does not last forever.

If someone were to infringe on your copyright, you have the right to sue for damages, but this requires that you prove a loss occurred due to the infringement, which can be difficult. You may receive additional copyright protection by registering the work with the copyright office. For example, you can get “statutory damages”, compensation fixed by law that does not require proving an actual loss.

Who Owns Your Code?

Therefore you own the copyright to every line of code you write. Well… sort of.

The code a developer writes while an employee or client fall under the doctrine of “work for hire” and therefore belong to the employer (or client). Some independent contractors will stipulate in their service agreement with the client that even though the client owns the copyright to the code, the client shall give the contractor a non-exclusive license to the code.

Next Time: Licensing

In the next post in this series, I will discuss licensing and get into the nitty gritty as it pertains to open source software. Many thanks to my friend Walter Impert for his legal editing.

open source comments edit

This is part 2 in my three-part series on copyright law and software licensing. Part 1 covered the basics of copyright law. With the background knowledge from that post, we are ready to tackle software licensing in more depth. After this, continue onto Part 3 of the series.

Licensing In General

A license is permission granted by a copyright holder to others to reproduce or distribute a work. It is a means to allow others to have some rights when it comes to using a work without assigning the copyright to others.

For example, although I own exclusive copyright to this very blog post, at the bottom of every page in my blog I provide a license to freely copy, distribute, display, and perform the work. I also allow making derivative works and commercial use of the work under a Creative Commons license. Gee what a nice guy I am! However I do stipulate one restriction. Anyone who wishes to exercise one of the listed rights within the license must attribute the work to me and make clear to others the license terms for the work. As the copyright holder, I am free to grant others these rights, but also to add restrictions as well.

Proprietary and Closed Source Licenses

Copyright law and licensing applies to software every bit as much as it does to writing. Most of the software that the average person uses day to day falls under a proprietary license. That is, the user is not free to distribute the software to others. This is often called “closed source” software, but that term may be slightly misleading as software can have its source code visible, but still not allow open distribution. Likewise, it is possible for closed-source software to allow others to freely distribute it as in the case of many free utilities.

Open Source and Free Software Licenses

This leads us finally to “Open Source Software” and “Free Software”. The two terms are often used interchangeably, but there is a slight distinction. The term “Free Software” tends to apply to software licensed in such a way that any code that makes use of the free software code must itself be freely available. The “free” in “Free Software” applies to the freedom to view the code.

Whereas “Open Source” is a more blanket term that merely applies to software in which the source code is visible and freely distributed. Open Source software does not necessarily require that its usage also be Open Source. Thus Free Software is Open Source, but Open Source is not necessarily Free Software.

Types of Open Source Licenses

When starting an open source project, the copyright owner is free to license the source code to others in any manner he or she sees fit. But the cost to draft a custom open source license is prohibitive. And to do so oneself is often a big mistake, especially given the fact that there are many well established licenses in existence that have stood the test of time.

Choosing A License

The Fogel book does a decent job of providing insight into how to choose a license, so I won’t delve into it too deeply.

GPL

Despite the plethora of licenses, in general the one you choose will be a result of your philosophical disposition towards open source software. If you fall under the free software camp and believe that all software should be free, then you may gravitate towards The GNU General Public License (GPL).

The GPL is designed to guarantee the user’s freedom to share and change the software licensed under its terms. When using GPL code, no additional restrictions may be applied to resulting product. In this way, the GPL is similar to the Borg. If you wish to use GPL code within your own project, then your own project must be licensed in a compatible manner with GPL. Thus GPL code tends to begat more GPL code. It is not permissible under the GPL to use GPL in proprietary software while keeping that software closed source.

MIT and BSD Licenses

For others with no philosophical objection to using open source software within proprietary software, the MIT license or the new BSD license may be more appropriate.

In essence, these licenses do not provide any restrictions on how the software may be copied, modified, or incorporated into other projects apart from attribution. Thus you can take code from a BSD licensed project and incorporate it into your proprietary software. You can even try to sell BSD licensed software as is (technically you can do this with GPL too), but this is as difficult as selling ice to Eskimos. Because you cannot restrict others from simply obtaining the source code, selling open source licensed software as is makes for a difficult proposition. You had better add a lot of value to be successful. Popular .NET projects such as Subtext, DasBlog, and RSS Bandit are all licensed under the BSD license.

UPDATE 2013/07/17: GitHub recently created a site to help folks unfamiliar with licensing make an informed choice. It’s called http://choosealicense.com/ and worth checking out.

Stay Tuned for Part 3.

comments edit

Well today completes my 31^st^ trip around the Sun and what a Birthday weekend it has been! Every now and then I like to buy a Super Lotto ticket just for the fun of it. I have a solid understanding of math (I did major in it) and I know that the odds are pretty much zilch, but it is fun to think about what I would do should I win.

Well I can stop thinking and start doing because I did win! I matched three number and the MEGA for the Jan 18 drawing winning me a grand total of $47.00! Woohoo! Forty-seven smackeroos! I definitely will NOT spend it all in one place (unless I fill up on gas). Since it is a jackpot under $600, I can simply walk over to the store where I bought it and claim my prize.

Apart from the Super Lotto, this weekend reminds me that I have won many other lotteries in life. Saturday we had some friends over for a birthday party at our place and it is quite clear that I have won the lottery of friends. My wife organized the whole thing and cooked up an amazing curry. I have definitely won the lottery of wives. And yesterday, in the opening game for my soccer league, I had an assist and I scored a pretty sweet goal in the first 60 seconds of the second half, winning the lottery of…er…that game four to nill. Ok the lottery analogy has fallen apart.

To you that find this post, I hope you win the important lotteries in your life as well.

comments edit

The key purpose of my last post was to demonstrate how the ASP.NET web controls follow the Decorator pattern when it comes to rendering and how developers can hook into that to customize the rendered HTML.

The example I demonstrated made a Button control render XHTML conformant markup. My article applies to ASP.NET 1.1. However, one commenter pointed out an even easier approach if you are working with ASP.NET 2.0. You can simply set the xhtmlConformance elment in Web.config. For example:

<xhtmlConformance mode="Transitional"/>

Well, I am sure you’ll find other uses for the decorator technique I wrote about.

open source comments edit

Every open source project has its own procedures for granting the all-important commit access to developers. Some require a set number of submitted patches (which Fogel, author of Producing Open Source Software, warns against). Others do not have any clear process and rely on the whims of those with the ability to add other committers. Whichever procedure your project chooses, it is important make sure make sure it is clearly published in a visible location such as in the developer guidelines.

Fogel discusses the methods by which the Subversion project grants commit access, emphasis mine.

In the Subversion project, we choose committers primarily on the Hippocratic Principle: first, do no harm. Our main criterion is not technical skill or even knowledge of the code, but merely that the committer show good judgement. Judgment can mean simply knowing what not to take on. A person might post only small patches, fixing fairly simple problems in the code; but if the patches apply cleanly, do not contain bugs, and are mostly in accord with the project’s log message and coding conventions, and there are enough patches to show a clear pattern, then an existing committer will usually propose that person for commit access. If at least three people say yes, and no one objects, then the offer is made. True, we might have no evidence that the person is able to solve complex problems in all areas of thecode baes, but that does not matter: the person has made it clear that he is capable of at lest judging his own abilities. Technical skills can be learned (and taught), but judgement, for the most part, cannot. Therefore, it is the the one thing you want to amke sure a person has before you give him commit access.

Obviously, one problem with this approach for very small projects is you might not even have three committers. This merely reinforces the fact that any policy should fit the size of the project and should be amended as the project grows. But its emphasis on judgement as opposed to technical skill is, in my opinion, a good one.

On any project, there will always be plenty of small tasks that do not require Linus Torvalds to get it done. Rather they can be handled by Joe Hobbyist and Jill N00b, as long as they exercise good judgement. And having someone focused on these smaller easy tasks helps the overall polish of the application, as the “serious” developers often do not spend their time on them.

Another benefit of this approach is that it does not rely on an artificial quota, but on recognition by other committers that someone exhibits good judgement. Ostensibly, if the other committers were chosen because of their good judgement, they can most likely be trusted to use good judgment when recommending and voting on other committers.

I recommend reading the book to delve into the actual procedures for handling the voting and making the offer.