Archive for April, 2009

Travel, training and tempers 0

This is going to be short. This week, my company has sent me half way across the country (everything is half way across the country when you are in the mid-west) to SharePoint MOSS Development training in Tampa, Florida. I’ve been wanting to compile a day-by-day review of the course, in the spirit of Ferverent Coder’s review of the Nothin’ but .Net Developer Boot Camp NBDNDBC (I guess acronyms don’t always work). He has a wonderful review of a training seminar I’ve been wanting to go to for a while now, and his review further solidified my desire to attend. Anyway, I want to do the same thing, but don’t have the energy at the end of the day, and my days aren’t nearly as long as his.

I did want to pass along some travel tips and tricks I’ve learned in the past few days that might make your trip more pleasant than mine.

1. Fly direct. When you have to get from point A to point B, the weather in point C should not be of your concern, unless of course point C is Chicago, Atlanta, Denver, or one of the few other air plane magnets in the country. I didn’t have a choice in booking my travel, which could have been booked direct through Southwest, so instead I had a scheduled itinerary of 10 hours, but after delays because of weather half way across the country, it took 15. Google tells me I could have driven the entire length of the journey in 16 hours and Southwest could have brought me there in two. So lesson one, fly direct…or move to a hub city. Programming lesson: Tight coupling is bad.

2. Bring headphones. When attending a lecture/lab style training session. It would have been nice to have head phones to drown out the chatter of everyone else or question you don’t care to hear answered. Programming lesson: Law of Demeter.

Class is starting, so more later.

Dark IDE Colors v2.0 3

I’ve been a long time supporter to dark IDE settings. After recently spending some more time in TextMate, and seeing some presentations given in Visual Studio with a setting that more closely matches my favorite TM theme, and seeing HippoEDIT ships with the same theme, I’ve decided to tweak my current dark theme to be a little close to TM.

Here is what it currently looks like for C# code.

image

Here is some XML.

image

Some CSS:

image

And some HTML.

image

Something interesting here is that I’ve given different styles to inline HTML elements (e.g. label) vs block HTML elements (e.g. div, p). You can do this by going to Tools | Options | Text Editor | HTML | Format | Tag Specific Options…

The biggest bummer here is for ASP.Net controls you can only style the leading control prefix.

image

RubyMine vs VisualStudio: Editing CSS Properties 0

I’m not a closet fan of JetBrain’s products. ReSharper is a dream and I can’t imagine hate coding anything without it. Recently, I’ve been using the RubyMine Beta as JavaScript editor. I’ve really liked it, and it far exceeds Visual Studio with only the fact it doesn’t keep shifting my JavaScript around while it auto indents, un-indents, then re-indents. It does many more things better than Visual Studio, but this was the madding factor that made me search for something new.

The more I use it for JavaScript, the more I find myself editing other file types in RM as well. Most recently, I was working in one of our Stylesheets and found it’s UI for editing colors far exceeded the VS equivalent. Let’s take the following example. Let’s say I want to edit the following CSS class.

.note-type-Glitch-Active{
    background-color:#D3262E;
    color:White;
}

VS will let me right click inside the class, and click “Build Style”. I get a nice dialog window to edit the style.

image

Nice huh? There are lots of switch to flip and buttons to click. My complaint is you took me from something succinct, and cluttered it with a bunch of options I don’t care about. Do I really need to click a checkbox to make it blink? I clicked on “background-color”, chances are I want to edit that.

OK, I’m being picky, but I really do want to change the background color. So, I click Background, and then swatch color, and then the custom dialog, because how often do you pick from their swatch pallet?

I finally end up here.

image

What glorious color picker dialog? I swear this thing hasn’t changed since Windows 3.1. It is really pitiful. I’ve complained about this color picker before, but I don’t mind doing it again. I can’t make slider adjustments to the RGB values individually. I can’t adjust saturation via a slider, and go ahead and try to make use of that customer colors palette. It is near impossible. Yuck!.

You can make your change, OK all the way out and you’ve got your new color.

Now let’s look at RubyMine.

image

Hey! Is that a swatch right there in the editor? That’s pretty nice. Single click it and we get a nice picker.

image

It still starts out with a swatch palette, but the preview is pretty nice. Also, the recent color palette is much easier to use.. Click over to HSB.

image

Hue, saturation and luminance adjustments via a slider! Nice! Naturally the RGB gives you exactly what you would expect: RGB adjustments for each component via sliders.

I click once and I’m out of the dialog with the new color.

In my opinion, this is a much more usable color picker. I’m sure I’ll be back with more things RubyMine does better than Visual Studio.

Don’t get me wrong. I love Visual Studio, but there are something other tools do better.

I’m Wasting My Montior 4

I know I’m wasting my 24” widescreen monitor, but I don’t like the layout of the following markup.

<asp:TextBox runat="server" ID="txtPasswordExisting"
   TextMode="Password" />
<asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2"
   CssClass="error" ControlToValidate="txtPasswordExisting"
    Display="Dynamic" Text="Username is required." ValidationGroup="AssociateAccount" />
<cc1:ValidatorCalloutExtender ID="ValidatorCalloutExtender7" runat="server" TargetControlID="RequiredFieldValidator2"
    HighlightCssClass ="error" CssClass ="validatorCallout" />

I would prefer this.

<asp:TextBox runat="server" ID="txtPasswordExisting"
    TextMode    ="Password" />
<asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2"
    CssClass            ="error"
    ControlToValidate   ="txtPasswordExisting"
    Display             ="Dynamic"
    Text                ="Username is required."
    ValidationGroup     ="AssociateAccount" />
<cc1:ValidatorCalloutExtender ID="ValidatorCalloutExtender7" runat="server"
    TargetControlID     ="RequiredFieldValidator2"
    HighlightCssClass   ="error"
    CssClass            ="validatorCallout" />

…OK. It doesn’t display nicely in the syntax highlighter because of the proportional width font, but you get the idea.

I’m sure in most people’s mind it is wasted vertical space, but it makes doing diffs so much easier and my eyes easily see the grouping of controls and their attributes.

A Tale of Awful Design: Smoke Detectors 2

The other night, at the most unexpected time, I got a crash course in usability and design. It was about 2 a.m. and I was sound asleep when I heard “BEEP”. I probably didn’t hear that, but I felt the dog shake the bed as she popped her head up from her night’s sleep. I definitely heard the next “BEEP”, followed but another a few moments later. 

There was no fire, thankfully, but the smoke alarm was telling me the battery was low, and if I wasn’t too busy I should think about changing it. I dragged myself out of bed, trying to find the alarm that was complaining. Check the one in our room, and it has a green light. That must be good, right? Next room, green. Next room, green, too. Next room, also green. The hallway, blinking red. This must be it right? Thank goodness, since I can just reach up and grab this one, and the other three are at the top of vaulted ceilings and would mean I would have to drag the ladder up from the garage. In the hallway, however, I can just reach up and take down the detector, and put in a new battery. I did, and the light changed to green and I was back to bed. Not bad. 5 minutes 0f disrupted sleep.

…Beep.

What the hell? I changed it. Now, the alarms all have a green light, so I spend the next 15 minutes standing in each room trying to figure out which room has the low battery, until I finally just shut all the doors and put the pillow over my head.

Where did my logic fail me? The light was red, which surely means something bad, and I made it green, which means something good, right?  What would I have done if I was color blind? What did it mean when that light went from red to green? I never heard a beep while I was fixing it so maybe that alarm was never the problem.

Since reading The Design of Everyday Things, my girlfriend fiance gets annoyed when I point out how poorly designed a door is. This time she just had to listen the poor design described in very colorful language. Luckily, she was half asleep.

ReSharper Tip of the Day: Peek at opening brace 1

It has been far to long since the last R#TOTD, so to ease back in, I thought we’d take it slow with this one.

If you’re unfortunate enough to have your methods grow beyond what can fit on a screen, or just happen to have the method scrolled off the top of the screen, you can identify those closing braces with ease. When ReSharper goes to match the opening brace for the current closing brace at the cursor, a pop up with a tooltip appears if that brace happens to be out of view. It is very handy in finding closing namespace and class braces.

image

It gets even better in RubyMine with syntax highlighting and a semi-permanent window (i.e. it will stay visible while you scroll). Even though I’m not a Ruby developer by trade, I still use RubyMine for editing all my JavaScript files. The intellisense is great and you get ReSharper-like context refactorings in JavaScript files.

image