Robert McLaws: FunWithCoding.NET

Public Shared Function BrainDump(ByVal dotNet As String) As [Value]

News

<script type="text/javascript"><!-- google_ad_client = "pub-4330602465258980"; google_hints = "ASP.NET, VB.NET, C#, C#.NET, WindowsForms, .NET Framework, VS2005, Visual Studio, XAML, WinFX, Windows Workflow, WPF, WCF, Atlas, NetFX3, Visual Studio Orcas"; google_ad_width = 120; google_ad_height = 240; google_ad_format = "120x240_as"; google_ad_type = "text_image"; google_ad_channel ="4997399242"; google_color_border = "B6C9E7"; google_color_bg = "EFEFEF"; google_color_link = "0000FF"; google_color_text = "000000"; google_color_url = "002C99"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<!--
-->

You should feel free to challenge me, disagree with me, or tell me I'm completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever. That said, I will most likely only delete abusive, profane, rude, or annonymous comments, so keep it polite, please.

Blogroll

Cool .NET Articles

My .NET Tools

My Builder.com Articles

My MSKB Articles

January 2004 - Posts

Why Are Many Coders Mediocre?

Last week, following the publication of this article on Builder.com, I was approached by an editor at Wiley & Sons (Makers of the “...For Dummies” books) in the UK about reviewing a draft of a book they are working on. I agreed, and the past two weeks have been fabulously interesting. I can't discuss the book yet (BELIEVE ME, when I can, I will) but I can say that it now comes in #2 on Robert's List of Books Every Programmer Should Read™, right behind Writing Secure Code, Second Edition.

So I'm working on my review, and it got me thinking about the difference between a mediocre programmer and a great one. What single factor makes a developer a master of their craft? Well, think back to the last piece of code you saw. How good do you think it was? If it was really good, what made it so? I consider great code to have the following characteristics:

  • Well formatted
  • Accurately commented
  • Descriptive
  • Concise
  • Easy to understand

Wouldn't you agree? We'll get back to that in just a minute.

In this day in age, I think the term “programmer” is a misnomer. I prefer to think of it as “code writer”. If you think about it, while code is meant to be interpreted and compiled into instructions that operate a machine, code is meant to be read by humans. In performing code reviews, when questioning the coder about their style, I've often been told “I'm a programmer, not an English major.” But often times, great code shares the same qualities as a great book. Code that is well written is engaging and fun to read. It makes you want to dive in and learn every nuance, watching for little details that make it stand out. Great code spawns creativity and new ideas. Invention begets invention.

(In the following paragraph, I will make a broad generalization that may or may not apply to you. If it does not, do not take offense. I realize that this generalization does not apply to most of the other people that blog here, but bloggers here are not the only ones that read this stuff.)
Now, consider most programmers. The stereotypical programmer spends lots of time in front of computers. Often when they were younger, they had trouble interacting with others. Human behavior is frustrating and unpredictable, which is confusing to many people of intelligence. At one point or another, these people discover computers, and fall in love with their predictability. You tell it to do something, and more often than not, it does what you ask. They find comfort in this, and eventually become developers.

So why are many programmers mediocre? Because they are poor communicators. They write hodge-podge, unmanageable, unmaintainable code because they cannot organize their thoughts in a concise and understandable fashion. Their code does not simultaneously contain instruction and convey intent. This is readily apparent at all levels, from code to comments to documentation to UI. A lack of instruction and practice in communication and social interaction makes mediocre communicators mediocre (or bad) coders. I believe that this is the reason so many people are frustrated with computers today. Poor communication of intent at the lowest levels are intensified exponentially at the highest levels. if you see a program with a UI that is nonintuitive and horribly unnavigable, it's a safe bet that the code is in the same shape or worse. Is it any wonder that so many people are calling “social computing” the next big thing?

So what is the lesson here? If you want to be a Software Master Craftsman, you must consistently practice and refine your skills as a communicator. Coders SHOULD be more like English majors. Code should go through an edit process identical to the edit process for a literary work. All code should be printed and checked for clarity, consistency, and accuracy. It should convey intent quickly and with precision, and should be as engaging as any spy thriller or romance novel.

But hey, I'm preaching to the choir, right? Isn't that what we're doing here every day... refining our communications skills?

IE Flaw Explained - Patch On the Way
News.com has a great article on the IE “address spoofing flaw”, and the forthcoming patch to solve it. It's a must read, so go check it out.
Microsoft: Eolas Changes Won't be in XPSP2
News.com is reporting that Microsoft has made a statement saying that it will hold off on Eolas-related Internet Explorer modifications until after the appeals process is over. Microsoft is currently awaiting the results of a Patent Office review of the Eolas patent, based upon several possibilities of prior art.
"The action by the patent office may result in the cancellation of the Eolas patent," according to the Microsoft statement. "Given these circumstances, and after consulting industry colleagues and developers, Microsoft, for now, will not be releasing an update to Internet Explorer and does not plan on making the changes it announced in October to Windows XP Service Pack 2."
It will be interesting to see how all this plays out. They already have the changes in the SP2 code that I'm running... I feel bad for the guy that has to go back and comment that all out.
PDC DVD Materials Arrived
I finally got the DVDs for PDC 2003. It wasn't exactly what I was hoping for, but I'll manage. See, I don't have a DVD-ROM drive in my computer yet. I know, isn't it a shame? Anyways, I was hoping (nievely, maybe) that the DVD would be something that I could stick in my Xbox and watch in the comfort of my living room. Well, you can... if you have a Media Center PC. The videos are WM9 encoded, so you have to run them off of your PC. I guess I have another reason now to pony up and buy one.
Posted: Jan 29 2004, 03:27 PM by interscape | with 7 comment(s)
Filed under:
Make Your WinForms Apps Stand Out
My favorite cross-dresser Martin Spedding pointed me to a guy out of the UK by the name of Tim Dawson that has made some killer WinForms controls. His controls add Office 2003 stylings to any app, and are completely customizable. I'd gladly pay $100 bucks a pop for these controls, but he gives them away for free. Awesome! Make sure you put a few bucks in his tip jar and pay the man for his efforts. Martin's putting together a really cool RSS application that's really going to make some waves. Can't wait to see the final version.
Combating MyDoom.A in Outlook 2003

I had over 80 e-mails in my inbox when I woke up this morning, most from this wonderful new virus that some schmuck that can't get a girlfriend decided to write in his ample spare time. I hope someone nails this jerk. As you can already tell, this virus thing is really starting to tick me off. Since my e-mail server's antivirus filters have not updated yet, I started fighting it the good-ole-fashioned way: Rules in Outlook 2003.

I set up a rule that I call “Screw MyDoom.A”. I have it check for the following phrases in the message body:

  • test
  • Test
  • Mail transaction failed. Partial message is available.
  • The message cannot be represented in 7-bit ASCII encoding and has been sent as a binary attachment.
  • The message contains Unicode characters and has been sent as a binary attachment.

Any time a new version comes in, I add it to the list. I also have it look for an attachment that is no larger than 23KB. If it meets all these criteria, it automatically deletes the e-mail permanently, and stops processing more rules.

This has been extremely effective in fighting the effects of the virus on my inbox. Having said that, should you use it, I bear no liability for any legitimate mail lost due to this method. If you don't want to risk losing good mail, just delete the itmes, don't delete them permanently.

Advertising In RSS Feeds - My Take

Tim Marman points to a Mike Gunderloy post about advertising in RSS Feeds. This is a subject that I've been grappling with for a few months now, so I'll give you my perspective on it.

A few weeks ago, I posted on LonghornBlogs that it was time to start experimenting with ways for the community to be self sufficient - that is, to generate enough revenue on its own to sustain its operation. I stated right off the bat that I wasn't going to do banner ads, and some folks thought I was a quack. There is a very specific reason for that, however, and it wasn't just some rash decision that I made.

In that post, I discussed the normal evolution of a community, and how LonghornBlogs was different. Now, if the site was run by a couple og guys just for the hell of it, and it turns into a business, that is one thing. LonghornBlogs started with a company already behind it. Therefore, those company interests have to be taken into account at all times. For example, if I put banner ads up, I have to allow everyone that wants to advertise within a given market sector to be able to do so. Therefore, if I allow .NET component vendors to advertise there, then everyone has to be able to, lest I find myself in court for discrimination.

Now, Interscape is a .NET component vendor, among other things. So, what if a company like Aspose wants to market Aspose.Excel there? Or MakeItScroll.com wants to put up a $10,000 banner ad campaign? Now, company-owned sites are obligated to advertise for direct competitors. Now, I may be young, but I'm not masochistic. I'm not about to commit entrepreneurial suicide by shooting my company in the foot and letting is slowly bleed to death.

So banner ads is not the answer in this situation. Business is about risk but I'd rather not go to court if I don't have to. DonXML suggested paid-for-placement reviews of products. While I think this idea has merit, I'm not sure about the implications against an individual. What if the person doesn't like the product? Is he/she still obligated to right good things about it? I hope not, because the person would cease to be a credible source of information. What if he/she does write a bad review of the product. Does he/she have to give the money back, or risk another possibility of lawsuit? Plus, it could easily go too far, turning people into blog-whores, prostituting themselves to advertising much like many sites do today. One of the reasons that the blog medium is so cool is because it's filtered information based on your own tastes. All of what you want to see, not much of what you don't. In today's world, tools like these are critical to just maintaining sanity.

So now we get to the concept of dumping ads into an RSS feed.  Like anything else, done tastefully, this could be extremely effective. 72% of LonghornBlogs.com's hits come from the RSS feeds, at an average readership hovering around 22,000 unique visitors a month. Nearing almost 3 million hits a month, that's quite a lot of impressions. Inserting a small text message at the bottom of every 5 feeds or so wouldn't be that big of a deal. A single line of text, at most, with no more than 2 hyperlinks. No pictures, no animated gifs, just simple text.

I don't think that is what is going to happen though. People are going to rush into RSS Advertisement without thinking, and yet another medium designed to simplify our lives will be cluttered up with utter nonsense. Wuld I mind so much if they used an AdSense-like tactic, as Tim suggests? Maybe, maybe not. Just because I want to read about something, doesn't necessarily mean that I want to see ads related to whatever it is I'm reading.

So what would I like to see? Personally, there needs to be a way to authenticate to get an customized RSS feed based on personalization settings, so that I can see what I want to see, when I want to see it. If I want ads, let me choose the frequency and extensiveness of the advertising I want to be exposed to. Until that is possiblt, I think marketers need to do us a favor and stay away until it has been WELL thought out, and extremely tasteful.

Mars Rover Problems - Update
NASA is now saying that the problem with the Spirit rover is due to the fact that it is “trying to keep track of too many files”. There are many lessons to be learned here. First, humans are no longer the only ones that suffer from this problem. Maybe if Spirit had been running WinFS it wouldn't have been so much of an issue. I'll need to ask Don Box if Indigo communications can be piped through the Deep Space Network. Anyways, the second lesson is simple: Regular maintenance of your computer is key. Defragment your hard drive once a week, and make regular backups, deleting files you no longer use on a regular basis. Whether it's a Martian rover or the family computer, taking these routine steps will ensure your system doesn't melt down at the most inopportune of times.
Mars Rover Problems

NASA said today that the Mars rover “Spirit“ was online and recovering from its earlier problems. They said they had narrowed the problems down to the Flash memory unit and the file system that manages it. A Microsoft Representative directed JPL personnel to KB Article 743382 - “File Access Causes System Reboot on Windows Mobile 2003 - Interplanetary Rover Edition”. The KB article calls for the rover operator to bypass the Flash memory and access the RAM directly by playing Timothy Busfueld's violin solo from “Revenge of the Nerds“ backwards while holding down the “Ctrl“, “Ins“, “F9“ and “Esc” keys simultaneously.

Open source advocates argue that, had JPL used Linux instead of Windows, the repair process would have created jobs for 40 balding middle-aged sofware hobbyists, bolstering the economy by 300%. Sun President and CEO Scott McNealy used the opportunity to highlight the capabilities of the Sun Java Desktop System, only to be reduced to insessant babbling about how much cooler he is than Homestar Runner.

NASA officials ruled out infection from the MSBlaster virus, although the rover rebooted over 130 times before engineers got it under control. Technicians hope to have “Spirit” fully operational again soon. Currently they are working to install Windows Server 2003 Software Update Services to prevent future problems. Microsoft has had a patch out for several months now, but the MER team forgot to ask the Deep Space Network team to open up port 195 on the Intergalactic Firewall.

More news as it becomes available.

Sharepoint Observations - Installation

There has been an explosion in recent days regarding the number of people blogging about Sharepoint, and having just spent 4 days testing and installing the system on my own servers, I thought I'd throw my observations into the ring.

Installation
All and all, installation was pretty simple. Before I got started installing, I tried to find a role-based installation guide. You know, something that helped walk you through installation in a simple manner based on your existing server setup. While the included documentation came close, it was way to jargon heavy for regular users to be able to figure out. Obtuse documentation strikes again! Fortunately, I was able to figure it out relatively quickly, and my test installation on a VMWare instance of Windows Server 2003 was a smart move on my part. I screwed it up twice, and had to start over, so I didn't bring down any websites with my lack of experience.

Tip #1: If your SQL Server is on another machine, download and run the Sharepoint Services installer (Observation: Why is the installation program named with the initials of its former name, “Sharepoint Team Services”?). As soon as it unpacks everything, it will begin to run the main installer. Click cancel, and it will close out. Open up a command prompt, and navigate to the “Program Files\STS2Setup_1033” folder. The type “setupsts remotesql=true”. The installer will run with a new “Web Farm” setup optin underneath the “Typical Installation” section.

Microsoft Suckage Alert #1: More often than not, the SQL server will be located elsewhere. I should not have to fire up a command prompt to be able to get this option.
Microsoft Suckage Alert #2: What's with the “Web Farm“ crap? I can have a SQL Server and a Web Server on two different machines (oh wait, I DO have that) and not be in a Web Farm. That's way confusing. Call them “Single Server“ and “Multiple Server“ installations, and stop trying to preserve market share through consumer confusion.

Next, it's going to ask you to set up your SQL Server connection. Supply your credentials, select a database name, and continue.

Microsoft Suckage Alert #3: If you look at the database structure, you'll see tables named “Sites“ and “VirtualServers“, and Stored Procedures named “sproc_dropSite“. They assume that you'll always have a separate database, and would never integrate it with another existing database. a) Don't make undocumented assumptions, and b) It's safe to assume that if it shows up in the “Stored Procedures“ section of SQLEM, it's a SPROC. MS, you really need to change the DB structure to prefix everything with something like “WSS_“ or “sharepoint_“ so that Sharepoint stuff can reside in existing databases.

Configuration:
Configuration is an interesting and complex process. Because there is no dynamic UI, get ready to spend A LOT of time with click-throughs and postbacks. ASPnetMenu, anyone? Anyways, after the installer completes, it will launch the Windows Sharepoint Services administration page, where it will give you a bunch of confusing options regarding “Extending Virtual Servers“ and “Creating Top-Level Sites“. More jargon to wade through. You're probably going to want to “Create or Extend a Virtual Server“.

Tip #2: DO NOT install Sharepoint services on an IIS web that has content in it. Windows Sharepoint Services is based on ASP.NET, and uses a bunch of HttpHandlers to intercept requests. Your best bet is to run them out of a separate DNS Subdomain, like http://sharepoint.yourwebsite.com. Better to eliminate the possibility for hassles by keeping things separate.

Along those same lines, the documentation says to uninstall FrontPage Extensions is they exist on the server. The problem is, they don't make the distinction between IIS virtual servers, and the machine itself. I'll clarify this for you here: You can leave FPSE installed on the machine, but it cannot be installed on the IIS Web. If you extend a clean IIS web in a separate subdomain, like I said in Tip #2, you should be fine.

When you click “Extend or upgrade virtual server“, you will be given a list of IIS webs on the server. If you have FPSE install, chances are you'll see is how that site's version as “5.0.2.5012“, and it will ask you to upgrade that site. Do not mess with these sites, unless of course you enjoy making your life more difficult. Click on http://sharepoint.yourwebsite.com, and you'll be taken to the confirmation page, where you are given two options: “Extend and create content database“ or “Extend and map to another virtual server“. The first option is the one you want, unless you already have a Sharepoint site, and you want to map another site to it. This would be the option to use in load-balancing situations.

Microsoft Suckage Alert #4: This one rates about a 9.7 on Robert's Scale of Software Suckage (S3 - Patent Pending). When you get to the next page, among other things, it asks you for database access information. The default option says “Use default content database server”. Ladies and gentlemen, if you haven't been paying attention thus far, please do so now. Selecting this option DOES NOT default to the database settings you entered earlier. That database stores only data about the sites that are installed on the server. Unless you specify name and credentials here, Sharepoint will come up with some database name like “STS_server41_1956784809”. The naming convention stands for the server name, and then the IIS web index, which is a hash of the name if you are using IIS6. The only reason this sucks so bad is because it is not very well documented, and the “default” behavior is not the expected behavior. If I created a database in the beginning, I would expect all of the websites I create on that server to be stored in the same database, unless I tell it otherwise.

That's about it for todays's post. I'll be recording my other observations over the days and weeks ahead. Oh yeah, and MS Sharepoint Team, it would be really cool if you could make these things not suck in the rext release.

More Posts Next page »