Wednesday, December 31, 2003


Roland Weigelt says:

There are many exciting .NET topics waiting for us in 2004. Simply too much stuff to be tried and understood, too much knowledge to be gained. If you're making plans for 2004, here's one single thing I can fully recommend:

If you're not already doing it, start writing unit tests using a test framework.

Unit testing is one of these "I really should be doing this" concepts. Even though I read and heard about unit testing years ago, I only started doing it in 2003. Sure, I always had some kind of test applications for e.g. a library - who hasn't written one of those infamous programs consisting of a form and dozens of buttons ("button1", "button2", ...), each starting some test code. And it's not as if my software was of poor quality. But looking back, unit testing was the thing in 2003 that made me a better developer.

I'm using NUnit for my unit tests; it's so easy to use that a typical reaction of developers being introduced to NUnit is "What? That's all I have to do?". To get started, visit this page on the NUnit website, and follow the steps in the first paragraph "Getting Started with NUnit".

When I began writing unit tests in early 2003, I wrote tests for existing code. If this code (e.g. a library) is already successfully in use, this can be pretty frustrating, because the most basic tests are all likely to succeed. My first tests where pretty coarse, testing too much at once - maybe because the trivial tests (e.g. create a class instance, set a property and test whether reading it has the expected result) seemed like a waste of time.

In the course of time I moved more towards "test driven development", i.e. writing tests along with the code, often even before the implementation is ready. Now, if I create a new project, I always add a test project to the solution. This way my code and the corresponding tests never run out of sync. If I make a breaking change, the solution won't compile - it's that easy.

If you take this approach (writing test very early), even testing the most basic stuff can be pretty rewarding:

  • Sometime typos or copy/paste mistakes are not caught by the compiler (e.g. when the property getter accesses a different member variable than the property setter) - one bug like this found by a unit test written in 5 Minutes can save you hours of debugging through a complete application.
  • It's a very good test for the usability e.g. of your API. If it turns out that even a simple task requires many lines of code, you definitely should re-design your API (which is less of a problem at that early stage of development).
  • The unit tests is some sort of documentation of how your code is used - don't underestimate how helpful this can be (by the way: I wrote a simple tool for generating examples for online documentation from unit tests).
  • Last but not least: I know that some of the unit-testing folks don't like debuggers, but fine-grained unit tests are very good entry points for single stepping through your code.

So... what about a New Year's Resolution to start writing unit tests?

[Weblogs @ ASP.NET]
1:12:48 PM    trackback []     Articulate [] 

Source: Jan Tielens' Bloggings

Announcing the ExtendedDataGrid: Adding essential functionality to the default Windows.Forms.DataGrid..

The default System.Windows.Forms.DataGrid provided by the .NET Framework is a little bit limited in functionality. Therefore I've spent some time during my holidays building an extension to this default grid: the ExtendedDataGrid. At this point I've released a Beta version: 0.1 including these features:

  • Image DataColumn
  • Formatted Text DataColumn
  • LinkLabel DataColumn
  • Calculated field DataColumn
  • ...

New features and probably bug fixes will come soon so if you have any comments, questions, remarks, ... please let me know. If you are intrested in the ExtendedDataGrid, you can monitor this RSS Feed of the latest news. I know all these features are available as sample, code snippet, article, ... on the web, but I just hated to implement some of them all of the time, for each project. Also, if you are planning to use this component, or if you are just intrested: let me know, your support will motivate me to make further improvements. :-)

Btw, happy new year to all of you!

[Jan Tielens' Bloggings]
1:01:04 PM    trackback []     Articulate [] 

Source: How to Save the World

OUR STORY.

birdIt's funny how things come together sometimes. Monday, after posting my advice column on blogging time-savers, and saying the most important thing is to get away from your computer and your reading and get out into the real world and give yourself time to think creatively about what really matters to you personally, I followed my own advice. Chelsea and I went for a long walk. And soon my head was filled with rage about all the things wrong with this world and the ten things that still keep me awake at night. And I wanted to know why they go on, ignored, uncorrected. Things happen the way they do for a good reason, I've always said. You need to understand why all this stuff has happened and continues to happen. Find the root cause, not the symptoms.

People love to read editorials and blogs that rant cleverly, emotionally and articulately, and blame other people for what's wrong. Pointing the finger at others exonerates us, takes the heat off, makes us feel better about ourselves. What's the root cause, and who's to blame?

And then I came back in and read some more of The Truth About Stories, the book I blogged about on Sunday so enthusiastically. And at the end of the book I found my story, perhaps our story, and all the rage I had focused outside was refocused inward, because this story is, at its root, a story of personal failure, cowardice and fear.

Here is what I read:

The truth about stories is that that's all we are. The Nigerian story-teller Ben Okri says that "in a fractured age, when cynicism is god, here is a possible heresy: we live by stories, we also live in them. One way or another we are living the stories that are planted in us early or along the way, or we are also living the stories we planted -- knowingly or unknowingly -- in ourselves. We live stories that either give our lives meaning or negate it with meaninglessness. If we change the stories we live by, quite possibly we change our lives."...

In North America, we talk about our environmental [and business] ethic. [We get outraged about incidents like the Exxon Valdez spill and the Enron fraud and demand action]. To listen to the noise generated by these two events, you would have thought that we cared. But in fact, we don't. Not in any ethical way. Oil tankers are supposed to be safe. Financial institutions are supposed to be bastions of integrity. But we do nothing to prevent such disasters from happening again. And when they do, and they surely will, our reaction will be the same, because the story we tell about moments like this is that they shouldn't have happened, that they're someone else's fault,...that there's no way to avoid them completely, that the environment and investor confidence will recover eventually...

The Canadian government closed down the East Coast cod fishery. The cod were already gone, had been going for years, and everyone knew it. The reason was simple. Overfishing. The fishers blamed the government. The government blamed the fishers, everyone blamed the large foreign offshore trawlers, seals, global warming, El Nino, Native people... Could such a thing have been prevented? Of course. So why didn't we prevent it?

The oil industry and our oil-based economy depend for their existence on the ability of geologists to find new fields of oil and our willingness to ignore the obvious, that at some point we're going to run out of oil. This would suggest that reducing energy consumption, curbing the proliferation of cars and multilane highways, and converting to sustainable sources of energy would be our first priorities. But we have no such priorities. We only hope that the exhaustion of the oil supply won't happen in our lifetime.

It's not that we don't care about ethical behaviour, the environment, society. It's just that we care more about our comfort and the things that make us comfortable -- property, prestige, power, appearance, security. And the things that insulate us from the vicissitudes of life. Money, for instance...

The proof of what we truly believe lies in what we do and not what we say. We've created the stories that allow [the ethics of what we do and don't do] to exist and flourish. They didn't come out of nowhere, from another planet. Want a different ethic? Tell a different story...

I weep for the world I've helped to create. A world in which I allow my intelligence and goodwill to be constantly subverted by my pursuit of comfort and pleasure. And because of knowing all of this, it is doubtful that given a second chance to make amends for my despicable behaviour, I would do anything different, for I find it easier to tell myself the story of my failure as a human being, than to have to live the story of making the sustained effort to help.

Our stories are lies. We know they are, but we keep telling them to ourselves and to each other. We keep living them and living in them. Thomas King acknowledges that this, The Truth about Stories, is in itself not a very satisfying story. "No plot. No neat ending. No clever turns of phrase." (The remaining stories in this book have all three, and are remarkable).

We don't want to hear the other stories out there in the real world -- the stories of what goes on inside the walls of abusive homes, factory farms, prisons, workplaces, schools, laboratories and institutions, and which are overtly played out in inner city streets and throw-away third world countries, the endless litany of violence, physical and psychological, personal and institutional, that occurs millions of times per minute throughout our world. These other stories detract from our 'comfort and pleasure'. They threaten to crack open the lies in our own story. That we cannot bear.

So the 'root cause' I was seeking during my walk with Chelsea is the subversion of our culture, this modern culture of negativism, acquisition, paternalism and scarcity whose ubiquitous, tyrannical story leaves everything in the hands of fate, or god, and absolves us of our responsibility and our sins, and fills us with the constant and consuming terror of not having enough. And we know who's to blame: The Man in the Mirror (that song was written, ironically, by a woman).

Our story is unfinished. We could change the ending if we want. Create a better ending. It's all up to us.

[My novel-in-progress will be an attempt to create a new ending, and perhaps a completely new story. I still hope to have it finished by the end of June.]
[How to Save the World]
12:20:21 PM    trackback []     Articulate [] 

  Tuesday, December 30, 2003


Source: 347.com || Andy's World

FastCompany Sidebar: 12 Questions That Matter

This magazine continues to push awesome content. Read this excerpt, but then go read the entire article. - Andy

If you want to build the most powerful company possible, then your first job is to help every person generate compelling answers to 12 simple questions about the day-to-day realities of his or her job. These are the factors, argue Marcus Buckingham and his colleagues at the Gallup Organization, that determine whether people are engaged, not engaged, or actively disengaged at work.

1. Do I know what is expected of me at work?
2. Do I have the materials and equipment that I need in order to do my work right?
3. At work, do I have the opportunity to do what I do best every day?
4. In the past seven days, have I received recognition or praise for doing good work?
5. Does my supervisor, or someone at work, seem to care about me as a person?
6. Is there someone at work who encourages my development?
7. At work, do my opinions seem to count?
8. Does the mission or purpose of my company make me feel that my job is important?
9. Are my coworkers committed to doing quality work?
10. Do I have a best friend at work?
11. In the past six months, has someone at work talked to me about my progress?
12. This past year, have I had opportunities at work to learn and grow?

(c) 1992-1999, The Gallup Organization, Princeton, NJ. All rights reserved.

 


 [347.com || Andy's World]


7:22:51 PM    trackback []     Articulate [] 

  Saturday, December 27, 2003


Source: Ming the Mechanic

The Real World. While looking for something else I incidentally ran into this little thing in somebody's webzine from '96. A vision I apparently wrote, although I can't remember exactly where.

"I envision a time when most people have stopped having problems they don't need to have, and where they spend most of their time dealing with what is actually going on in their lives, what is right in front of them, what needs to be done. That is, people will stop acting and reacting based on a picture of reality they see on TV, or which comes out of their fears and biases and misunderstandings, and they will start taking action in more useful ways.

We live on a planet that is bountiful with resources, if we just use them in harmony with the cycles of nature. We have reached a stage of civilization where most people can live in peace. We have the technological means of having all of us live in comfort.

Most of what would be in the way of allowing the world to work for all of humanity is mental problems. It is when millions of people feel a need to be fearful and insecure when just a few people's dramatic misfortune is broadcast on TV. It is when many people believe that economics or politics dictate that some people HAVE to be hungry or without work, and the rest have to work themselves to threads in meaningless occupations. It is when people feel they are justified in harming others because they are different from themselves. It is when people think that life is about acting like most other people around them. It is when people believe that pessimism and cynicism about the future is the logical outcome from studying the past.

None of this has much to do with the real world. Stress and fear and pessimism and bigotry only rarely have proper relevance to the situation one is in. They are mental and emotional responses to the situation one THINKS one is in. Being fearful because of the news on TV, or stressed because of artificially created pressures from jobs with little relevance to creating lives of quality, bigotry because of false information, pessimism because of authorities who seem to imply there are no good answers to anything - all of those are induced based on overwhelming, but largely misleading, information from the outside.

This might sound overly harsh, or broad, or condemning. Really, I have great faith in the ability of humanity to heal itself and deal with its situation. Each human has tremendous capacity for setting things right, and I believe we WILL set things right. But I think it will happen through dealing with the real world and its possibilities, by looking at what resources we have at our proposal, what skills we have, what solutions and schemes and technologies we have that will make things work for us.

I envision that a critical mass will develop of humans who are able to see and think and feel for themselves. People who will make out the truth for themselves, people who aren't easily fooled by double-talk and mis information, people who will take action on the conditions they find themselves in, people who will work for the greater good in the most effective ways they know of. These people will be found all over the planet, in all professions, in all organizations, in all cultural and ethnic and religious groups, and they will network freely with each other across all boundaries." [Ming the Mechanic]


10:28:11 AM    trackback []     Articulate [] 

  Friday, December 26, 2003


Source: The Scobleizer Weblog

At the end of every year, it's good to think of a new BHAG -- for a Big Hairy Audacious Goal.

What's your BHAG?

[The Scobleizer Weblog]

8:01:20 PM    trackback []     Articulate [] 

  Thursday, December 25, 2003


Awesome Post !!!
Source: Scott Rosenberg's Links & Comment

Yearend fugue
Blogging from me will be light over the holidays. Any spare time I get over the next week will be devoted, weather allowing, to building my kids a swing set in the backyard. But before the eggnog haze descends upon us, a few choice links.

First, Mother Jones has an interview with Tony Kushner in which the "Angels in America" playwright states, with crystalline precision, the essential fact of the 2004 election. This should be etched into the consciousness of everyone who hopes that things in the U.S. can be put back on course:

  Anyone that the Democrats run against Bush, even the appalling Joe Lieberman, should be a candidate around whom every progressive person in the United States who cares about the country's future and the future of the world rallies. Money should be thrown at that candidate. And if Ralph Nader runs -- if the Green Party makes the terrible mistake of running a presidential candidate -- don't give him your vote. Listen, here's the thing about politics: It's not an expression of your moral purity and your ethics and your probity and your fond dreams of some utopian future. Progressive people constantly fail to get this.

The GOP has developed a genius for falling into lockstep. They didn't have it with Nixon, but they have it now. They line up behind their candidate, grit their teeth, and help him win, no matter who he is.

MJ: You're saying progressives are undone by their own idealism?

TK: The system isn't about ideals. The country doesn't elect great leaders. It elects fucked-up people who for reasons of ego want to run the world. Then the citizenry makes them become great.

One light of hope this year is that the citizenry has important and still-underestimated tools at its disposal to egg its leaders on to greatness. If you're keeping up with the blogosphere you may be sick to death by now of reading about the power of many-to-many decentralization, "social software" and the Dean campaign's remarkable online successes. But what if you're stuck inside the Beltway? Frank Rich's Sunday column this week serves as a useful reminder that most of the Washington press corps remains utterly and pathetically clueless about what has already happened during this election cycle. Jay Rosen's annotation of Rich's column is well worth reading, too.

So we're fortunate to live at a moment when the technologies many of us have enthusiastically embraced for two decades are showing signs of achieving social and political ends beyond simply bringing delight to geekdom or fueling the stock market. Cory Doctorow has good words here:

  The last twenty years were about technology. The next twenty years are about policy. It's about realizing that all the really hard problems -- free expression, copyright, due process, social networking -- may have technical dimensions, but they aren't technical problems. The next twenty years are about using our technology to affirm, deny and rewrite our social contracts: all the grandiose visions of e-democracy, universal access to human knowledge and (God help us all) the Semantic Web, are dependent on changes in the law, in the policy, in the sticky, non-quantifiable elements of the world. We can't solve them with technology: the best we can hope for is to use technology to enable the human interaction that will solve them.

(And Kevin Werbach points out that technology and policy are always intertwined.)

Finally, as many of us retreat from the daily grind to take year-end stock, I want to offer you this wonderful passage that Kevin Kelly cited earlier this month on his Cool Tools blog. It's from a book titled "Art & Fear: Observations on the Perils (and Rewards) of Artmaking," by David Bayles and Ted Orland, that I will have to add to my 2004 reading list.

  The ceramics teacher announced on opening day that he was dividing the class into two groups. All those on the left side of the studio, he said, would be graded solely on the quantity of work they produced, all those on the right solely on its quality. His procedure was simple: on the final day of class he would bring in his bathroom scales and weigh the work of the quantity group: fifty pound of pots rated an A, forty pounds a B, and so on. Those being graded on quality, however, needed to produce only one pot -- albeit a perfect one -- to get an A. Well, came grading time and a curious fact emerged: the works of highest quality were all produced by the group being graded for quantity. It seems that while the quantity group was busily churning out piles of work -- and learning from their mistakes -- the quality group had sat theorizing about perfection, and in the end had little more to show for their efforts than grandiose theories and a pile of dead clay.

Which, I suppose, is an anecdotal version of the Nike slogan, "Just do it." But I prefer the Samuel Johnson version: "Nothing will ever be attempted, if all possible objections must be first overcome."

Thanks to Salon's subscribers for keeping us going through these thin years -- and special thanks to all the Salon bloggers for keeping their "quantity" and "quality" fires stoked. Happy holidays to all. [Scott Rosenberg's Links & Comment]


9:28:47 AM    trackback []     Articulate [] 

  Wednesday, December 24, 2003


Source: WebLogs @ DotNetJunkies.com

Okay, it's time to take the wraps off. Kathleen Dollard, simply the smartest person I know, has finished her Code Generation in Microsoft .NET book for APress.

I guarantee that this will be the hardest book you read in 2004, but also that it will be the single most important book for making you as productive as you can be as a .NET or SQL Server programmer.

You know all that boring, repetitive code you write for a typical application? Do away with it and generate it automatically, letting you focus on all the custom, interesting, fun, and ground-breaking code that goes into every application.

Disclaimer: I am the book's tech editor and was Kathleen's go-to guru for XSLT. So I'm intimately familiar with everything the book talks about--particularly as chief guinea pig, since I was the first person to do a real application using her templates and techniques--and I can heartily recommend it. Even if you use a framework or other development technologies, you'll learn a lot from her explorations of codegen in .NET.

My #1 book recommendation for 2004, even though it hasn't started yet!

[WebLogs @ DotNetJunkies.com]
6:50:14 PM    trackback []     Articulate [] 

Source: Frans Bouma's blog

Signing your assembly, newbie guide.

Follow these easy steps. The first 4 steps you only have to do ONCE in your life. Step 5-7 you only have to do ONCE per project.

  1. Open a command prompt
  2. Type vsvars32.bat (enter) or navigate to the .NET bin dir
  3. Type: sn -k mykey.key (enter)
  4. Move mykey.key to a folder where it gets backupped daily, for example: c:myfileskeys
  5. Open your code's solution in Visual Studio.NET
  6. Open the AssemblyInfo class in the editor
  7. For the attribute AssemblyKeyFile(), specify instead of the default "", the full path of your key, in our example this is "c:\myfiles\keys\mykey.key", so the attribute in full will be:
    C#: [assembly: AssemblyKeyFile("c:\\myfiles\\keys\\mykey.key")]
    VB.NET: <Assembly: AssemblyKeyFile("c:\myfiles\keys\mykey.key")>
  8. Compile your solution. After compilation, your assembly is signed with your strong key.
  9. To congratulate yourself with this big achievement, walk to the fridge and pop open a fresh Heineken.

*Pfew* I have to lay down now to take some rest after this long, thorough lecture. Sorry people, but you don't need a plugin which requires registration to do this easy stuff. If you can program software, you can sign your assembly. If not, what are you doing near that keyboard? ;)

The signed assembly can be freely distributed to your clients/customers. They can reference it in their .NET projects without having to worry about public keys, public tokens or other hard to understand material. The world is already very complex, let's not make the easy stuff look like it's very complex also.

Update: Thanks to 'Prima Donna' Robert Mclaws for pointing to a typo in the title.

Kereltje, zodra jij zo goed Nederlands lult als ik Engels, heb je recht van spreken.

[Frans Bouma's blog]
2:39:22 PM    trackback []     Articulate [] 

  Tuesday, December 23, 2003


Source: Keith's Weblog

Michael Chrichton to the Commonwealth Club in San Francisco:

I studied anthropology in college, and one of the things I learned was that certain human social structures always reappear. They can't be eliminated from society. One of those structures is religion. Today it is said we live in a secular society in which many people --- the best people, the most enlightened people --- do not believe in any religion. But I think that you cannot eliminate religion from the psyche of mankind. If you suppress it in one form, it merely re-emerges in another form. You can not believe in God, but you still have to believe in something that gives meaning to your life, and shapes your sense of the world. Such a belief is religious.

Today, one of the most powerful religions in the Western World is environmentalism. Environmentalism seems to be the religion of choice for urban atheists. Why do I say it's a religion? Well, just look at the beliefs. If you look carefully, you see that environmentalism is in fact a perfect 21st century remapping of traditional Judeo-Christian beliefs and myths.

There's an initial Eden, a paradise, a state of grace and unity with nature, there's a fall from grace into a state of pollution as a result of eating from the tree of knowledge, and as a result of our actions there is a judgment day coming for us all. We are all energy sinners, doomed to die, unless we seek salvation, which is now called sustainability. Sustainability is salvation in the church of the environment. Just as organic food is its communion, that pesticide-free wafer that the right people with the right beliefs, imbibe.

Eden, the fall of man, the loss of grace, the coming doomsday---these are deeply held mythic structures. They are profoundly conservative beliefs. They may even be hard-wired in the brain, for all I know. ... the reason I don't want to talk anybody out of these beliefs is that I know that I can't talk anybody out of them. These are not facts that can be argued. These are issues of faith.

And so it is, sadly, with environmentalism. Increasingly it seems facts aren't necessary, because the tenets of environmentalism are all about belief.

I could make a similar point about secular humanism and evolutionism. Well, I suppose I have in the past.

(via del.icio.us / pvg)

I'm trying to remember a quote I heard about man being inherently religious. I thought it was by Francis Schaeffer (it's possible I was thinking of something by C.S. Lewis as well), but I found this from Edmund Burke: "Man is by his constitution a religious animal...atheism is against, not only our reason, but our instincts". I'm not sure whether I think this contradicts Burke, or supports him, but I'd say that man is so religious that he makes even atheism into a religion.

[Keith's Weblog]
5:32:30 PM    trackback []     Articulate []