Knoxville, TN

How did I get started in software development?

July 13, 2008

OK, Mike just tagged me with this meme, so here we go:

How old were you when you started programming?

I was in 5th grade. (I don’t remember my age at the time, but if someone’s really interested, I can do the math.) I started out by typing in programs from 3-2-1 Contact magazine’s “BASIC Training” column into QBasic. QBasic has a pretty good help feature, so I just moved on from there. Oddly enough, my main drive was to learn how to program video games, which (obviously) never really happened.

What was your first language?

QBasic. I later ended up picking up another BASIC variation called ASIC (because you could compile it), and then Visual Basic 4 from there.

After several failed attempts to pick up other languages (Java, and basically whatever free compilers I could get my hands on), I got into web programming with Perl. From there I went to PHP, then Python (after I took a job with Mediapulse), and finally C#.

What was the first real program you wrote?

I can’t remember. I had a couple of little DOS games that I did in QBasic and ASIC that were pretty polished (relatively speaking).

In 8th grade, a friend and I created a customizable quiz program for a school project and we tried to sell that. It was in ASIC 1.0, which kind of sucked compared to QBasic. Didn’t sell a single copy, but I eventually wrote a more polished version with mouse support and color after ASIC 5.0 released.

If you knew then what you know now, would you have started programming?

Definitely. And I would have had a better idea of what the next step was after BASIC. (Hint: it wasn’t picking up a “Java by Example” book and trying to write graphical browser-based applets.)

Whether I would have made it my career, that’s a different story. Likely so, but I might not have felt as sure that it was what I needed to do. (More on that in the next item.)

If there is one thing you learned along the way that you would tell new developers, what would it be?

Software development is a business, just like any other. New developers tend to think they can solve all the world’s problems–simplifying and automating business processes, creating applications to manage data that’s currently sprawled across several Excel spreadsheets, and things like that. I know; I’ve been there. The reality is, things are like they are not because no one’s ever offered to box them up in a pretty little application. The problem is they’re either very complex problems, or they’re simple, but people don’t take the time and effort to streamline and fix them. And if you want to fix the problem, you’ll have to understand why it’s like that in the first place, or you’ll just be adding to it.

You will have to learn a little bit of business analysis. You will have to deal with people climbing the corporate ladder. It sucks, but just because you’re an IT geek doesn’t mean you get to live in a world full of nothing but code and idealism. You’ll be able to accomplish a lot more good if you prepare for this–just don’t get sucked into it.

What’s the most fun you’ve ever had … programming?

When I was at Mediapulse, they pulled me off of contract work to work on a product called DealStream. Basically, it was a web application that would let funds handle applications for funding. They pulled me in after doing all the high-level planning, so I got to refine the application process and figure out how it translated to a web application. Then I got to code it, and had a lot more leeway to do it right (since it was a product we’d be maintaining and reselling) and make it really customizable. I built the database, then created a Python module to handle the data and process (using a ORM library I’d written), tested the crap out of it (not actual unit tests, but I did step through every possible path in the process), and then built the web application. The great thing was, we’d been working with MySQL, Python, and Apache so long that we really knew our stuff, and so I streamlined deployment and configuration quite a bit.

I worked with our first client to refine it into something that met their needs. Once the first site launched, I took versioning very seriously, since every client had to have their own copy of the software deployed to our web server, and I wanted to avoid branching as much as possible for maintenance reasons. (It’s not a product if every instance of the software is a customized version.) I even started writing a full documentation of the object model.

It was one of those projects that I put a lot of effort into, and just turned out great. (Well, from my perspective; I’m not sure how well it actually sold after I left.) Every time I write JavaScript, I wish I had a copy of the code. I had some really sweet text validation and formatting functions in there.

Who am I calling out?

Since I’m not sure who reads my blog regularly, and Mike has called out most of the usual suspects, let’s go with…

Creating SharePoint Workflows with WSPBuilder and WSS

July 11, 2008

As I mentioned in my previous post, WSPBuilder is a great tool for SharePoint development. Between its built-in commands and its project templates, it takes a lot of the hassle out of setting up SharePoint configuration files for your features and solutions.

However, it’s a little tricky to get it working for workflows, especially if you’re using Windows SharePoint Services instead of MOSS. Here’s what I eventually worked out:

  • Make sure you’re using the “WSPBuilder Project with Workflow” template for your project. I made this mistake this first time through, and nothing worked.
  • Remove references to Microsoft.Office.* Pull out the “ReceiverClass” and “ReceiverAssembly” references in feature.xml; you don’t need them anyway for a basic workflow. (If you do, you can always add them in later.)
  • Remove the AssociationUrl, InstantiationUrl, and ModificationUrl attributes from elements.xml. You’ll need to add them back in if you create forms for this workflow, but not for a basic workflow.

What’s SharePoint Good For?

March 26, 2008

In a previous post I discussed some of the trials and tribulations I’ve encountered with the mandate that we replace our current document management system with SharePoint. From the comments on that post, it sounds like pretty much everyone hates SharePoint to some extent.

Now, users, tend to hate anything that requires that they follow procedure or document their work, so it’s not entirely SharePoint’s fault. But some of it might be that SharePoint is being used for things it shouldn’t be used for. It’s a tool, and just like any other tool, it’s only good for certain situations. And even more to the point, it seems to have certain economies of scale as far as productivity goes.

Continue reading

Linking Membership to other tables

March 17, 2008

I ran into a very simple problem today that, unfortunately, had a somewhat complex solution. A user’s Active Directory login name had changed, and I needed to update his record in a web application which uses Membership to handle its logins.

Now, of course, the easiest way to uniquely identify your users is by username. You can easily get the ID of the currently logged in user from User.Identity.Name. Of course, as I discovered, this is a Bad Idea, because now I have to update 14 fields in 11 tables.

Instead, it’s best to user the ProviderUserKey property of the MembershipUser. This means it takes one extra step to get the current user’s ID: Membership.GetUser(User.Identity.Name).ProviderUserKey

On the other hand, you can pass the ProviderUserKey value into Membership.GetUser just like you did the username.

ASP.Net: URL Rewriting and Login forms

June 10, 2007

Here’s a quirk I’ve been stuck on for a while in the process of rewriting this site in ASP.Net, and just recently figured out a workaround for.

When you’re doing any sort of URL rewriting with Context.RewritePath, all of your pages post back to their actual URL instead of the URL that the user requested. While this is fine if you’re simply redirecting because you changed the name of a file, it’s not so nice if you’re actually using this as the basis for your content management system. Which I do.

First off, if you’re doing any sort of URL rewriting, check ScottGu’s blog post on the subject–pay particular attention to the “Handling ASP.Net Postbacks with URL Rewriting.” This will clear up most problems you have with forms on your pages.

There are, however, a few quirks with the Login and LoginStatus controls (used with ASP.Net 2.0’s built-in membership system) that this won’t fix.

To make a functional login button, capture the original URL before rewriting, and then set the Login control’s DestinationPageUrl property to the originally requested URL.

To make a functional logout button, capture the original URL before rewriting. Set the LoginStatus’ LogoutAction property to Redirect, and the LogoutPageUrl property to the original URL.

Here’s an example of how I did it:

if (!Context.User.Identity.IsAuthenticated)
{
    ((Login)LoginView1.FindControl("LoginForm1")).DestinationPageUrl = originalUrl;
    ((LinkButton)LoginView1.FindControl("LoginForm1").FindControl("LoginButton")).PostBackUrl = originalUrl;
}
else
{
    ((LoginStatus)LoginView1.FindControl("LoginStatus1")).LogoutPageUrl = originalUrl;
}

Fun (?) with Outlook RPC and Wildcard Extension Mappings

May 8, 2007

IIS, Outlook RPC, and things you just can’t test for.

Continue reading

Sorting a GridView Using ObjectDataSource, custom classes, and reflection, part 2

April 27, 2007

In part 1, I covered how to create an IComparer class that uses reflection to sort a list of objects based on a specified property name. While that’s the underlying mechanics that powers our GridView sorting solution, we still need a convenient way to hook it up to a GridView. And so, I extended the GridView class to create the ODSSortableGridView class that does just this.

Continue reading

Sorting a GridView Using ObjectDataSource, custom classes, and reflection, part 1

April 18, 2007

As I’ve mentioned before, I had to figure out early on the cleanest way of populating a GridView, and my choices were down to using TableAdapters/DataTables and business objects. While writing your own classes seems (to me, at least) to be the nicer way of structuring your program–if done right, it forces you to put all of the rules for handling data in its own tier–it gets a bit ugly when you have to hook up your custom classes to some of .NET’s built-in controls. Specifically, it starts getting to be a hassle once you realize that all the automagic goodness of GridView is a product of using the DataTable, and that sorting a list of objects on one member requires writing a whole new custom class per member. Maybe it’s the two and a half years of Python programming talking, but it seemed like there had to be a better way.

Continue reading

×