in Search

cruizer

aspiring to free and open the mind of .NET developers

October 2007 - Posts

  • And so I ate my words

    Yeah, I said enums are evil.

    Now I'm taking them back. Stick out tongue I was forced to swallow my pride and use an enum for my current project. This is for representing the privilege level of the user. I guess the simplicity of the enum won me over, since one can easily compare enums with each other. Besides, the data will be coming from a WCF service, so the data is just that -- data. It can't be an object complete with behaviour. So now, my position is to just use the simplest thing that will work. If it's an enum, go ahead and use them. If you outgrow the enum and realize that it is E-V-I-L in the context of the app you're making then just put the necessary measures in place so you can painlessly refactor later (stuff like TDD and regression tests).

    Excuse me while I (grudgingly) eat my words...

  • .NET Framework 3.5 code to be "opened"

    This was a major announcement, and lots of people were already blogging about it when I turned on my PC this morning.

    My initial reaction was -- what for? I think that for those who create custom libraries and controls, this will be a godsend. But for the rest of us developers, why do we need to debug through the .NET Framework code? Whatever happened to the concept of information hiding and encapsulation in OOP? While being able to dig deep into the .NET Framework source will be good for some, I can see that it can possibly be abused as well. By "abuse" I mean people might start coding against behaviour that's specific to .NET 3.5. What will happen once .NET 4.0 or newer comes out? Or if you target Mono, the open source .NET-compatible framework? The case with the latter is peculiar as well, because the current Mono contributor policy is that one cannot become a contributor if he/she is "tainted" -- if the person has viewed official Microsoft .NET code, either through the Rotor project or this new VS 2008 feature.

    But then, I might be feeling this way because I am just a business software developer. I don't do low-level stuff with .NET and as long as I code against documented .NET Framework behaviour I'll be fine. Different strokes for different folks, as they say.  Though I can think of a particular scenario where debugging into .NET code might be handy -- whenever I'm doing ASP.NET Web Forms development. That thing's got lots of quirks and gotchas. Stick out tongue

    Anyway, one interesting implication of this is that .NET library code is written in .NET. It'll be interesting to find out how beautiful (or ugly?) official Microsoft code actually is. By the way, just to correct some wrong perceptions -- Microsoft is not open sourcing .NET. This will be under a reference license -- you can look at it but you can't touch it. The code is "open" but it is not open source.

  • Weighing in on pipelined continuous integration (CI)

    This InfoQ link on pipelined CI got my attention because it was something that I can relate to. The project we're working on used to build on our CruiseControl.NET build server in only three minutes; now it's taking more than 18 minutes to complete. And it's a dual-core 2 GB machine at that!

    Agile practices like test-driven development (TDD), continuous integration (CI) and the like are hinged on quick feedback.  The longer you put off the small tasks like testing and integration, the greater the risk of having things go wrong near the end of the project, the phase we dub as "crunchtime." There was one person who blogged that pipelined CI is a "pipeline of doom," meaning more things will go wrong if you pipeline or break your build into multiple but smaller builds.

    I disagree. To me, the quicker one can do a check-in dance, the better. That doesn't mean one will have to do away with tests and go with half-hearted integration. It just means that you push them back so the more time-consuming ones are done later or less often. That way, the developers still get quick feedback even if the project code has grown considerably larger. For instance, in my current project, our architecture lead insisted on having just one solution (.sln) file for everything -- base code, server-side only code and UI code. I objected to this, since not everyone would be working on the server side code and it would only slow the build down. I proposed that we have two solutions (thus two builds) -- one for the server-side code and the other for the client-side code. But then, he's the lead so his opinion was the one taken by the whole team.

    Now that our code has grown large and build times are five to six times longer, I realized that my opinion was correct. What I've noticed is that since the build takes longer, the other team members impatiently check in their code even if the current build is red. So bugs and broken behaviour pile up quickly. Other team members keep their code to themselves and only check in a few times a day. Our use of IBM/Rational ClearCase further aggravates this problem, since those devs who keep their code changes to themselves keep the source files exclusively checked out! Ah, it makes me pine for good old Subversion...

    I'll be bringing this point up again in our next team meeting. I'll be suggesting that we break our solution down into server-side and client-side solutions so that one set of devs (those working on the server end of things) won't be slowing down the other (those working on the UI/client) and vice-versa. Also, I'll suggest that we move our integration tests out into a third solution, one that we can trigger anytime via a "force build" on the CCTray. So in case someone complains that the services aren't working properly, we'll just hit the "Force Build" button and see minutes later if things are green or red.