Archive for the ‘Thoughts on Development’ Category
My Development Environment
One of my main goals in setting up my development environment is portability. I like multiple monitors and fast machines, but I also have to carry my laptop every day when working in an office, and often work without a desk – I’m sitting on a sofa in a hotel room in Bangkok as I type this. I now run everything on a MacBook Air – possibly an unusual choice for someone who makes a living working on Windows software, but it’s very portable and with SharePoint I have to use virtual machines anyway.
I also considered getting a netbook, but I decided that getting SharePoint running on that may be pushing things a little.
This setup does have a couple of constraints of course – limited memory and limited disk space. However this isn’t too much of a problem if settings are chosen carefully.
For Windows apps I’m using VMWare Fusion 2 with Windows Server 2008.
Although I just have the one VM set up and running all the time, I have a copy of the vm on an external hard drive, from just after installing Windows and Visual Studio. Because I know just how unstable a development VM can get after a few months, especially when doing SharePoint work, I want to be able to replace my active VM with that backup and not lose any code or need a lot of time to get back to writing code. Ideally I should be back to work on a clean system with just a file copy and restart.
This means minimising what I run on the VM – In regular usage this is now just IE, Visual Studio, IIS, SharePoint, SQL Server and IE. All the other stuff I use (mostly Firefox, Skype and Remote Desktop) is very unlikely to become unstable so can run on the host. I might do this a little differently if running Windows as the host though – using Unity makes quite a difference.
The documents and downloads folders I have set up pointing to shared folders on the host – this works really well for accessing files from whichever environment I need to. Unfortunately it doesn’t work for code – Visual Studio doesn’t like network folders.
There are some settings you can change to make Visual Studio trust network folders (see Steve Strong’s post Loading projects in VMs with source on Host), but I haven’t bothered with that as it probably wont work completely enough. I tried to set up something similar a few years ago and ran into other issues with web projects – Namely that Visual Studio sets up a FileSystemWatcher for every file in a web project so that changes will be immediately seen in the browser, and watching for changes on a network drive is quite different to watcing a local drive.
For code I have set up a seperate virtual drive (Code.vmdk), the idea being that I can safely delete/replace the system drive (19GB) and only backup/copy the 1GB file.
I did make one mistake in setting this up – creating database files on the same drive. SQL server transaction log files can get pretty large (increasing the size of the vmdk file) and when you shrink them the vmdk file stays a couple of GB larger than it should be, unless you put in the effort to run sdelete and cleanup. If I was starting again I’d probably create a seperate drive for databases – the databases on a development machine are usually throwaway anyway, so they don’t really belong in the same place as code.
Another goal of my setup (somewhat related to the portability) is having everything stored somewhere other than my laptop. While losing a $4000 laptop is hardly a good thing, it’s pretty insignificant compared to losing $50000 worth of work. I have a couple of ways to deal with this:
I use Google Apps a lot – Gmail is a much safer place for my data than outlook files that I seem to lose every time I reinstall windows. I’ve been using Google Docs instead of Office, and haven’t really missed any features. The only Office app that I kept using using on the VM was OneNote, and getting GDNote usable has changed that too.
For the stuff that still requires local files, I’m using subversion. I used to only upload stuff when it became clear I’d want to keep it, but now I just put everything in there. I have folders set up so that it’s very easy to have TortoiseSvn or SCPlugin upload anything new.
Of course there are one or two things I haven’t got working quite as well as I’d like:
- Having the host see the VM by name rather than just IP address so I can get the code drive showing up in Finder and use a more consistent URL during testing. Probably really simple, but I haven’t worked it out yet.
Ok, that’s only one thing – guess I’m doing pretty well.
Just realised I’m using GDNote to write this post without really thinking about it – definitely a good sign.
Javascript Performance Issues

Having performance issues somewhere in several thousand lines of javascript is never a good thing, but with a little data from FireBug trying to find and fix the problem isn’t nearly as scary.
I’m also really liking jquery – most of the stuff it does is no big deal if you are used to working on the server, but if you’re used to writing large amounts of javascript with no framework even being able to find elements by class is pretty amazing.
Thoughts on Running SharePoint Without a VM
While randomly looking through the incoming searches on my blog, I came across a post from Bamboo Solutions – How to install Windows SharePoint Services 3.0 SP1 on Vista. Hacking the installer to allow SharePoint development without building a VM is something I’ve had sitting on my list of stuff to try out for about six months, so it’s good to see someone has put the solution out there.
Removing the VM requirement is a fairly important part of making SharePoint development easier. Visual Studio is really painful to use if you have to go through remote desktop, and even running locally with Virtual PC has its little issues like not being able to bring up intellisense with alt-right.
Being able to install SharePoint locally is certainly a step in the right direction. I’ve had all sorts of issues with things like virtual machines not being approved to connect to the network and therefore being unable to use source control or backup properly. Of course, in that sort of environment Vista probably isn’t SOE either, but it could make things easier.
However, it’s not a perfect solution, mainly in how easy it is to completely screw up a SharePoint installation. Despite the issues with performance and running visual studio, a virtual environment does have a big advantage in being easy to restore to a previous state.
When I’m next working on SharePoint development tools (which may be a while with all the other projects I’m working on at the moment), I’ll probably go with a hybrid approach – SharePoint running on a VM and Visual Studio running natively. I have done this before in a limited way, setting up a web service that deploys an uploaded WSP file and calling it from a piece of the WSPBuilder add-in that hasn’t made it into the official codebase as yet. The main piece of work left to make that system really workable is setting up the remote debugger.
More recently I have been thinking of another approach that may work better – setting up a continuous integration server alongside SharePoint. It shouldn’t be too hard to make WSPBuilder run as part of the build script, and may actually make a shared development server workable.
I Know C, and it Doesn't Matter
I’ve seen a few posts lately covering whether or not you need to know C to be a good programmer, most recently Do you really need to know C? I think so from Darren Stokes.
To a certain extent it seems like people who know C think everyone should know it, and people who don’t know C think it’s not important. I think the truth is a little more complicated – Knowing C is something likely to show up in good programmers, but isn’t in itself that important.
Assume we are in the context of projects that don’t use C directly – few would argue that you can work on a C project without knowing C. Think about what knowing C actually means – that you have been programming long enough to have experience from before Java and .net became the dominant mainstream languages and you have continued to learn new things in moving to newer systems.
It’s that continual learning, and to a lesser extent the years of experience that make you a good developer. There is something to be said for understanding the memory management stuff that C programming forces you to look at, but that’s not really tied to the language either. Again, knowing C is just an indicator of something else – that you are capable of understanding those concepts.
Requiring knowledge of C when hiring is probably a fairly effective way of filtering out the people who would be incapable of being developers at all in C, and therefore incapable of being really good developers in more modern languages. However, you’re also filtering out the good developers who just never needed to use it.
This is probably not too serious a problem right now, but will be more of an issue in the future, as fewer people have a reason to learn C. I personally haven’t written C (or assembly) code in about 10 years. I know C because I have been coding longer than that, but if I was starting out now I wouldn’t bother learning C – there are better ways to learn the concepts now.
Taking a Break from SharePoint
I finished up my last SharePoint project on Monday, and I have a few days before the next one starts. That has given me the opportunity to try some stuff I haven’t been able to while busy with SharePoint, namely building a .NET 3.5 app without worrying about details like getting a sufficient number of service packs installed on a production environment.
I think I’m in a pretty good place right now – I get to work on my own project, but I know I’ll be back to consulting next week so I don’t have to worry about whether it will get me paid. Uncertainty can be real productivity killer. It’s even worse if you are writing enterprise software and don’t know if you will get paid, though I’m pretty sure I can avoid getting in that situation again.
The application I’m working on is implementing a Social Networking/Search idea, which gives me a lot of freedom to play with new stuff. Enterprise development certainly has its good points (mostly involving cash), but for actually enjoying the work you can’t beat converting an idea into working code.