Archive for December, 2008

How I keep myself motivated 0

When it comes to my career, I like to stay motivated.  When I feel more motivated, not only can I perform better, but I can learn new things faster and I don’t feel burdened by having to go to work.  Every now and again life does throw me a curve ball though, as it often does with just about everyone, and sometimes my motivation may waver a bit.  Through perseverance I am able to get it back.

How do I get it back?  For me, the act of crafting something using my mind, my hands, and the tools available to me grants a natural high.  When I am productive, and when I see customers who are happy (not just satisfied) with the results of that productivity, I feel even more empowered to keep creating.  I feel as if I created a work of art.

Personally, I also feel motivated from learning new things.  When I read about something new and see examples of how it works, I want to apply it to my own situations.  The more I learn about it and come to understand it, the more productive I become with it.  Through that, I come back full circle to productivity as a motivating factor.

Very simple textbox watermark using JQuery 4

If you haven’t heard about JQuery by now, I strongly suggest you go check it out. It is a very powerful cross-browser JavaScript library that simplifies a lot of the script I have to write, and even more interesting is the fact that Microsoft is going to start distributing it as well with Visual Studio and ASP .NET MVC. I had a post very similar to this one on my blog before, but since it got lost, I decided to go ahead and post it again, slightly improved over the last version.

The idea here is to be simple, and do this in just a few lines of JavaScript. I’m not here to teach all of the intricacies of JQuery, as that can best be explained by the documentation on their website.

I’ll start by displaying the HTML element that we will be manipulating:

1
<input type="text" id="textBox1" class="watermarkOn" value="Type here" />

The CSS class on that element is really simple and defines the look of the textbox when the watermark is active:

1
2
3
4
5
6
<style type="text/css">
    .watermarkOn {
        color: #CCCCCC;
        font-style: italic;
    }
</style>

Now to write the script that does all of the action. I will assume that you’ve already set up the JavaScript include for JQuery on the page:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
$(document).ready(function() {

    // Define what happens when the textbox comes under focus
    // Remove the watermark class and clear the box
    $("#textBox1").focus(function() {

        $(this).filter(function() {

            // We only want this to apply if there's not
            // something actually entered
            return $(this).val() == "" || $(this).val() == "Type here"

        }).removeClass("watermarkOn").val("");

    });

    // Define what happens when the textbox loses focus
    // Add the watermark class and default text
    $("#textBox1").blur(function() {

        $(this).filter(function() {

            // We only want this to apply if there's not
            // something actually entered
            return $(this).val() == ""

        }).addClass("watermarkOn").val("Type here");

    });

});

And that’s all there is to it! If you’re using this on your site, you’ll probably want to do a bit more customization and such, but these are the basics. I skimmed over a lot of the fine details, I know, but there really isn’t much more to it than this.

Think about the "user" when it comes to "user experience" 0

I have one big pet peeve when it comes to my daily work as a software developer, and I see it in all types of applications across the web and on the desktop: applications designed without taking the user experience into consideration.  By no means am I saying that an application should have a masterfully designed interface that requires top notch designers and artists, but at least a workable UI that makes functionality obvious to the user is desirable.

One thing that makes me cringe is when the UI of an application is not consistent across the application.  Sometimes it is difficult to design a UI that will work for all situations, but it is doable, and it makes it so much easier on the users if they know where to look for specific functionality.  I have also noticed, however, that sometimes there is a temptation to use shiny new toys (i.e. third party components) just because they’re available, and not necessarily because they’re the best tool for the job.  For example, in the administration console of a web site: if I use a third party grid on one listing page but do not use the same grid for all the listing pages, we’ve pretty much killed our consistency because there’s a very good chance that they’re not going to look or act the same.  This problem compounds as multiple developers use more components across the application.  By no means is this the only situation that creates inconsistency, but it is certainly a big one that I have experienced.

Another thing that can complicate the user experience is sluggish or lack or responsiveness in an application, especially on pages that utilize AJAX and don’t have any sort of loading indicator.  I guarantee that some users will get frustrated if they click on something, expecting some sort of immediate behavior, and do not get it.  As soon as they do not get it, they start looking around for some answers.  Even just a slow response here and there adds up to be a frustration.  For example, on a form that I had the "pleasure" of using in the past, the AJAX response was slow enough to the point where if you filled out the form and tabbed between the fields faster than the field-by-field validation could process, when it finally did catch up it would kick the cursor back to the field that triggered the processing and erase all the information entered afterwards.  Talk about confusing.

I’ll leave this semi-rant at that.  Needless to say, there are many factors that can negatively affect the user experience, and it takes some careful testing from the user’s perspective to catch them all.  I know as a developer it is sometimes hard for me to catch some of them before the users do.  This is the part of the application that people see and work with, so it is important, if not critical, to get it right.