Saturday, July 16, 2011

Structs in C#

Just read a very good discussion on structs in Professional C# 4.0 and .NET 4 (Wrox Programmer to Programmer).

Here are the main points:
  • structs are value types, so they get created and destroyed very fast.
  • They are well suited for grouping together a small number of value fields, such as a pair of ints for X,Y coordinates.
  • Because they are values, they do not need to be initialized with the new keyword.   
  • You cannot override the default constructor, nor initialize fields inside a struct, except in a non-default constructor.
  • If you create an instance of the new struct with new, the fields are initialized to their default values.  If you create the struct without new, you must manually initialized the fields before using them.
Poking around with this some more, I've noticed that creating a non-default constructor does not hide the default constructor, unlike classes.

Tuesday, April 19, 2011

Dreamcore Day 1 Musings

A very full first day at Dreamcore.  The day began with a keynote overview by CEO Michael Seifert on how OMS, content personalization, and CRM integration form a complete circle of customer engagement.   I was struck at how OMS is being woven into the Sitecore product.  For example, the page editor now provides a  interface for tagging content by marketing persona using a nifty feature called Persona Cards, and there is now a very intuitive automation designer that handles building personalization workflows.  Alexey Rusakov showed off more of what the page editor can do in 6.5, such as generating item clones and spinning off personalization rules.  Empower the content author!

Wednesday, February 2, 2011

Agile Estimation and Planning

I just finished Mike Cohn's Agile Estimating and Planning, a thorough and very readable treatment of how Agile works as a project planning methodology. Here are my takeaways:

Wednesday, January 19, 2011

Sitecore Hands-Off Deployment

Managing the Sitecore Web.config file across development, test and production environments can be a major headache for source control and deployment. Do you store the version you need for development in source control? And since this version differs from what's needed to run the production website, it's difficult to use the publish option to deploy changes to the website.

Fortunately, Visual Studio 2010 has added some very nice functionality for managing different flavors of Web.Config, through the Web.Config transform feature of the Web Deployment project. This feature allows you to specify, and check into source control, the specific changes you need to make to change a development Web.Config into a test or production version.

Steve Green has a useful post outlining this feature.

Friday, December 24, 2010

The AnkhSVN plug-in for Visual Studio

My department recently switched source control tools, moving from Microsoft's Visual Source Safe to Subversion.  We've been using the Windows Explorer-based Tortoise as a front-end, but we've been encountering difficulties with the lack of integration into Visual Studio.  For example, it's very easy to forgot to add new source files to the repository, often resulting in a broken build.

So I've started looking into VS plug-ins for SVN, and have been impressed with the open-source AnkhSVN.  It has a very attractive integration into the Solution Explorer, has Commit, Diff and Annotate/Blame features that display as VS window panes, and it automatically includes new solution files in the commit.  Overall, it appears to have been built with a great deal of care.  For example, the unmodified state is displayed with blue check marks, not green, because this is easier for color blind people to distinguish from red.    I've included some screen shots below the fold.

Sunday, November 7, 2010

Clean Code

I've started reading Robert Martin's Clean Code: A Handbook of Agile Software Craftsmanship and am thoroughly inspired to whip my code base into shape. Here's a sample:

“But wait!” you say. “If I don’t do what my manager says, I’ll be fired.” Probably not. Most managers want the truth, even when they don’t act like it. Most managers want good code, even when they are obsessing about the schedule. They may defend the schedule and requirements with passion; but that’s their job. It’s your job to defend the code with equal passion.

From "Attitude" in Chapter 1.

Thursday, September 30, 2010

Sitecore Multi-Site Black Arts

I just came back from a very stimulating presentation at the New England Sitecore User Group by Rick Cabral of ISite Design on setting up multi-site environments in Sitecore.  Among the things I learned:

Sunday, September 12, 2010

Extreme Programming Dangers

While doing some online research on development methodologies, I came across a useful analysis of how Extreme Programming (XP) can break down in real life, because each component methodology (lack of fixed design, pair programming, constant refactoring) is too dependent on the others for success. An example:
Constant refactoring (i.e. constant tweaking and improving of your code) creates an unnecessary overhead. Outside the XP world, occasional refactoring is welcome, as it is useful to check and improve ('de-fluff') your design; but constant refactoring makes no sense. In fact it only makes sense in the XP world, where the design is made up as you go along.

Friday, August 13, 2010

The open source model comes to medical research

An intriguing article in today's New York Times about a new way of organizing medical research--get all the raw material out there, so lots of eyes can see it:

The key to the Alzheimer’s project was an agreement as ambitious as its goal: not just to raise money, not just to do research on a vast scale, but also to share all the data, making every single finding public immediately, available to anyone with a computer anywhere in the world.

No one would own the data. No one could submit patent applications, though private companies would ultimately profit from any drugs or imaging tests developed as a result of the effort.

Sound familiar? I like the distinction drawn between open information and "ultimate profit". It reminds be of Richard Stallman's definition of Free Software: "Think of free as in Free Speech, not as in Free Beer."

Doing Unix-type things on the Windows CMD prompt


I've playing around with the SVN command line recently, and the inability to use UNIX command-line tools like grep has been irritating. I've done some Googling for Windows equivalents to the basic Unix command line toolkit, and here's what I've found.