Visual Studio 2010 with Parallels
Posted on November 24th, 2009
So for those who run Windows 7 natively this isn’t really an issue. For those of us who want to run on a Mac and have been frustrated with the failure of Fusion 3, go give Parallels Desktop 5 a try.
I made the mistake of assuming vmware would do a good job with Fusion 3 but that turned out to be a waste of money and time. It makes Windows 7 virtual machines terribly slow with poor graphics. If you’re using any heavy WPF applications like VS 2010 this was brutal. Parallels is the complete opposite with great graphics and slick performance even for WPF applications.
If you aren’t using VS 2010 (beta 2 as of writing) yet, is that rock a little heavy? ;-)
Tags: .NET, fusion, parallels, vs2010
Filed under General | 2 Comments »
What kind of error handling is this?
Posted on October 17th, 2008
You’d be surprised the things that can be found during basic code reviews :) Once I found a pen I thought I’d lost … :) in all seriousness though, nothing drives me more crazy than seeing the following.
try { // some code } catch (Exception e) { throw e; }
I could scream! and actually it wouldn’t be the first time either. I don’t have a lot of patience for things like this.
If you aren’t sure what is wrong, let us take a closer look. For one, I came across this while actually hunting for a memory leak but I could never see an exception on any line except “throw e;” – because no matter what went wrong, the exception was caught and just thrown again and since the last line responsible is always the throw, I had to attach a debugger to find the real error.
The second problem is you haven’t actually accomplished anything, nada, zip, less than $2c of quality code here people – it doesn’t do anything. If you’re going to catch an error then DEAL with it.
I have seen some developers catch an error, log various details and then throw some kind of error again. Maybe there is a need for that but I doubt it can be justified very often. If something goes wrong you need to try fix the problem and continue normal operations so you users are unaware and if you can’t then fail gracefully.
Make sure too that you LOG errors – use any means necessary but just make sure the stack trace and some information about system state is recorded so you can fix fix fix :) – since its probably your fault it broke to start with.
And if you don’t have any error handling, get too it! Nothing could be worse than your users getting the yellow? screen of death :)
Here is something if you’re just beginning – I’ve always found these books pretty good for getting started, including some basics like the above.
![]()
Beginning Microsoft Visual C# 2008 (Wrox Beginning Guides)
Tags: .NET, Bad Code
Filed under .NET | No Comments »
I present, “Linq Alias Generator”
Posted on January 22nd, 2008
Here is a small project I thought others might find as useful as I have. We all know how hard it is to find a decently written schema these days especially when you inherit a project. Well why carry those ugly column names into code? This generator will create nice names for your columns while preserving the actual column name in the Linq To SQL dbml files.
This is an initial release so better things to come but it works for now. If you’d like to get involved there is a dedicated page here and a codeplex project as well.
Download from http://www.codeplex.com/linqalias/
Keep track of changes on my blog page here http://www.typemismatch.com/linq-alias/
Enjoy, -c
Tags: .NET, Tools, VS 2008
Filed under .NET, Software | 1 Comment »
MVC and Test Driven Development
Posted on December 13th, 2007
Well shortly after the release of VS 2008 Microsoft have released an MVC extension for Visual Studio. It is long overdue but never the less great to get! One funny point to note and maybe it’s just because the release is only CTP but the test framework of VS 2008 cannot test a controller out-the-box …. which is half the reason to use this pattern to start with :) … anyway, maybe it will be addressed in later releases.
Get it while its hot : http://asp.net/downloads/3.5-extensions/
Tags: .NET, MVC, VS 2008
Filed under .NET | No Comments »
Mafooku now integrates with Twitter!
Posted on December 5th, 2007
Yup we sure do. For those who use Mafooku to sell their products online, every product that hits the top 10 gets automatically sent to Twitter so those who follow Mafooku there can see your stuff. Of course since each product posted gets a turn on the home page everybody is getting some good coverage.
Twitter uses a REST based interface so connecting from .NET was pretty straight forward. Take a look:
Tags: .NET, ECommerce
Filed under .NET | No Comments »
Tools are the next programming paradigm …
Posted on November 25th, 2007
“Code Generation” tools to be more specific. Let me clarify that firstly. I’m not talking about tools that just take away programmer’s jobs – I don’t see anything that would suggest that is currently possible. I’m more interested in tools that just do what we keep repeating. If you haven’t discovered code productivity tools yet then you’ve been living under a rock! It’s time to wake up and get busy. You’re too slow these days without some good tools and so I’ve put a few posts together just for the best tools you could start with.
If you browse around the net these days you’ll find tons of “silver bullets” for the programming problems of today. Time is usually the best test of these things and pretty much all fancy styles, methodologies or techniques have failed or fail to some degree. The bottom line is, there isn’t a magic way to develop software, that will at least guarantee good quality or bug less code. So I think the next best thing is – how do we developer faster? and if we do find something that works well, how can I automate that so the next time I use it, a. I don’t have to rewrite it and b. I don’t re-create any bugs.
As a developer if you can build a library of tools, snippets and templates you’ll definately be headed down the road to more successful software. Now not all my suggestions are for code generation – I’ll talk a little about profilers and other such tools you just have to have!
http://www.typemismatch.com/2007/11/25/tools-productivity-tools-generators/
http://www.typemismatch.com/2007/11/24/tools-net-profilers/
If you do have any tool recommendations please leave a comment and I can see about adding a post for them.
-c
Tags: .NET, Tools
Filed under .NET, Software | No Comments »
Tools: Productivity Tools / Generators
Posted on November 25th, 2007
There are many tools out there for developers and I’ll probably write some more later about some ORM tools I use often and that save a ton of time. This article is about a more generic tool, something that can help you no matter what kind of code you’re writing. These are productivity tools and/or code generators.
A good tool in this area does at least the following:
- Helps identify code mistakes
- Supports code block templates
- Lots of refactoring support
- A good deal of syntax high lighting, i.e. code blocks, braces, line numbers etc.
Again this isn’t a tool you’re going to find for free. They take a great deal of time and research to develop so be prepared to spend a little. I’d say anything priced from $150-$250 is about average.
Below I have listed two tools both from the same company. The first called “Refactor!Pro” is a great tool however it is included in the more advanced product called “CodeRush” both from DevExpress.
Although Refactor!Pro is only $99 it is well worth the extra $150 to get the full product. This tool is incredible and you’ll discover even in the first day of usage that it can save you a ton of time. The ability to create your own templates which change depending on the code you’re editing is awesome. I picked this over competitive products primarily for 1. Their support and other product lines and 2. Their integration with the keyboard and keyboard shortcuts was just the easiest to use.
Don’t forget, you must learn to use these tools. If you get one and don’t bother to learn the shortcuts or how the templates work then you’re just wasting your money. See some juicy screen shots belows.

As usual you can get a nice long trial, so give it a go!
-c
Tags: .NET, Tools
Filed under .NET, Software | No Comments »
Tools: .NET Profilers
Posted on November 24th, 2007
This post is part of my series on development tools. There are way to many companies out there that do not offer their developers any tools what-so-ever and it is a real shame. If you’re a lone ranger then you need to get some cash and get these tools.
If you want to write high performance applications there are many things to consider and I’m not going to get into all the design aspects now. What I want to stress is that as human beings we just don’t have the capacity to predict everything our software is going to do when it runs. Using a profiler allows you to see exactly how your code is running and for web applications you can get a great idea where to optimize and also where to add caching.
Unfortunately there are no good free .NET code profilers out there but hey, very seldom is truely useful software just free :) The JetBrains and Red-Gate profilers are your best bet. I found the Ants profiler from Red-Gate to be the easiest to use and understand the output. Although JB’s profiler looks better, I went with more functional. The guys at RG are also easy to negotiate with so go bargin yourself a good price!
Here is the link for the Ants profiler, go give it a whirl. Screen shot below:

-c
Tags: .NET, Tools
Filed under .NET, Software | No Comments »
Don’t do this: Exception Handling
Posted on November 23rd, 2007
I work with a lot of .NET developers and hey even some Java ones from time to time ;) We’ve all done some dumb things and we all write bugs but the following is a recurring issue I find and I wish I knew where people were learning this.
try
{
// do something bad
}
catch (Exception err)
{
throw(err);
}
If you aren’t going to do anything with an exception then why are you catching it? Make your code user friendly and actually try recover from whatever went wrong, if it’s completely unknown then log it and let the user know (if required) that something bad happened.
As for logging techniques when things do go wrong please don’t just dump it out to a log file. I’m lazy and I don’t need to go trawling around the drive looking and then searching through log files. Here is my recommended sequence to follow when trying to log application errors:
- For critical failures send an email but as with all logging, make sure you don’t end up in loops!
- Log next into either the server event logs (application log) or an internal log that the site/application admin can use. Of course this won’t work if you’re experiencing a database problem in which case go back to the event log.
- As the last resort log to the disk.
Since I write a ton of ecommerce style sites I have one fail-safe for all financial related errors – all the available data gets emailed to me so I can rebuild the required data for the user.
-c
Tags: .NET, Bad Code
Filed under .NET | No Comments »
Visual Studio 2005 tricks, where are they?
Posted on November 14th, 2007
I hope you’re still not using Visual Studio 2003, if you are you need to get another job :) I want to talk about the hidden powers of VS 2005. Every now and then we get a good blog posting from someone at MS with tips on how to increase performance or do this or that.
Has anyone ever seen a site or even a single book dedicated to the things we “need” to know about VS but don’t. The only books I can find are general “using vs” kind of books but nothing for the more advanced developer.
Maybe we should put our heads together and write one? I’m giving it some serious thought and might kick off a page on this blog for gathering tips and tricks and then compile that into a PDF for us all to use.
Feel free to post your best tips in the comments.
-c
Tags: .NET, VS 2005
Filed under .NET | No Comments »