If you would like to comment on this post, please email me at edward.bilodeau@gmail.com.

© 1998-2009 Edward Bilodeau

Disclaimer: The opinions expressed here on this site are my own and do not represent those of my employer in any way.

« Previous Post | Up | Next Post »

Using SharePoint Designer to hand-code web sites, Part 3: Working with your code

Using SharePoint Designer to hand-code web sites, Part 3: Working with your code. Marking up lots of text is never fun, no matter how great your editor. SharePoint Designer does little to alleviate that pain.

For example, there is no ability to limit find/replace actions to a selection. The file is the smallest scope you can select. I've experienced and heard of too many find/replace actions gone haywire to know that this is a risky prospect. With a little extra care, however, I was able to replace chunks of code with little problem.

SPD's find/replace function does allow you to use regular expressions to select text, something which I have no skill in whatsoever, but which someone else might find useful. Seeing this did remind me of a quote from Jamie Zawinski:

jwz> Some people, when confronted with a problem, think 'I know, I'll
jwz> use regular expressions.' Now they have two problems.

Which leads me to think that SPDs ability to use regular expressions in find-replace is something some programmer thought was a good idea and somehow had added to the code base without running it by product management. Clearly, their energies would have been better used working on all the other glitches and shortcomings. (I don't really think this happened: I would like to think that Microsoft's software development methodology is too sophisticated to allow this kind of feature creep to occur.)

Back to SPD: You can't scroll the page while maintaining your selection. Every so often I'll find myself in one part of the page wanting to see what I did in a part of the file that is off screen, all without loosing my current space. For many (most?) text editors, this isn't a problem, so I was disappointed to not see the functionality in SPD. You also can't use a split screen to view two parts of the file at once. There isn't even a current line indicator! All standard text editor functionality, none of it in SPD.

Which of course suggests that SharePoint Designer isn't designed primarily with text editing or hand-coding in mind. They are expecting users to drag controls in design view, use property sheets to set values, and maybe, maybe drop to the code if they need to do something that isn't available in the WYSIWYG interface. That's fair, but its a shame because it wouldn't be too hard to implement the features that would make SPD a truly top-notch editor.

Another small issue, but a pain if you are converting MS Word documents to HTML: SPD can't paste superscripts copied from MS Word documents. It's not only that it leaves out the <sup></sup> tags, but it doesn't even paste the note's number in! Marking up footnotes is already a bother, but having to refer back to the source document to find out what number they are and where they should go is downright painful. Here's a typical page that I had to markup. You can see why this was a problem.

SPD does, however, paste “curly-quotes” into your markup, so you get to go through and clean those up.

See also: Part 1, Part 2