Entries from Jul 2004 ↓

VARBusiness’ Love Letter to Microsoft’s .NET

As far as I’m concerned, .NET Rocks! (and I’m not talking about Carl Franklin’s radio show.) I’ve programmed on many different platforms and in many different languages and studied many more than that, and as far as I see .NET blows everything else out of the water. Though I’ve never actually used Java or J2EE, from what I’ve read about it I believe .NET easily blows it away too. Programming in .NET is just so incredibly elegant and productive, and the framework of prewritten functionality covers broad needs and is intuitively organized given its necessary complexity and depth of scope.

Still, if you read periodicals like InfoWorld or SdTimes, you get the impression .NET is not really that great a platform and is filled with all kinds of serious holes. When they do praise it, they often seem to do so grudgingly. I believe the reasons for this are one or more of the following:

  • I think many journalists by their very nature view themselves as the protectors of David in their fight against Goliath. In the software biz there isn’t a more "Goliath" than Microsoft, so they resist praising even when deserved. And when they do praise its often with an implied "Okay you won this one but I know next time you’ll screw my constituents and when you do I’ll be there to pounce",
  • Many other journalists are like academics who are don’t have to solve real world business problems hence cloud their analysis with ideology,
  • Still more are part of the ABM crowd, that is: "Anybody but Microsoft." They use their pedestal to preach against "The Evils of MS", but are usually savvy enough that it isn’t always glaringly obvious. They are mentally hardwired such that they are incapable of recognizing when MS does a good job, or finally
  • They believe Microsoft has too much power hence no matter what MS does, they believe it irresponsible to praise.

So even though I constantly read how .NET is not that great, my experience tells me different; .NET *is* great, and to heck with all those jaded journalists.

That said a few days ago I picked up the July 12th, 2004 issue of VARBusiness magazine and read Carolyn April’s cover story entitled ".Net Now: How Microsoft’s Technology Is Winning Converts." Admittedly jaded from all the other industry press, I subconsciously looked for the .NET bashing as I read. But I couldn’t find any.

More than that, I read glowing praise. Things like:

Despite an abiding love for the Java programming language, Shiah pulled a developer’s 180 at Ascentn’s inception, abandoning J2EE in favor of Microsoft’s .Net framework and Visual Studio .Net tools. … Shiah says. "With .Net, we have been able to bring the cost of a BPM solution like ours down by five to 10 times that of J2EE. Everyone is looking for productivity and efficiency these days. And Microsoft helps you get it."

Wow! "Five to 10 times more productive than J2EE!"  WOW!  And there’s more (editing for space, not content):

….Net today is catching on like wildfire. … A … Evans Data study … shows a sharp increase in adoption. From spring 2003 to spring 2004, … 52 % … say they use .Net, up from 46 %. … 68 percent … said they plan to … use .Net by 2005. … In May, Forrester Research … found 56 % … consider .Net … primary … for 2004, compared with 44 % for J2EE. … 65 % … working on public-sector projects said .Net was … primary … vs. 35 % for J2EE, while 64 % of business-services … led with .Net over 36 % who led with J2EE. VARBusiness’ … State of Application Development survey … 53 % of solution providers … [used] … .Net … in the past year, and 66 % … planned to … in the next 12 months. "Frankly, we were surprised to see [.Net] as dominant as it was," says Nick Wilcox, a research analyst at Forrester.

Wow again! When VARBusiness’ survey asked why:

… the No. 1 and No. 2 reasons respondents said they chose .Net as their primary development platform were ease of use and quicker time to market, respectively.

They go on to compare to J2EE:

… a J2EE-based application is just plain harder to develop, test and deploy. And the write-once-run-anywhere message .. is, to some extent, a farcical myth. … each of the leading J2EE app servers, from IBM WebSphere to BEA WebLogic, features … proprietary extensions…

On Scalability and heterogeneous IT environments:

… Microsoft’s servers, …, have grown more scalable, enabling … .Net applications that can stand up in an enterprise arena dominated by the J2EE platform. … .Net’s bedrock foundation of XML and Web services are breaking down the natural integration barriers between Microsoft-based applications and other systems, which makes .Net apps increasingly viable for today’s largely heterogeneous IT environments. …

Normally the .NET naysayers, even high profile analysts got in the game:

…says Judith Hurwitz, president of Hurwitz & Associates IT consulting and analyst firm. "Developers like .Net and find it to be very cohesive and easy to build on. And because of the convergence around standards like Web services, third parties are able to build bridges between J2EE and .Net."

And that wasn’t all. There even more gushing about .NET elsewhere in the article! At the end, they did throw in the requisite counterpoint, but even that was watered down and they made it seem the position of the zealots, not the mainstream (note how the IBM partner talks trash on Microsoft even though IBM is as guilty as MS of the same, or at least they were when I worked for them in the 80’s):

… J2EE stalwarts abound, …. To them, .Net doesn’t make the grade. Others just can’t bring themselves to do business with Microsoft or dislike that applications are so tied to the overall software stack. "With any Microsoft product, you can anticipate some limitations that prevent interoperability with other systems. That’s just the way they do business," says Ed Weiss, director of marketing at ADS Retail, an Upper Marlboro, Md.-based IBM partner that sells Java-based, point-of-sale applications. "Quite frankly, .Net didn’t exist when we chose Java in 1997. It was a new player."

Sounds like his best reason for choosing Java was they chose it before Microsoft had even conceived of .NET! ("I’m sure the fact he’s an IBM partner doesn’t taint his view at all, ya think?") VARBusiness goes on to wrap it up with:

At the end of the day, the two development environments will continue to co-exist, but .Net is sending an enticing siren call to ISVs and app-dev solution providers that’s hard to ignore.

Enough said? Kudos to VARBusiness for painting an accurate picture of .NET!

Anyone know of a T-SQL Code Formatter?

I know I’m the tool man (with Xtras.Net) but I can’t seem to find a T-SQL code formatter and wondered if anyone else knows about one? 

I’m got someone inhouse who writes his SELECT, INSERT, and UPDATE statements in stored procs as if his monitor were infinitely wide, and only ever uses the tab or enter key if forced to do so.  His SQL code has no whitespace, and his statements never line up; whenever I have to touch anything he does I have to spend 15 to 30 minutes reformatting his code.  He also won’t comment his code telling me "I’m in development on it which is why I don’t format or comment; I’ll clean it up later when its finished" which of course never happens. I’m pretty much a standard’s zealot yet no matter what I do, I can’t get him to change.  I feel like the pious Baptist minister whose teenage daughter drinks, smokes, listens to rock music, and is having sex with the entire football team! 

We just had a big blow up for the nth time about it and his response to me was "Then adopt my style, I like it better, I can’t read your code when you format it." (If you want to see how I format T-SQL, you can read some of read my prior posts.)  Jeesh I’m frustrated.  Do any of you have to deal with this situation?  Is it me?  Any thoughts about how to get him to feel like there is value to working with standards everyone on a team can agree on?

Does anyone know of a T-SQL code formatting tool and standards management tool I can run on an entire SQL Server database?

My blog’s been quiet, but dotNetInfluencers.org has not been…

Though my blog has been quiet for several days, it doesn’t mean I haven’t been working on online projects. Since I launched it over a week ago, http://www.dotnetinfluencers.org/ has taken a lot of my time, but it is coming along better than I had hoped for! If you not familiar with what I’m doing over at dotnetinfluencers.org, basically it is a Wiki, but with a twist. Instead of a normal wiki where everyone is encouraged just to write stuff, I’m encouraging people to help me define an XML schema about people, activities, events, and so forth related to .NET programming.

The idea is instead of a lot of writing define a list of properties for each item and then programatically we can generate lists based on those properties. I’m using FlexWiki and it has a language called WikiTalk which we’ll use to process the properties and provide the lists. Just to give you an idea of what I’m talking about, here is most of the actual text at this moment for a Wiki page about MSDN Magazine (the properties are the list of the colons, the values on the right; to understand the rest you’ll need to learn about WikiFormatting):

:Summary: About MSDN Magazine
TopicType: DotNetPeriodical
PeriodicalPublisher: [CMP]
PeriodicalName: MSDN Magazine
PeriodicalShortName: [MSDN]
PeriodicalEditor: ???
PeriodicalFormerEditors: JoshuaTrupin
PeriodicalLanguage: [English]
PeriodicalFirstPublished: 2000Mar
PeriodicalFormerNames: MicrosoftSystemsJournal, MicrosoftInteractiveDeveloper
PeriodicalUrl: http://msdn.microsoft.com/msdnmag/
PeriodicalStatus: [Active]

From the above and numerous other wiki "topics", we can generate an automatic list of periodicals on dotNetInfluencers.org:, and/or many other lists. Now don’t those page properties look suspiciously like attributes or subelements of an XML element? I thought you’d think so… If you haven’t seen dotNetInfluencers.org, check it out. Browse around to get a feel for the site, and then add yourself and/or anything related to .NET. Better yet, if you’d like to help me build this site to the point we can define and public the XML Schema which is the purpose and goal of the site, send an email to mikes (at) xtras.net.

UPDATE: This project is no more and my email address has changed.

Getting Past the XSLT Error: “Expression must evaluate to a node-set.”

So I just blogged about how I find XSLT somewhat frustrating. Admittedly some of the frustration is based on my relative lack of experience with XSLT. One area ripe with potential frustration is the concept of the node-set data type for which learning has caused me a bit of hair loss recently!

A typical scenario using XSLT is to apply an XSL file as a transform to an XML file to produce output, often HTML. Of course never one to be satisfied with the typical scenario, I found myself compelled to use numerous data sources and even embed XML in my XSL file (For those not familiar with how to pull XML from another XML file, you use the document() function.)

Anywho, while embedding XML, and even when copying subsets of XML documents into variables in my XSL file, I kept running into the dreaded "Expression must evaluate to a node-set" error while trying to access subnodes. For a long time I could not figure out how to get past it.

(BTW, the following assumes MSXML 4.0)

I finally figured out the pattern (I think :). Basically if you "select" a subset from a node-set, you get a node-set, like this:

<xsl:variable
   name="month-as-node-set"
   select="$issue-date-as-node-set/IssueDate/Month"/>

However, if you select from a node-set but instead use </xsl:value-of> as a subelement, you get a string, and you can’t later select directly from a string.

<xsl:variable name="month-as-string">
   <xsl:value-of
      select="$issue-date-as-node-set/IssueDate/Month"/>
</xsl:variable> 

Of course you can use the MSXML-specific node-set() function to convert back to a node-set from a string (As a side note: Why didn’t the XSLT standards committee include such a vital piece of functionality in the standard?!? And be sure to declare the namespace msxsl; for exactly how, see my last example at the bottom of this post):

<xsl:variable
   name="month-as-node-set"
   select="msxsl:node-set($month-as-string)"/>

Next, if you want to output the values contained in the XML elements but not any of the markup, any of these will do:

<xsl:value-of select="$month-as-node-set" />
<xsl:value-of select="$month-as-string" />
<xsl:copy-of select="$month-as-string" />

Of course it you actually want the markup output, you need to use <xsl:copy-of> like so (as example where you might want this is if you include HTML markup like < UL> and < LI> inside your XML elements and you want to copy it intact to your output):

<xsl:copy-of select="$month-as-node-set" />

Lastly, you can’t select sub-nodes using a string (which is the reason I was inspired to write this post.) If you try, you get "Expression must evaluate to a node-set.":

<!--
   This CRASHES WITH:
      Expression must evaluate to a node-set.
-->
<xsl:value-of select="$month-as-string/Name" /> 

Here’s a complete example which will work with (and otherwise ignore) any XML input file. Note it crashes if the last <xsl:value-of> is not removed:

<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:msxsl="urn:schemas-microsoft-com:xslt">
  <xsl:variable name="issue-date-as-string">
    <IssueDate>
      <DayOfWeek>
        <Name>Wednesday</Name>
        <Number>4</Number>
      </DayOfWeek>
      <Month>
        <Name>July</Name>
        <Number>7</Number>
      </Month>
      <Day>14</Day>
      <Year>2004</Year>
    </IssueDate>
  </xsl:variable>
  <xsl:variable name="issue-date-as-node-set"
    select="msxsl:node-set($issue-date-as-string)"/>
  <xsl:variable name="month-as-string">
    <xsl:value-of
      select="$issue-date-as-node-set/IssueDate/Month"/>
  </xsl:variable>
  <xsl:variable name="month-as-node-set"
    select="$issue-date-as-node-set/IssueDate/Month"/>
      <xsl:template match="/">
    <html>
      <body>
        <table border="1">
          <tr>
            <td>
              <!– This outputs just "July7" –>
              <xsl:value-of select="$month-as-node-set"  />
            </td>
          </tr><tr>
            <td>
              <!– This outputs just "July7" –>
              <xsl:value-of select="$month-as-string"  />
            </td>
          </tr><tr>
            <td>
              <!– This outputs just
                "<Month><Name>July</Name><Number>7</Number></Month>"
              –>
              <xsl:copy-of select="$month-as-node-set"  />
            </td>
          </tr><tr>
            <td>
              <!– This outputs just "July7" –>
              <xsl:copy-of select="$month-as-string"  />
            </td>
          </tr><tr>
            <td>
              <!– This outputs just "July" –>
              <xsl:value-of select="$month-as-node-set/Name"  />
            </td>
          </tr><tr>
            <td>
              <!–
                This CRASHES WITH:
                  Expression must evaluate to a node-set.
              –>
              <xsl:value-of select="$month-as-string/Name" />
            </td>
          </tr>
        </table>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

If you need more info than I’ve provided here, you can check out Using msxsl:node-set() to Process Result-Tree Fragments on Microsoft’s MSDN website.

I hope those who are stumped as was I by the "Expression must evaluate to a node-set" error are able to locate this post when googling and hence greatly reduce the amount of hair loss they experience while solving this problem!

Tags: , ,

Ranting about XSLT’s verbosity

I’ve been trying to learn XSLT for a few projects, and I find it both a fascinating and extremely frustrating language! I read about the designers goals (from Michael Kay’s XSLT: Programmer’s Reference) and just shake my head, i.e. : "XSL stylesheets should be human-legible and reasonably clear" and in the next sentence "Terseness in XSL markup is of minimal importance." It seems to be because terseness wasn’t a goal, they decided to see just exactly how verbose they could make it! This IMO directly counters the goal of making it human-legible and reasonably clear!

For example, I wanted to be able to display days as "3rd" and "10th" without having to store the "rd" and the "th" in my data so I decided to write a function (template) called "suffix-day" to do so:

<xsl:template name="suffix-day">
   <xsl:param name="day" />
   <xsl:variable name="last-digit">
      <xsl:value-of select="$day mod 10" />
   </xsl:variable>
   <xsl:value-of select="$day" />
   <sup>
   <xsl:choose>
      <xsl:when test="$last-digit=1">st</xsl:when>
      <xsl:when test="$last-digit=2">nd</xsl:when>
      <xsl:when test="$last-digit=3">rd</xsl:when>
      <xsl:otherwise>th</xsl:otherwise>
   </xsl:choose>
   </sup>
</xsl:template>

Of course to call "suffix-day" the XSTL designers wouldn’t have been so forward thinking as to allow syntax such as this:

<xsl:call select="suffix-day($issue-day)" />

Or even this to allow expliticly specifying the parameter name:

<xsl:call select="suffix-day(day:$issue-day)" />

Noooooo, that will not do! It must be VERBOSE or it is not in keeping with the lofty aspirations of XSLT! Instead, we must call it like so!:

 <xsl:call-template name="suffix-day">
   <xsl:with-param name="day">
      <xsl:value-of select="$issue-date" />
   </xsl:with-param>
 </xsl:template>

Or even better, what if we have a template that needs five parameters? Oooh. So instead of:

<xsl:call select="this-little-piggy($market,
   $stayed-home,$roast-beef,
   $none,$wee-wee-wee)"
/>

We’ll get to bask in verbosity with this!:

   <xsl:call-template name="this-little-piggy">
      <xsl:with-param name="piggy1">
         <xsl:value-of select="$market" />
      </xsl:with-param>
      <xsl:with-param name="piggy2">
         <xsl:value-of select="$stayed-home" />
      </xsl:with-param>
      <xsl:with-param name="piggy3">
         <xsl:value-of select="$roast-beef" />
      </xsl:with-param>
      <xsl:with-param name="piggy4">
         <xsl:value-of select="$none" />
      </xsl:with-param>
      <xsl:with-param name="piggy5">
         <xsl:value-of select="$wee-wee-wee" />
      </xsl:with-param>
   </xsl:template>

Now now, doesn’t that feel more righteous? I’m just warm and fuzzy, and tingly all over right now. :-)

Jeesh.


Okay, I’m probably dead wrong with my criticsm of XSLT. There’s probably many great reasons why it should be verbose and I’m just being ignorant and short-sighted. Normally I never want to come across ignorant or short-sighted and I normally want to be objective and willing to acknowledge when I’m in the wrong.

But not today. I just wanted to vent. No, actually I just want to rant! Rant, rant, rant! So I don’t want to hear it from you why I’m wrong. Go away and leave me alone. Sue me if you don’t like it. :)

Tags: ,

Announcing dotNetInfluencers.org!

On Monday July 5th, 2004 I blogged about a project on which I was working. That project was a Wiki based on FlexWiki located at www.dotNetInfluencers.org, and it is now live and public on the Internet.

Click Purpose and Goals to read what I’m attempting to accomplish with dotNetInfluencers.org.  If you are cynical and believe I might have a hidden agenda (as some of my friends told me people might question why I launched the site), please read this.

As it is wiki, it is designed to be a community project. I am the catalyst for launching it, and I wrote some ground rules for participation, but if it is to succeed it will be because the community drives it, and it is succeeds, it will be the community that benefits.

If you think this is a worthwhile project please blog about it and/or suggest to three .NET Influencers you know they add to their resume on the site (and it doesn’t have to be complete; they can just start listing their activities and recognitions with a note that it will be completed later.) For example, here is the list of people I’ve added already but for which most I don’t have an influencer resume.

Anyone with a blog about .NET, please list it.

Also, I encourage not just the .NET Influencers themselves but also Magazine publishers, Book publishers, Conference promoters, Training companies, and other organizations whose business involves .NET Influencers to post their list of books and authors, magazine articles and authors, conferences and sessions, training courses and trainers, and more. This is a site whose purpose is to collect and collate information about the community, and it won’t succeed unless the community contributes.

Thanks in advance for your help to make dotNetInfluencers.org a success.

Who needs Evite.com?!?

Coordinating the Congregation of Co-Equal Cognoscenti for Consorting and Consumption of Comestibles; otherwise known as: www.geekdinner.com  :-)

 

Announcing my Latest Project! (Well almost…I need some help first)

I’m a categorization junkie. I have always been that way. If I’m interested in something I go out and research ad-nauseum, and then create exhaustive categorized and cross-referenced lists. I think that’s why I like databases and XML and data-driven websites. There’s something fundamentally satisfying about having data in a format that it can be easily sliced and diced, especially when you can be confident the list is incomplete.

Though I have frequently created lists of things and categorized them, with the exception of my business Xtras.Net where we list and categorize 3rd party components and tools for .NET, all of those lists are made at a point in time after which their accuracy fades.

Several years ago I wanted to purchase a loft condo and after several web searches I learned two things about real estate and the web. First agents for the most part don’t get the web, and/or second it is the goal of those in the real estate business to control access to information; too much money is at stake. All I wanted was a comprehesive list of loft condos in Atlanta so I could do my own research before going to see an agent, but such a list was nowhere to be found.

I spent an entire weekend researching the web and came up with a list that I later thought "What the heck, why not put on the web?" You can find that list here: Atlanta Loft Condos. It is now hopelessly out of date, and I keep thinking one day I’ll spend a weekend and update it, but that weekend will probably never come.

Anyway, one of the things that I’d love to have is a good comprehensive list of of what I call ".NET Influencers." That list would include all the activities in which they’ve been involved such as conferences, books, magazine articles, user groups, and so on. Why do I want this? Well, honestly, it just seems like it would be really beneficial to a lot of people, myself included.

For example, a company was were working on a Web Services project where security was extremely important. The project needed to integrate with SQL Server and ASP.NET. They want to develop inhouse, but don’t have time (or realize it would be foolish) for their staff to learn best practices on their own. They could send their staff to training classes, but as a former trainer I know training classes can be a blunt instrument when you need surgical precision. (Trainers don’t get all mad at me; training classes are great when someone needs to learn a broad base but not typically when they have highly specialize learning requirements.)

What if instead they could find someone who specialized in Web Services security, had experience with SQL Server and ASP.NET, who proved their expertise by writing books or magazine articles on the subject, and had their expertise acknowledged by giving sessions at conferences? They could hire that person for a 2-3 day crash-training/consulting project to teach their team best practices specifically for our project. They could pay that person a premium hourly rate, and it would likely be the best consulting money they had ever spent (I know this to be true; around 1997/98 we needed to learn SQL Server so we hired Mike Hotek for a two day consulting job and paid a handsome daily rate. It was definitely the best consulting money we ever spent.)

So who would benefit in the prior scenario? The client company would because they’d get their specific project addressed yet the cost of the consulting plus development would likely be much less than if they learning it on our own or even outsourced it. The expert consultant would also benefit because he would be paid handsomely for his time on a close-ended project without the need to be concern about a non-paying call-back.

In another scenario, imagine a conference promoter is sceduling a .NET-related conference and wants speakers for the hot topics dujour. Rather than just going with the same old people they already know and asking them to whip up something, they could find world-class experts. That would make the conference content tremendous. Who would benefit? Clearly the conference promoter, the newly discovered experts, and most of all, the conference attendees.

I could go on with similar scenarious, but I think you get the picture. I’ve wanted to, for quite a while actually, put together an XML Schema that would allow .NET Influencers to document their "influencial activities." I’ve worked on it on and off for months, but each time I’ve run into road blocks because I’ve not actually used XML enough to intuitively know how to best design a schemas. I’ve spoken with many XML "experts" and several said they were interested in helping, but nothing ever came of it (in one case, I never got around to emailing back…my bad!)

The XML Schema is perfect for this, I believe. Such an XML Schema would allow someone to create and publish what I’ll call an "Influencer Resume" containing a list of all their .NET-related activities (i.e. it should contain everything that would qualify them as an expert in some area of .NET, but not contain that they worked at MacDonalds until they were 18.) Once lots of .NET Influencers created and published their Influencer Resumes, it would give .NET-related websites all over the Internet something else to aggregate making the information searchable and sortable in a variety of ways. Practically everyone would benefit, don’t you think?

Over the holiday weekend I have finally it figured out. How do design the schema that is. I’ve prepared a proof-of-concept, and it is very close to fruition. It could be released to the world within days.

But first, I need some help. I need about ten (10) .NET Influencers to spend about an hour to create a subset (or complete version if possible) of their Influencer Resume and then review what I’ve done in context. A few hours work for you, no more, and when done you’ll have that which you’ve put off for years, that which you need to market yourself; the list of articles your written, conferences sessions you’ve delivered, other things related to .NET you’ve done.

Can you help me out, please? If you don’t think you are one to help with the above but you do have a blog, you can help by blogging a short blog about my need for this help? Or if you know someone who would be a great candidate, email him a link to this post, please. The sooner I can get past proof-of-concept, the sooner this think will see light of day and we’ll all benefit!