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/
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:
twitter.com/mafooku
“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
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
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
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
I plan to write about some things you need to know about this release but right now just know that it is hitting the MSDN servers. No one is sure yet if the new MVC framework is bundled with this but if it is get ready for some goodies.
-c
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
I recently launched a new site off some old ideas I had. I decided that I didn’t have the time to engineer yet other typical site with logins, account management, features, features, features etc. I wanted to keep the barriers to usage extremely low – since my site was going to be radically different, why lets users leave because your site wasn’t fast enough. I guess this is more about a simple site rather than simple code – which is a whole other story!
This is a short study on what took to build Mafooku and what appears simple sometimes isn’t. Take a look at the site for reference: Mafooku – Top 10
I started off the usual way, lets get the basics done for any site. So here was the initial list of things I thought my site needed. I’ve broken each section down into the initial “bad” list and then the final “good” list.
- We’re posting products so we’re going to need an login to edit products.
- If you need a login you need registration.
- Now I needed password/account recovering pages.
- Product edit/save page.
Woah … look at that list. To post a single product the user must first register, remember yet “another” username and password, understand their account layout and finally try post a product. Many users would have given up already so I narrowed down the list to just
- Let the user post a product.
A single page, short sweet with limited fields and just one image. Everything you need to get a seller interested in your products. So that may have seemed easy enough but we have a problem now. How does a user edit or re-post a product or more importantly delete it if it isn’t relevant anymore?
You need some creative thinking for this. A user can remove their product because when it is posted they get an email with an encrypted link to disable the product. Since only they have that email it acts like an account. The same idea applies to editing or in my case – just re-posting with updated details.
So from my initial list, item 3 wasn’t ever needed. Item 4 was really just item 1 simplified for the user so no extra coding here. Item 2 again wasn’t needed. There are now no barriers to usage, the site will be faster and much easier to understand.
I applied the same to the actual product listings. Categories etc just get too big for users to really navigate and search, when done right, can help a lot – is it really simple? I decided for this site, no. If you can’t see what we have within 1 click (no typing!) then it isn’t simple enough. Hence the front page items and a list of the last 100 and nothing else.
The actually programming behind the scenes was a bit more complex with some advanced caching, plenty of security and encryption but still remained a small size code base because I never stuffed the site with un-needed features.
-c
As I’m sure we all know Visual Studio 2005 as great as it is isn’t the fastest application on the planet. The good news is there are a multitude of things we can change to speed it up. Now firstly let me just state that I’m not a fan of just linking to other people’s blogs or regurgitating their information however I have posted the links to Scott Guthrie’s blog below for reference.
The tip I wanted to add was a really quick and easy performance boost for Laptops. I guess you could also apply this to a desktop using the same logic. As you will see below having the OS on one hard drive and apps on another drive gives a huge performance increase in VS but what if your system is already setup? I had this issue with my laptop. The easy fix is to add a second drive to your laptop and move the OS paging file over to this drive. I also moved the SQL databases to this drive since that is easy enough. I noticed a remarkable improvement in visual studio performance and I didn’t have to go through the headache of moving source code, IIS settings or VSS settings. The paging file is the biggest one by far.
Scott’s Links for VS performance tuning:
Hard drive performance