Code
16 June 2006 in Code | Comments (0)
A week ago I posted a blog entry detailing my concerns about some elements of Ruby on Rails (RoR) and had a terrific response from a wide variety of people. Overall it would seem that most people agreed to an extent with most of the points but many didn’t see them as major problems but more things that needed to be worked on. Of course some people found some points not to be problems at all and that’s good for them.
Thanks to all of those that posted comments, I hope you found the discussion as useful as I did.
I think that despite investing ~$150 in buying the books on Rails and Ruby that I’ll be putting it on the back burner for the time being. I’ll keep an eye on what is going on in that space but I already have a lot on my plate just keeping track of some of the really cool stuff that’s coming out from Microsoft (and from people building products in that space) in the next six months.
- JD
14 June 2006 in Code & Microsoft | Comments (2)
Anybody who reads my blog that is also having a serious play around with the new Office System and in particular SharePoint 2007 will want to check out the SharePoint 2007 SDK. While parts of the documentation process are still in progress I haven’t often seen SDK content that is as complete as this.
The samples are separated out from the huge 117MB chm file but I would strongly recommend getting the full SDK. It makes reasonably easy reading too
- JD
13 June 2006 in Code & Microsoft | Comments (2)
Just a quick post about SharePoint 2007 for anyone who is also playing with it. Make sure you disable the Windows Defender real-time protection when creating new sites. It intercepts and prevents changes to your hosts file so your sites don’t get created properly even though the site creation will claim to have been a success.
This shouldn’t be a problem on an actual server but while tinkering at home it’s worth noting.
- JD
9 June 2006 in .Net & Code | Comments (22)

This post is intended as a discussion piece, if you have any thoughts about anything mentioned here then please add a comment. Don’t be afraid, it’s just some friendly open debate
If your post on your own blog about this discussion let me know and I’ll update this post with links to your posts.
Recently I’d been hearing a lot about Ruby-On-Rails (RoR) and decided, like any diligent tech person, that I had better investigate it to make sure I’m not missing the boat on something new in the marketplace. I brought the books and did the tutorials. I also built a couple of basic sites on my own with RoR and they were fun to build. However, having come this far I’m finding it difficult to come up with a compelling reason why I would want to jump ship completely.
I thought I’d sum up with my top 5 concerns at the moment:
Issue one
The Rails framework has some compelling features like scaffolding however while that initially “hooks” you in and makes you think it’s fantastic you soon find that scaffolding up a solution is almost pointless because you nearly always have to write something considerably different to just CRUD pages. This initial development speed enhancement doesn’t actually end up helping you out that much. It harms people more than it helps them by having the misconception that scaffolding is actually a very useful feature of rails (it has its place, but it’s just not that important).
Issue two
Ruby’s performance just doesn’t seem to compare well with most other languages. admittedly you take a hit with any scripting language but the performance hits seem quite severe. Comparing Ruby’s performance to something like Java (I couldn’t find any .Net comparisons at the time of writing this) it seems apparent that Ruby is abysmal in the speed arena. You could argue that there are ways to optimise the code to run better or that you can just scale up your hardware but I just want a fast language. There seems to be so much code churn in the Rails framework that optimising for performance may be difficult to do until it has a stabalised feature set. Why is Ruby so slow? I think enough things on computers are slow enough these days without opting for something at the back of the pack. Can anybody provide evidence that Ruby isn’t so slow?
Issue three
IDE’s are lacking. I’ve used RadRails and I’ve a friend who uses TextMate and neither seem to provide anywhere near the functionality that I’d expect from a modern IDE. I’m always happy working with light weight IDEs but when I need to get a large application off the ground I’m always thankful when I have an industrial strength IDE to help me manage it.
Issue four
RoR seems to have new versions released often. Too often. Now, the geek in me loves the idea of having new features to play with every couple of weeks however from a business point of view it just increases the risk considerably. I remember the fallout from RoR being upgraded to a new version and all of the blogs based on Typo. You could freeze the version that an application worked against but it seemed like everything just fell apart for a lot of people when that version was rushed out. I’m all for the cool little team pumping out new features all the time but sparing a thought for the web hosts who have to test the framework before deployment, the people who deploy solutions on it and the developers who have to upgrade the version that their application supports constantly would be nice.
Issue five
All of the other issues are only really issues because of this point – I just cannot see how RoR scales up to develop truly large solutions. Perhaps it’s not really intended for more than basic websites? Some of the generators designed to save you time would simply hinder your ability to actually maintain large solutions nicely in my opinion.
These are some issues that have me feeling that RoR might not be as ready for the primetime as many would have you believe. Perhaps I’m wrong. Perhaps you know reasons why these points are not issues. If so, then please leave a comment about why you think so. Comparing these issues to my current web framework of choice – ASP.Net – I don’t think RoR stacks up well enough in my mind. I realise there are areas that it lacks that RoR does well however other vendors such as Microsoft are working hard to cover these areas as well (ATLAS, DLINQ etc).
Disclaimer: I do spent a significant amount of my time developing solutions using the Microsoft .Net Framework. I’ve not always been a .Net developer, I also have spent considerable amount of time developing in various other languages such as Java, PHP, C/C++, Delphi to name a few and of course dabbling with RoR
- JD
Links:
- Andrew Peters makes his first ever post and pulls no punches
- Tim Haines thinks I’m stirring and has some links to the WellRailed convo
- John Lewis doesn’t take part in the discussion but brings his own perspective to RoR in general
24 May 2006 in Code | Comments (0)

SQL Prompt is a free (until September) utility from Red Gate Software which adds intellisense support for writing SQL queries to SQL Management Studio (2005), Query Analyser (2000), Visual Studio 2003, Visual Studio 2005 and UltaEdit32.
Check out the webpage to see a basic animation of SQL Prompt in use.
Get it here: SQL Intellisense, Intellisense for SQL Server – SQL Prompt
– JD
10 April 2006 in .Net & Code & Intergen | Comments (2)
This is more for my own reminder but somebody else might find it useful. This code allows you to update the value of a config key in your .net 2.0 application. It also updates the section so subsequent reads from the .config will reflect that change. Really useful when you just need to store a single peice of information.
In this example I’m setting a last run date.
// Open the app.config
System.Configuration.Configuration config = ConfigurationManager
.OpenExeConfiguration(ConfigurationUserLevel.None);
// Update the last run time
config.AppSettings.Settings["LastRunDate"].Value
= lastRunTime.ToString();
// Save the configuration file
config.Save(ConfigurationSaveMode.Modified);
// Force a reload of a changed section.
ConfigurationManager.RefreshSection("appSettings");
- JD
21 March 2006 in .Net & Code | Comments (0)
Part of a current project I’m working on involves creating an RSS feed. After developing an XSLT and the xml to be parsed it looked like everything was going to work out just fine. Loading it up in FireFox was OK however then I loaded it in IE 6.0… Error.
IE complained bitterly about trying to open the XML however everything else seemed to work. On closer inspection there was an issue with the XML declaration tag:
<?xml version="1.0" encoding="utf-16"?>
It should have been UTF-8, not UTF-16. At it turns out the StringWriter in .NET can only create UTF-16 (StringWriter has an encoding property on it however this is read-only). This was also despite changing the encoding in the XSLT:
<xsl:output omit-xml-declaration="no" method="xml" encoding="utf-8"/>
Of course it seems somewhat short sighted that Microsoft would develop .NET to default to encodings that their own products can’t even support. So after some hunting I’ve changed it to do this:
XmlWriter xtw = new XmlTextWriter(Response.OutputStream, Encoding.UTF8);
_xslTransform.Load(Server.MapPath("rss.xslt"));
_xslTransform.Transform(doc, _argumentList, xtw, new XmlUrlResolver());
Now the encoding is correct and everyone is happy
Not the most clever feature of .NET.
- JD
14 March 2006 in Code | Comments (4)
Details about how blindingly easy it was to make the cookbook
Following on from my install of RoR in the weekend I went through and did a tutorial. Nearly all the tutorials for RoR are for building a recipe book application so that was what I started with. I jumped on the tutorial at ONLamp.com which leads you through setting up RoR and starting your application.
For most of my readers this is a quick tutorial to run through – you can quickly skip over the database section and just download the SQL script (unless you don’t know about databases) and you’ll be up and running in no time. The only small issue I had with the tutorial was that it is about 1 year old and some things don’t quite apply any more. Some of these are addressed in part 2 of the tutorial.
So in no time at all I had my application so that I could add, edit, delete and list all the recipes in my collection. I also had a categories collection that the recipes belonged to (Snacks, Desserts etc) which you could also add, edit, delete and list. I updated the listing of recipes to allow you to display based on category as well.
The tutorial demonstrated what I thought was a cool tool:
rake stats
Rake is pretty much a Ruby version of Make and running it with the stats command gives you information about the lines of code in your application (How many lines in your controllers, model, tests etc) and also gives a nice ratio of lines of code to lines of tests. Nice. I like stats
So my entire application ended up being 51 lines of code – 2 more lines than the example because I AJAXified the deletion of recipes from the list (you clicked delete and the row faded off). 51 lines seems insanely efficient for all that I was doing. I think I’m in love
Does anyone else have some RoR stories, experiences or horror stories they want to share?
- JD
RSS Feed