Visual Studio Project and Solution Guidelines :: Tip o' The Day

Over the years I've tried various configurations for projects and solutions in Visual Studio. One thing I've noticed is there are definitely good ways to do things and bad ways to do things. My intention is to, with this entry and others, lay out what is good, efficient, and elegant practice in putting together Visual Studio Projects. Since I haven't posted a tip o' the day in a long while, I figured that would be a great category to drop these into.

Don't Add Projects Whimsically!

Projects after a while start to cause all sorts of problems. There are interdependency issues that come up, possible circular references, reference maintenance, obfuscation of logic, namespace telescoping, and the list goes on. Keep project organization simple. In MVC for instance, often a solution becomes littered with a project for the model, the assembler for the model, a project for the view, and maybe ever several projects for the controllers.

All of that should be fine in a single project! Yes, one single itty bitty project. The project can then be built into a single DLL and life is thus simplified!

So don't add projects "just because".

HTC Mogul, Hard Reset – AGAIN

I own, and use heavily, a Sprint HTC Mogul Phone. It runs Windows Mobile on it, and amid my normal complaining it is an alright phone. Really though, I shouldn't even say it is an alright phone, the phone is great, the operating system is what leaves a lot to be desired. In the time I've had it, which amounts to almost 8 months now, I've had every other day soft reboots, two hard resets, and numerous other smaller issues, lock ups, slow response, and other operating system related issues.

Recently I needed to hard reset the device again and had forgotten what the key sequence is. I had to jump online and dig up the answer, the first link I found described it precisely: How to hard reset the Sprint Mogul. I followed the instructions and was up and running again in about 5 minutes.

[Rant On]

Now the damnable thing about this phone, is that this needs to be done. I don't know a single IPhone user out there that has had to do something similar. This is just freaking stupid. This is one more area were Microsoft really needs to tighten up their act and get something out the door that is vastly more stable, capable, feature rich, and above all has some seriously usable applications akin to the IPhone. Blackberries, strangely enough, are in the same boat with the IPhone. It appears that they have less issues altogether.

But I digress, I now have to go waste 30 minutes synching the damned phone.

[Rant Off]

More Newz And Random Bits

WebTrends hits a stride again with first tracking of Google Android. I can't help but be a bit proud of the guys for putting this together. Being Android is a major up and comer it is awesome to get a little ahead of the curve every once in a while. Often staying ahead of the curve is ridiculously difficult.

Dammit! I Broke the Build!

I broke the build this morning as I fixed a bug at 1:12am. I didn't just break it though, I broke it in an absolutely stupid, shameful, silly way. I somehow managed to stick a semi-colon on the end of a line of code before checking in, in addition to the semi-colon that was already on the end of the line of code. Woe is me, I'm a little special in the head today.

It does go to show though, technically, with modern tools I should not have been able to make that mistake. This is something I'll have to work with others to assure we implement. Nobody, should be able to actually check in code that would cause a break of the build. I have a little research to do because in VSTS TFS 2008, the currently used tool, I'm not sure how to set this up. Hopefully I can help figure out a way to help implement this to reduce these wasted minutes and hours of each day for the teams.

In Other News

WebTrends has been getting some good news releases and other such things recently. Lately there has been a post about our new products and product efforts. WebTrends declared data independence. Beyond that if we take a look at what has been released we get into some interesting scenarios, especially for sites with serious traffic volumes that need measured! WebTrends Connect & Data Scheduler will provide multiple avenues for access to data, delivered on various frequencies you can setup and various methods in addition to that. Using Web Services, ODBC, and the associated APIs one can really wire up the data into dashboards and integrate the data into other tools. Imagine being able to actually tie in your analytics data for the executive team and display it beside the ad spot purchasing data, to compare web vs. TV purchased ads and follow through. I personally find it very gratifying to see an actual click through to purchase line versus and artificial "guesstimate" for TV ad purchases.

But just imagine, by connecting those systems it isn't unfeasible to imagine even that data becoming available in some manner. I'll leave that exercise (at least for now) up to the reader.

Open ID Rocks!

I mentioned a few days ago that Microsoft finally got on the band wagon, well Google has also decided last week that it will also provide Open ID Provider Services which I had not realized. But between both of them getting on board, that is awesome news.

…and more Broken Builds

As the day has moved on there have been other build breakages, not particularly me. However the onus has been put on me a few times. It makes me ponder what VSTS TFS is doing. I've used it in the past, mostly with VSTS TFS 2005, and have had tons of issues. I'm usually pretty observant of what source control systems do with my code, but TFS is super tricky. It ghosts things in and out, mixes up versioning and puts some files with other check ins, then reports a breakage on a CI build that has nothing to do with a particular check out.

Now last time I checked, that level of inaccuracy was unacceptable. I was hoping that these types of issues would have been resolved in 2008, but it looks like my hopes have been dashed. This doesn't even touch on Ayende's Issues that he's mentioned in the past, and more, and I'm sure more. He just flat out states it flat out " It means that it cannot be trusted". Which honestly, I can't disagree with. After using Subversion with TeamCity and other tools, TFS just does not have that same level of quality or trust. Once again I'll state, I sure hope to see this fixed and changed in 2010, even though I'm not holding my breath this time, I still have a bruise from passing out for the 2008 version.

News, Keeping Up, and Work Bits

I finally listened to the keynote from PDC 2008. It was pretty good, nothing that I wasn’t really prepared for, but I’m sure a decent amount of cool things introduced for the Microsoft Developer out and about in the wild. I was glad to finally see the cloud computer official, etc. Overall I’m chomping at really getting into some of the other sessions related to the specific pieces of technology. Especially WCF, WF, and the whole middle tier pieces. I’m also keen to see what is done with the ASP.NET MVC Framework, and especially looking for to a real release finally.

Anyway, nothing I haven’t really blabbered on about before. In other efforts to keep up with technology and the architectural demands of the industry I often bounce over to InfoQ. One good listen recently was by Dan Pritchett of eBay. I’ll correct his title for him, “Designing for Latency“. Even though he’s one of those evil “architecting is a verb” people, he’s a good solid guy, and has some decent information to listen to and think through if you are building anything that might have latency involved. In other words, EVERYBODY!

In other news, Moore’s Law Has Changed, instead now we get cores instead of clock speed increases. While I’d still love some clock speed increases, it is nice to basically have a multi-core proc in every box these days.

PDC 2008 Kewl Bits

Check out this video. VSTS is going to rock a lot more. There are a few issues still that concern me, but the work flows and bug tracking are looking pretty good and improved!

At 28.00 minutes in they hit on how to prevent checking in a local change set that might break the build. Not like the “no you can’t check this in cuz you broke it” type of limitations, but it actually gives you information back on why it didn’t build correctly.

Other parts are the testing now automatically sends a video along with the bug, also a whole event log is sent along with the bug, and a whole bunch of other information pertinent to getting a bug fixed.

At 32.29, the “Layer Diagram” is shown. This is a new diagram and let me tell ya, that sucker will save some time in drawing out the dependencies! For debugging and presentation of an architecture. I’m digging this, all built into the TFS Toolset.

36.10 the Architecture Explorer is looking wicked too. This just brings home the idea that we developers are finally getting those promised 4th Generation Languages. Albeit they’re 5+ years behind, but they are arriving! The diagrams too, especially this layer diagram, is a beautiful thing to have that easily accessible. For a real kicker, check out the sequence diagram generated from code at 42:20.

For a real cool unit test bit, check out 46:10. That’s all I’m going to say about that…

Today’s Closing…

…That’s about it for today. I’m hoping tomorrow to have my Part 2 for the WCF known types & other bits finished and written up.