I’ve got Jeff Atwood to thank for an awful lot of things he posts over at Coding Horror, but this post in particular has made my day. I’ve often wondered why it is that the Find/Replace RegEx engine built into the VS.NET IDE uses a wilfully different RegEx flavour to the .NET framework classes. I use The Regulator for my regular expression building/testing, but I’ve always found it confusing and irritating that I can’t take a regex from The Regulator and plug it into a standard VS.NET IDE Find/Replace.

Now at least I know why, as it seems the VS.NET Lead Program Manager thinks enough of Jeff’s blog to shed some light on the matter:

It is a very oddball regex syntax, and as best we can tell it comes from Visual C++ 2.0. We did want to add additional support for .NET 2.0-style regular expressions in the Visual Studio 2005 release, but unfortunately due to time pressures it didn’t make the final list of features. We were able to make a number of bug fixes to the existing engine though, to give some improvement over VS 2003.

We do keep this on our list of things we want to fix. Ideally at some point we’ll actually build in a nifty little extensibility point so you can wire up any regex engine you want for searches.

Extensibility point schmextensibility point. Just plug in the regular framework classes (but leave the great shortcuts like :q). Thanks :)

Håkon Wium Lie, the original proposer of CSS, answers questions from Slashdotters about the origins of the language, why it’s not progressing as fast as web designers would like, and why he lies about the pronunciation of his first name.

If you have even a passing interest in CSS, this is a good read. Of particular interest is the answer to the question:

> by Dolda2000

> If you were allowed (perhaps by court order, which wouldn’t be
> unthinkable) to force Microsoft to do one (1) change in Internet
> Explorer, what would that be?
I would force them to support one (1) single web page before shipping IE7, namely Acid2. By using a tiny amount of resources to get Acid2 right, Microsoft can save web designers and users endless amounts of frustration in the future. It would also be an honorable thing to do.

However, in answer to another question further down, he tells us why this dream scenario will never happen:

It’s quite clear that Microsoft has the resources and talent to support CSS2 fully in IE and that plenty of people have reminded them why this is important. So, why don’t they do it? The fundamental reason, I believe, is that standards don’t benefit monopolists. Accepted, well-functioning, standards lower the barrier of entry to a market, and is therefore a threat to a monopolist.

From that perspective, it makes sense to leave CSS2 half-implemented. You can claim support (and many journalists will believe you), and you also ensure that no-one can use the unimplemented (or worse: buggily implemented) features of the standard. The only way to change the equation is to remind Microsoft how embarrassing it is to offer a sub-standard browser. And to use better browsers.

So there you have it. IE7 might help a little – and frankly it would be a relief just to be able to use the years-old child and attribute selectors, even if we have to wait a few more years before IE7’s penetration is such before it’s safe – but IE as a browser is going to drag its feet because MS doesn’t want the web to compete with Windows as a platform. So we as web developers must continue to use ASP.NET 2.0 with Firefox, Firebug, the Web Developer Toolbar, CSSVista, and all the other nifty little tools which are growing into the space which MS steadfastly refuses to occupy. And all the while, we must embarrass MS into some semblance of standards compliance.

Just think about for a moment though – as an ASP.NET web developer, wouldn’t you love to be able to ditch the “code for Firefox, fix for IE” mentality, and have a fully integrated AJAX IDE where you could debug your JavaScript in an integrated manner in Visual Studio and not have to worry about a separate browser for CSS? Wouldn’t it be nice if Visual Studio was your CSS IDE and you could see your changes live and be certain that your layout would render the same in any browser?

Ok, I acknowledge WF is an exciting piece of technology. It must be, I’ve spent days poring over examples. However, despite what is asserted on the videos, it’s not an easy piece of technology to get to grips with. In particular, there aren’t any “full” real-world examples. Pretty much all of the examples don’t actually write anything to a recognisable problem domain-specific database, they just use in-memory structures to hold ad-hoc workflow instances which then persist themselves to a very generalised workflow database.

I’m unsure how this squares with traditional app development. To use their helpdesk example, where does the data actually go? If it’s into this generalised persistence database, that makes it impossible for me to query, for example, the latest top 10 high priority cases, doesn’t it? Does this mean I am supposed to keep a domain-specific database in sync with the workflow using activities?

This seems to be the one area that gets no discussion – everyone’s so wrapped up in discussing the technical details of flying the runtime, persisting their instances, writing custom activities, that no-one has mentioned how the traditional application really fits around this. Oh, sure, there are plenty of examples that show how to handle external host app events or call out to the host app, but they’re all hooked up to Console.WriteLine or similar in the examples!

So, if I wanted to write a real-world ASP.NET version of the helpdesk app, do I need one database or two (one domain DB, one for the WF persistence service)? If two, how do you ensure the two stay in sync? If one, how do I query my cases?

Do I just write my application as normal and then put the hooks into workflow? How can I drive my ASP.NET page flow? Do I have to retrieve work items from a queue and display them somehow for helpdesk agents to pick up? Can I use straight ASP.NET data binding for this and which DB would it come from, domain or WF persistence?

These are a lot of questions (these are just *today’s* questions), and answering them one by one is like carving a Bamiyan Buddha singlehandedly. I’d post this to the WF forums, but such questions seem to go unanswered while the simple tech questions get immediate replies.

The quest continues…

EDIT: It looks like Jon Flanders may already have been through this pain.

Lots of properties required to get this upI’ve been looking at Windows Workflow Foundation (WF, not WWF for the usual World Wildlife Fund / World Wrestling Federation reasons) these past few days. In particular, I’ve been interested in collaborative workflows hosted online in ASP.NET applications. That sounds really dull (and that’s partly because it is ;) ), but it’s also the way forward (this week). The main reason I’ve been looking at it is for the state machine management combined with persistence for workflows which are waiting on user input.

I think the (possibly temporary!) conclusion I’m coming to is that WF is massive overkill for nearly any application. I’m currently looking at the WF Labs Expense Reporting example, and we’re looking at six (count ‘em!) co-operating assemblies, a lot of instance data on your workflow, co-operating applications to get data in or out, a slew of new terminology and a drag-and-drop coding environment that reminds me very much of some Amiga game I can’t remember the name of from around 1993 (which had a hacking sub-game with while/if/else implemented in a drag-and-drop style).

When it takes around five drag and drop operations and a dozen property settings to implement a simple if/else construct in your workflow, you can’t help wondering if any of this is a step forward from a simple method call. Ok, it’s not helped by the quality of the examples, which concentrate far too much on the how and not enough on the why. Even so, you quickly get the feeling there’s little here that could be described as exactly agile.

Of course, the architecture astronauts are never ones to pass up an opportunity to use a dozen new metaphors where three old ones would have done. This probably explains why BizTalk “architects” are commanding such insane salaries for what is essentially a grandiose plumbing job with little or no coding required. And when things go wrong, you’re left twiddling properties instead of sat inside a decent debugger with a decent worldview.

Tune in tomorrow when the penny drops, I get less grumpy about the learning curve, and I retract all this and replace the post with a thorough evangelisation :D

FOOTNOTE TO MS: If you could make your recorded webcasts freely available as straight video without having to jump through registration hoops and requiring the use of IE, that would also help my grumpiness a great deal. Thanks.

I don’t use many (actually, I try not to use any) of the built-in styling properties of ASP.NET server controls.  The only property that means a thing to me is CssClass.  However, there are a few properties I find I always have to set to avoid crummy markup.  Chief amongst these is the GridView’s GridLines property – if you don’t set this to ‘None’ and CellSpacing to -1, CSS styling of grid borders isn’t possible as inline styles will override any of your stylings.

I don’t really theme sites either, largely because of the aforementioned bad markup – the presentational properties result in a slew of inline styles applied to many elements which bloats the HTML. Since I’m not using them for anything else, a single ‘Default’ theme’s skin files actually works very well as “policy” style document.  I always set these two properties on any GridView - now I can set them once in a ‘Default’ theme and every GridView I use will inherit the policy. Not precisely what themes were intended for, but pretty useful nonetheless (at least until ASP.NET Control Adapters arrive later this month) :)

© 2014 ZephyrBlog Suffusion theme by Sayontan Sinha