About the author

Steven HarmanSteven Harman is a passionate developer who believes that writing great software isn't just a job, its a craft.

ASP.NET MVP

For recent posts and more about me, scroll to the bottom.

Subscribe

  • Subscribe to my feed. via RSS
  • Subscribe via email via email

Jobs

Badges

  • Subtext Project
  • Support Subtext
  • HiddenNetwork.com Banner

programming

There are 15 entries for the tag programming

The Developer Exchange Program

This week I was having a conversation with some fellow developers at the ALT.NET Open Spaces conference and an interesting topic came up. We were talking about vast amounts of time, mostly personal time, we spend trying to improve our skills and our craft. We spend time reading and writing blogs, books, mailing list messages, attending and giving talks, contributing to Open Source, and reading and writing code. We spend a huge number of hours in the quest for continuous improvement. Self-teaching is good We all agreed that self-teaching is important and we do it because we...

Stop Refactorbating or You'll Go Blind!

During a hallway conversation at CodeMash a few of us were telling war stories and/or fish tales about some of the coding horrors we’d seen over our careers. At one point the conversation was focused on code churn and compulsive refactoring. And then suddenly, without warning, I blurted out a single word that caused the entire discussion to screech to a halt. That word: refactorbation. When I looked around I saw a smile on nearly every face, but could tell that no one knew what I was talking about. And why would they... I didn’t...

Anonymous Delegates, Events, and Lambda Fun!

Events and delegates aren’t exactly a new concept in the .net world. I might even go so far as to say that they are fairly well understood by most experienced .net developers. That’s not to say the concepts behind them are easy to grok... I’m just saying that if you know developer who’s been around the .net-block a few times, he/she probably has a pretty good grasp of what a delegate is and how they’re used. Am I such a developer? Up until yesterday I thought I was. Here’s the scenario I found myself in: I...

A New Year's Resolution for Developers

Your Resolution this year should be: If you aren’t sure, make it public... and make everything virtual (or overridable, depending on your language) by default. Of course this primarily applies to those folks building frameworks for statically typed languages... <cough> Microsoft <cough>, but it also holds weight for the rest of us. After all, we all want other people to use our code - even if other people is your customers, your team, or yourself. The point is, we want our code to be (re)used. And I don’t know about you, but I’d...

Replace that Stinky Code with a Bitmask and the FlagsAttribute

Pretend that you’re building an application to do something like... oh I don’t know, track employee time. Applications like this exist in almost every company on the face of the earth. After all, time == money, duh! Lets also pretend one requirement of your time tracker is to keep track of the employee’s regular work hours - meaning their start/end times and the days of the week they work. Again, seems like a pretty simple and intuitive requirement for a time tracking system. So, here’s my question: how would you go about storing the days the employee works...

It's About Being Disciplined and Open Minded

So here’s the deal... lately Rob has been kicking the hornet’s nest and stirring up all kinds of controversy, and discussion, amongst the asp.net community. The conversation is mainly focused around the use of inline scripting and plain old HTML camp versus the more traditional asp.net way of doing things with all server side programming and PostBacks. The conversation is challenging some of the core concepts that many asp.net developers hold true. Concepts and practices that Microsoft has handed down as gospel over the past several years. It’s a good old fashioned holy war. The kind that gets...

Learning To Count, Again

Quick, how many discrete values are between zero (0) and one hundred (100)? I’ll wait here while you count... Possible correct answers, depending on how you interpreted the question and how you count, are: 99 100 101 ∞ Why so many answers? This is a classic example of a fencepost error, also commonly known as an off-by-one error. It’s all about how you count! Let’s discuss each of the above answers one at a time. ...

Add Option Elements to a Select List with JavaScript

While working on a web application I had the need to dynamically add new Option elements to a Select element (drop down list) using some fancy client-side JavaScript. The obvious solution was to do something like this: var theSelectList = $('theBigFatSelectList'); var myNewOption = new Option("My Option", "123"); theSelectList.selectedIndex = InsertNewOption(myNewOption, theSelectList); function InsertNewOption(newOption, selectElement) { var optsLen = selectElement.options.length; selectElement.options[optsLen] = newOption; return optsLen; } And it worked just as I’d expected. I got a new option in the drop down list and all was right with...

Use the PageRequestManager to Get More Control of Your UpdatePanels.

Being Web 2.0 is a hot topic right now. So much so that everyone and their mom is out to dress up their web presence with whatever Ajaxy goodness they can. Lucky for the Internet the ASP.NET AJAX framework has made adding Ajax functionality to asp.net web sites and web applications a pretty simple task. The simplicity is made possible because the framework hides much of the magical mechanics of doing the actual Ajax and DOM work behind a new control, the UpdatePanel. However, like most magical solutions this one comes at a cost. Actually a couple of costs. Two...

URL and HTML Encoding on the Client? JavaScript to the Rescue!

Phil recently wrote about some of The Most Useful .NET Utility Classes Developers Tend to Reinvent Rather Than Reuse - an article chock full of tasty tips, tricks, and reminders about [.net] framework features you forgot (or never knew) existed. One of the utility classes Phil mentioned was the System.Web.HttpUtility class. Two of the super useful methods this class offers are UrlEncode and UrlDecode... used to uh, convert a string into a URL encoded string and decode a URL encoded string, respectively. Do you encode? All web developers, regardless of language/platform, should be intimately familiar with the basic encoding schemes...

Tip: Put Connection Strings in Their Own Configuration File

asp.net 2.0 introduced a new section in the web.config file -ConnectionStrings. This new configuration section allows you to add connection strings in your web.config, like we always have, or in a different data source. In Subtext 2.0 we're using this new feature to split the connection string out into a new configuration file, user.config. Doing this should make day to day development easier for our development team by reducing the number of merge conflicts in web.config. Since most every developer has a different database configuration, it makes sense to keep this information in its own file and away from the...

Does Web Software Need a 'Check Engine' Light?

A recent post by security analyst David Kierznowske reports that 49 out of 50 WordPress blogs that he checked out were running an exploitable version of the WordPress blogging engine. According to the post, David looked at blogs running on versions as far back as WordPress v1.2 (with v2.2 being the most recent release, as of this writing). So does this mean that WordPress is buggy software that is to be avoided? No, not at all. It just means that those users need to do a better job of dealing with the bugs. The sky is blue and software has bugs...

[Note to Self] SubSonic Requires a Primary Key for Every Table

After stumbling over this a couple of times in the past week I decided to blog-it so I won't forget again. By convention, SubSonic requires that any tables to be auto-generated into the DAL have a primary key. #1 sign you're missing a primary key You have your super-sweet database humming along in it's fully normalized form. You try to generate your DAL with SubSonic but one of your tables isn't being code-gened. For example, if you have a Customer table then SubSonic should generate the following three classes: Customer CustomerCollection CustomerController Note: Customer and CustomerCollection will...

Remote Debugging without the Administrator Account, a Gotcha'

A Reflection on Lessons for the Young Developer

In his Working for The Man piece Jeremy Allison lays out six lessons he's learned over the course of his career in software; six lessons he'd like to go back and tell himself at the beginning of his career. Whether you're a code-slinger just starting out or a seasoned veteran with wisdom and design patterns coming out your ears, this is a great read. So go read it now... I'll wait. This is me, waiting... See I told it was good, didn't I? Even though I've only been in the software business for half a decade I've already learned many of...