Oct 27 2008

How Did I Get Started In Software Development?

Tag: UncategorizedSymon Rottem @ 11:09 am

Huh.  I’ve been so tied up at work I’ve been missing many things going past, including that I was called out by Ken Egozi on the topic the subject of this post describes.  Unforgivable, I know, but I figure better late than never!

How old were you when you first started in programming?

I was 12 years old – the school I was attending had some Apple II+ machines it was deprecating and my parents bought one.  Best thing ever for games (Oh, Ultima III – you ate soooo much of my time!) but it was a nice little starter for development too.

What was your first programming language?

Like so many others, BASIC was my first foray into programming.  My parents, in a bid to have a life in the presence of 3 kids under the age of 12, decided to dump myself and my brother at the local library which had a sort of evening crèche for desperate parents. Luckily for us the library was also running a BASIC programming course where they took us kids through the basics (pardon the pun) and that’s what got me going.

What was the first real program you wrote?

Real program?  What’s that?  But seriously…I put together an application for tracking all my books – which ones I owned, where they where and who I’d loaned them to.  A lot of work for bugger all result, but it was really the exercise that it was all about…

What languages have you used since you started programming?

BASIC, C, C++, VB, VB.NET, C#, Turbo Pascal, Delphi…and a few proprietary ones as well.  Personally, so far C# is my favorite.

What was your first professional programming gig?

I was hired by a company that provided interactive voice response systems and I was responsible for developing the logic that ran the services.  Pretty simple stuff really, but it got me to start thinking about optimization (and not a moment too soon…premature these optimizations were not!) and gave me a chance to start earning money.

If you knew then what you know now, would you have started programming?

Absolutely.  Hell, if I’d known some of the stuff I know now I’d have started sooner!

If there is one thing you learned along the way that you would tell new developers, what would it be?

Collaborate, collaborate, collaborate.  I’ve spent significant periods of my professional and hobbyist development life developing in isolation…and it sucks.  Having a team of people around you who you can bounce ideas off is invaluable.  Preferably make sure the people you surround yourself with are smarter than you as well.

What’s the most fun you’ve ever had programming?

I don’t think I’ve had more fun than I’m having now.  Certainly there have been more care-free times in my professional development career, but the tools, technologies, techniques and opportunities at the moment are better than ever.

Who am I calling out?

I’m going to throw this one to Roy Osherove and Udi Dahan.

Apr 07 2008

More Distributed Revision Control

Tag: UncategorizedSymon Rottem @ 9:40 pm

Following up on my last post about distributed revision control systems it seems that the buzz is all around town now…am I just late to the party?  I just saw the Ken Egozi has started trying to get off the ground with Git.

I’ve been doing a bit more research to understand what the phenomenon is all about and I think this comment (which I’ve trimmed slightly for brevity) left on Coding Horror by Vincent at Genezys (blog in French) explains some of the reasoning nicely:

…I agree with you about distributed source control that it is not easy to see the difference with centralized source control…this if often a misunderstanding of what a source control system is. I think all programmers will agree with me that source control system allows:

– to work on a common source code ;
– to keep an history of the changes ;
– to back up your work.

The order I choose is intentionnal, this is the way people understand source control. First I can share with others, then I save history, and then I feel safe because my code base lives in a secured server.

With distributed source control, the goal is primarily to keep an history of the changes. Sharing the code is secondary. Backing it up is not even a feature.

That is why it is so confusing to switch to distributed source control. With distributed source control, history is the main thing. They considered this feature so important that they allow you to browse your history while being offline. You can share with others later.

There is some advantage to that. First, this is much harder to break the build. You don’t have to push untested code or quick and dirty fix “just to save them” because you can save the history locally, do all the testing another day, and finally merge the whole history back with others.

Merge are easier too. With SubVersion, when a conflict occurs, you MUST resolve it before commiting your changes. But you may not understand the conflict and you really really don’t have time to fix that right now. Because distributed source control keeps a whole repository locally, merging is not mandatory when a conflict occurs. You can keep the two versions and choose to resolve the conflict later. Or even ask the programmer that introduced the conflict to fix it.

Personally I’m still a little hesitant to migrate anything I’m working on to a new revision control system at this stage; Subversion is working very nicely for me at the moment, and I’m not sure how mature the GUI tools are for working with these systems…and I do love my full coverage GUI tools. Excuse me while I go and make an offering to the Tortoise gods…

Regardless of my reservations on my own projects, I can certainly see the value for a larger, more distributed projects such as the Castle stack, NHibernate (which are not using DRCS at moment) or Ubuntu (which is) where the development team is distributed and the code base takes some real work to grok. It would be really nice to be able to work on the code for something complex and be able to check in while experimenting so a roll back would be possible if the wrong path was followed – and this is not easy with Subversion if the repository is remote and even more so if you don’t have write access.

If anyone has any broad coverage GUI tools to recommend for use with the current crop of DRCS-es I’d love to hear about them.

On a side note, I did stumble across a project that uses Subversion into a DRCS called SVK which was interesting. I don’t know how it stacks up against the others, but interesting nonetheless.

Apr 06 2008

Distributed Revision Control

Tag: UncategorizedSymon Rottem @ 4:23 pm

In general, there appears to be a lot of noise about source control on the web at the moment; Ayende has been writing about the SvnBridge for TFS he’s been working and Jeff Atwood from Coding Horror posted today about setting up a Subversion server under Windows. Within hours Scott Cowan (who I had the pleasure of meeting at the London ALT.NET conference) explains on his blog how easy it is to set up a local SVN installation on your own machine. Source control is the flavor of the week.

It’s funny how some ideas seem to gain traction and then hit a tipping point so that suddenly, something you’ve never heard about before comes at you from several disparate sources in a short space of time.

Until Friday I’d never even heard of distributed revision control.

Initially one of my colleagues mentioned it and since then I’ve seen a reference to Bazaar in the Ubuntu developer documentation (which is the revision control system they use) and Jeff’s post also referred to distributed revision control.

All of this prompted me to start doing some research – I’m just starting to dig in, but there appear to be several implementations out there at the moment that support distributed revision control such as:

There’s even a write up comparing some of these systems by demod on his blog.

I’m not entirely sure where I stand on DRCS at this stage as I haven’t yet had a chance to play with one. I’d be interested to hear about people’s experience with different systems.

Mar 26 2008

Where does all the time go?

Tag: UncategorizedSymon Rottem @ 11:44 pm

Wow.  Time passes – fast.

I’ve been working hard on taming the docs for Castle as many of you already know and although I’m making progress it sometimes feels very slow.  This is especially true when I find myself with too many other things on my hands – business travel to Italy, refactoring code,  mentoring colleagues and trying to grok legacy software from the bowels of a system at work to name but a few.  The last is especially fun when the developers who wrote the code have not been with the company for years now…

So, the reward for all this hard work?  More hard work?  No – sod it – I’m taking few days off to drive around the south of France.

Regardless, in an effort to maintain forward motion on the MonoRail docs, for those of you who’ve offered to contribute, now’s the time to step up to the plate (or crease if you’re from this side of the pond and prefer the cricket analogy).  The source is all in the contrib source repository and I’m happy for people to put their hand up for a section or subsection (hell, even a paragraph!) that is inadequately documented, needs reworking, proof reading – anything.

If you’ve ever wanted to get involved in Open Source this is going to be an easy entry point – and you get to learn even more which can help you get closer to the code!  Before I began the restructuring I had a reasonable idea of what I was doing with MonoRail, but now I feel like I know soooo much more…any hey – now I know how to work with DocBook too.

Anyhoo – I’ll be back in a couple of days.  If you want to help out drop me a line.  Until then…à bientôt.

Mar 18 2008

DocBook in NAnt

Tag: UncategorizedSymon Rottem @ 10:10 am

Over the weekend I changed the way I’ve been building the new DocBook based documentation for Castle so that it’s more in line with normal automated build processes.

The process is somewhat new to me – I’ve never written an NAnt script in my life, so there’s been a bit of a learning curve involved…especially when trying to get do DocBook XSL transformations with syntax highlighting!

For example, take the following:

<exec program="xsltproc">
	<arg value="--output" />
	<arg file="${build.single.dir}/index.html" /><!-- file to output transform results to -->
	<arg file="customizations/html_chunked.xsl" /><!-- xsl to do the transforming -->
	<arg file="${source.dir}/book.xml" /><!-- xml file to transform -->

This is a pretty straight forward NAnt exec task that’s running xsltproc.exe from the Win32 build of libxslt – an XSL transformation engine. Seems easy enough, right?

Ok, I chose this particular engine because I’ve chosen to make my DocBook files modular so I don’t have one giant XML file containing all the content. To do that I’ve used XIncludes and to make the engine support them all I need to do is add one argument:

<exec program="xsltproc">
	<arg value="--xinclude" />
	<arg value="--output" />
	<arg file="${build.single.dir}/index.html" /><!-- file to output transform results to -->
	<arg file="customizations/html_chunked.xsl" /><!-- xsl to do the transforming -->
	<arg file="${source.dir}/book.xml" /><!-- xml file to transform -->

So good so far.

Where I ran into trouble was that I want to use the syntax highlighting in DocBook XSL – now things turn ugly. I can’t use my nice simple transformation engine anymore because the xslthl syntax highlighting library used by DocBook XSL is in Java and that means I need to use a Java based XSL transformation engine – I’ve chosen Saxon…but Saxon doesn’t support XIncludes out of the box. Aargh! Ok, there’s a way out of this, right? You betcha. You need to hook in Xerces so Saxon can use it for resolving XIncludes.

So, in summary, if I use Saxon, hook in the xslhtl package for syntax highlighting, then Xerces for XInlcude pre-processing to do what is otherwise the same as the task above the resulting NAnt task looks like this:

<exec program="java" useruntimeengine="true">
	<arg value="-cp"/>
			<pathelement file="toolchain/saxon/saxon.jar"/>
			<pathelement file="toolchain/xslthl/xslthl.jar"></pathelement/>
			<pathelement file="toolchain/xerces-2_9_1/xercesImpl.jar"></pathelement/>
	<arg value="-Dxslthl.config=file:///${project::get-base-directory()}/customizations/highlighters/xslthl-config.xml"/>
	<arg value="-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
	<arg value="-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl"/>
	<arg value="-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration"/>
	<arg value="com.icl.saxon.StyleSheet"/>
	<arg value="-o"/>
	<arg value="${build.single.dir}/index.html"/>
	<arg value="${source.dir}/book.xml"/>
	<arg value="customizations/html_single.xsl"/>

Personally I think this is scary – there must be an easier way to do DocBook transformations that won’t cost you. Does anyone have any suggestions?

As a side note, if you want to do all of the above without installing Java the above task can be executed using IKVM.NET as described in my last post.

Mar 16 2008

IKVM.NET – Java without installing

Tag: UncategorizedSymon Rottem @ 7:57 pm

Working on the DocBook version of the Castle documentation this weekend I found that to be able to take advantage of the built in syntax highlighting features of the DocBook XSL package I need to use a Java plugin but the XSL processor I’ve been using doesn’t support the plugin. The solution, of course, is to move to a processor that’s Java based but that then means that the build server needs to have a Java runtime installed to execute…or so I thought.

It turns out that there’s this really cool project called IKVM.NET that provides a Java Virtual Machine in .NET that allows you to run Java applications in the .NET Runtime. After some reading and experimenting I managed to get it working, so now I can use that Java based processor without installing Java.

What’s more, this will help with another little problem I’ve been chewing over – the generation of PDFs using Apache FOP. Apache FOP appears to be the most mature Open Source FO processor out there and seems to be the recommended way of converting DocBook into PDF. The kink for me was – you guessed it – it’s another Java package.

Using IKVM can be as simple as executing ikvm.exe in place of Java on the command line. So instead of executing the following…

java -jar myapp.jar

…you can instead use…

ikvm -jar myapp.jar

IKVM also provides utilities for converting Java bytecode to .NET IL which allows you to generate a .DLL from a Java library that can be used directly in a .NET application. Very cool – I recommend having a look if there’s some fantastic Java library out there with no .NET equivalent.

To get all this all you need are a couple of DLLs and executables. Admittedly it’s a little heavy to deploy with your code at 26Mb but it’s nice to know it’s there as an option instead of being forced to install the “official” Java Runtime.

Mar 11 2008

Documenting Castle – Phase One Complete

Tag: UncategorizedSymon Rottem @ 12:58 am

After many hours slaving over the keyboard the existing MonoRail trunk documentation has been transferred to DocBook format! Wahoo! I think I’ve given myself a crick in the neck and a good dose of RSI but hell – it had to be done, right?

The newly proposed structure is in place (apologies for the deviations from my previous post) and the existing content has been copied across but it’s not finished yet – there’s still a whole slew of tasks to undertake:

  • The styles still need to be built to provide a nice look and feel.
  • The output needs to be customized for each of the formats (I’m planning on Single Page HTML, Chunked HTML, HTML Help, VS 2005 Documentation and PDF at this stage).
  • Link endpoints need to be fixed.
  • The generation process needs to be properly automated.
  • The content hasn’t been refactored yet…this comes last.

But progress is being made (and I have a day job too!) Fortunately, Nicolas Vitra – a colleague of mine – is helping out with the PDF generation and adding syntax highlighting to the code samples, so things should start moving faster.

If you want to see the current state of things there’s a version of the docs for review here. Note, however that this is not in any way considered to be release-worthy, it’s just a little sneak peek. The content will not be staying at that address and will be taken offline at some point in the not too distant future, although hopefully not before they go into production.

Please post comments related to the structure or any problems with the presentation. Just remember that the content has not yet been from what’s available on the Castle website so any comments on that score should wait until it’s available in source control so others can get involved in the editing process.

Anyway – enjoy.

Edit: The URL for the documentation has been updated to a new location temporarily. 

Mar 08 2008

Documenting Castle – Tool Friction

Tag: UncategorizedSymon Rottem @ 11:27 am

Working on the Castle documentation is bringing it’s own share of frustrations – scarily enough it’s not actually from wrangling the data but the tools I’m using to do the task. As Ayende is so often stating, friction is something that just shouldn’t be there.

I don’t mind coding XML by hand but I like to at least have an editor that will provide me with colorized markup and handle indenting for me and identify schema violations. Visual Studio 2005 – my development environment of choice – seemed like the right choice…except that the damned thing keeps borking on me with the following dialog when I try to paste data from some other file:

Visual Studio Borked

I have no idea what’s causing this and much googling hasn’t provided me with an answer.

Hmm. Next tool please…let’s try something completely different – XML Mind’s XXE Personal Edition. This isn’t a bad little tool in that is shows DocBook data rendered so that it’s somewhat visual allowing for a WYSIWIG editing. The problem for me is that you can’t get down to basic XML – they use a tree view of the nodes but it’s not straight XML – which screws up the copy paste approach I’m using to cobble together the existing content. Also, it’s a tad on the slow side. Grrr – more friction.

So, for the moment I’m using Eclipse to do my XML editing. Does anyone have any other suggestions on a validating XML editor that supports a multi document interface, auto indenting, tooltips and error highlighting based on the schema or DTD defined in the XML and that is, most important of all, free?

Alternately, tell me how I can get VS 2005 to work.

Drop me a line if you have any suggestions.

Mar 02 2008

Documenting Castle – The Transformations Begin

Tag: UncategorizedSymon Rottem @ 11:24 pm

It has begun. The process of transforming the Castle user guide and getting started documentation to DocBook format is underway.

The process has so far involved writing a (truly and stupendously horrific) XSLT that transforms the selected parts of the original XML used to generate the Castle website into DocBook format, the creation of a simple batch file feeds all those XML files in each sub-folder to msxsl.exe with the XSLT sheeet to perform the transformation.

I say the XSLT is horrific mostly because my skills in the realm of XSLT authorship sucks like a vacuum cleaner and I’ve had to kludge something together without really knowing what I’m doing…

The really interesting part came from attempting to transform the HTML tables that were embedded in the original XML into the DocBook table format which doesn’t bear nearly enough resemblance to each other as I would have liked. After banging my head against the wall for a couple of hours the problem was solved using parts of someone else’s work who has much better XSLT skills than my own. See? I have no trouble resting on the shoulders of giants.

Regardless of the complete mess that does the processing, the damned thing works. It seems to have created documentation fragments that can be validated against the DocBook schema with only a couple of small exceptions. Yay!

Next step is to start reorganizing the information into logical groupings to present as chapters and subsections.

Wish me luck.

Mar 02 2008

Open Source Documentation

Tag: UncategorizedSymon Rottem @ 12:31 am

I love Open Source software. There are just so many benefits – I was sitting here trying to think of a list and then realized that others have enumerated them, so why should I bother? That said, one of the difficulties I’ve experienced with some OSS projects has been the quality and/or availability of documentation.

One of projects that has been bothering me recently is the Castle stack, or the user reference documentation for MonoRail in particular. My team and I have spent a fair bit of time trying to grok MonoRail with Windsor Integration and have not found it to be an easy affair. This is not because there isn’t enough documentation out there but is, in fact, because it’s hard to find what you need.

Hammett has actually done a great job of writing user documentation for MonoRail (I’m sure there have been other other contributors too) but the presentation of the information that’s there (and there are pages and pages (and pages!) of documentation including examples) is not laid out in a fashion that allows a new user to easily see the relationships or get a good overview.

Because of the frustration I and others have been experiencing I’ve decided to wade into the fray and have a go at restructuring and refactoring some of the documentation to try to address some of these issues. I’m currently leaning toward a hierarchical approach with a table of contents that clearly shows the hierarchy as well as rendering in both HTML and PDF.

To that end I’ve started a thread on the castle-project-devel mailing list to try and get some feedback on redesigning the docs so they meet more people’s needs. There’s already been some great feedback but if you’ve got anything to say on the subject feel free to jump in and contribute!

Next Page »