Tuesday, January 29, 2008

Java Programmers on Windows Forms team?

{

Randomly: worked with the CheckedListBox tonight. It's interesting to run into "getter/setter" type methods in the .NET universe.  One would assume a collection that specifically supported setting constituent objects as "selected" or "checked" but instead there are methods like: GetItemCheckedState and SetItemCheckedState.

It would be interesting to have the Windows Forms equivalent to the annotated base class library reference. Perhaps tomorrow I'll try to peak at the source code.

}

Disturbing News

{

"I am going to tell you something that will disturb you. You might laugh, but it will be a cold uncertain laugh that will haunt you as you read on, because somewhere deep down you'll know it to be true. You might brush it off, get on with your day, yet sometime later, a week or a year, it will seep back in and unsettle you to the core. From that moment on you will be changed. You will think different, act different and will fundamentally be different. So take a moment to prepare yourself now, breath deeply, clear your mind and open up to the possibility that building software is hard."

Interesting thoughts from The Wayward Weblog

 

}

Thursday, January 24, 2008

Not An Engineer

{

Ravi Mohan makes the provocative, if not new claim (with follow up) that programmers are not engineers. I take the majority of his quibble to be the title some flaunt: "software engineer."

I've never felt able to use "engineer" for myself, but I don't perceive this badly. My official title is "software architect" though most of my day is not spent on architecture.

It's a bit postmodern of me but does anyone's title mean much?  Short of very specialized work, one must have multiple skillsets for the different roles they are cast in on a daily basis.

I have to do the following, fairly regularly:
1. Write Code
2. Write Specs
3. Customer Service
4. Testing
5. Write Proposals
6. Mentor
7. Marketing

I'm owning up to a lot of stuff, particulary #7, that I would never admit to for the sake of saying that most jobs these days require multiple intelligences.

Think Santiago Calatrava: engineer, architect, artist. And he deals with clients, too.

}

Temporary Switch Back: C# to VB.NET

{

I did the switch back for a project that a VBA enlightened client requested but I kept finding myself asking how to syntactically do what I usually do in C# (especially inheritance-wise) in VB.NET.  Terry Smith has a handy online book that has a comparison so that you can easily figure out what the VB.NET syntax is for what you know how to do in C#. I'm not sure when it was written; no word on Generics but that's an easy enough syntax to duplicate with (Of T) rather than angle brackets.  What throws me off in addition to the inheritance verbosity are a lot of the array related casting operations that seem intuitive now in C# like:

Dim dropRows As Row() = e.Data.GetData(GetType(Row()))

Of course with the latest developments in VB.NET, I may end up using the language enough to make all of this easy to recall from memory. 

As much as I want to join the Red Sox fans in cheering for VB, there are still many things that annoy me about the language.  Line continuation characters are at the top of the list, and case insensitivity closely following. Yes, I strongly dislike case insensitivity in a programming language.

}

Tuesday, January 22, 2008

Up In The (Ruby) Club

{

A while back I had a phone call from a woman with an eastern European accent wondering if I would be willing to take a survey.  I'm usually an instant no to queries like this but she knew my Achilles heel:

"Participants get $50 Amazon Gift Certificate"

So a few days ago my inbox chimed with an email with the gift certificate in tow. I didn't hesitate with my purchase of David Flanagan's Ruby book

As an aside, it seems that Flanagan got some flack from a Gilles Bowkett on not being a bona fide Ruby person. If Flanagan isn't cultured enough to do Ruby, I'm in trouble...

... but I've been in trouble most of my short puff anyway.

On a serious note: the "up in the club" attitude of some (okay, mostly Rails) Ruby people is what is driving a backlash against Rails and Ruby in general.

}

Friday, January 18, 2008

Nutrition

{

I just looked at Oliver Steele's programmer's food pyramid and did a self evaluation of sorts. I know that I err too much on the reading of "blogs" versus reading long prose about programming.  That's something to change this year.

As well I use libraries a lot without digging into anything once my problem solving is done.  I think there's a form of mental stamina in digging deeper into a problem once you've apparently solved it - my instinct is to simply move on and try to tackle what's next.  Now that the .NET Framework code is available, that and other libraries should occupy my reading time.

While I don't struggle with the inclination to write code, I've long since thought it's better to try to write different types of applications and build some breadth.  Especially after my umpteenth web based CRUD app, I'm now interested in blending Windows Forms and Web stuff in the small variety of utilities that I compulsively write.

}

Wednesday, January 16, 2008

What's It Worth?

{

In the wake of all the plastic surgery and body augmentation going on around, a developer like myself can feel a little out of place - out of century to be more exact. 

And yet, whether he's joking or not, I'm half tempted by Wesner's admission to "performance enhancers."

But the thing I know with certainty is that being productive will only beget the desire to be more productive. Instead of learning and implementing 4 technologies, it will be 8.  I'll pile more home projects and "meware" until I'm aching for another 5 or 6 hours a day.

In a world that has the audacity to produce ridiculously smart people who are subject to feeling that yet others are "smarter" I may as well hold.

But it's tempting... maybe until I know F# and then I'll hold...

}

Saturday, January 12, 2008

13.75 hours, CodeMash

{

I earned the reputation as "the guy from South Dakota" at CodeMash; many people were amazed that I took it upon myself to drive just under 14 hours both there and back for the conference.

What would they have done if I told them I also:
a) took time off from work
b) paid for it out of pocket
c) drove my own car

But I think it's not *that* strange. Staying at work would have meant the same old stuff I do every day all year and instead I got to see some of the best Einstein's presenting on Python, DSLs, Dojo, REST, and IIS7. I made some friends as well and on top of that got to kick it with Scott Hanselman.  All for the cost of a long drive with an audio book.

I had posted on sessions I wanted to see, here's a little rundown of memorable sessions I actually attended:

1. Neal Ford's keynote "Software Engineering & Polyglot Programming"

Neal's one of those sedate cognoscenti who don't appear to have an emotional angle on platforms, just a sense of design and engineering that they wish to communicate.  In his talk he urged developers towards the notion of language as a tool, and that dynamic languages take us places that our old friends in the static realm cannot.  He made a reference to Jack Reeve's essay which I've written about before, and said a few times the following phrase which I thought was apt:
"Testing is the engineering rigor of software development."

If I could have asked Neal, I'd have wanted some comment on something I posted some time back - Oliver Steele's blog post on The IDE Divide in which he divides developers into the Language Mavens and Tool Mavens.  I think Neal's perspective was very much that of a language versus tool maven.

2. Catherine Devlin's "Crash, Smash, Kaboom Course in Python"
Great talk on Python fundamentals while illustrating a universe simulator library (forget the name).  I've been trying to pick up Python for some time and much of what I got was from watching Catherine's use of the language in her demos.  The one bummer: I was using a Python distribution from my iBook (Mac OSX) that didn't include the Python modules she was demonstrating with. Even more of a bummer: in my hotel room a different laptop was running Ubuntu with just the modules needed to follow along with her in code.

3. Kevin Dangoor on Dojo
I may have made Kevin feel uncomfortable with how happy I was to see this talk (he did a great job) but I've felt quite alone over the last two-ish years working with javascript libraries.  I used jQuery heavily for my tool "proper" after which I used Prototype/Scriptaculous for a few other projects.  I then switched to YUI for nRegex so I'd been around the block with my frameworks with only Dojo missing.  Dojo seems to go beyond these other frameworks just on its ambition alone and I'm wondering if that can translate into a happy mix with the heavyweight stuff I have to do at work with ASP.NET. 

4. Dustin Campbell on F#
Dustin gave a deft introduction to the F# language which had to be the biggest thoughtbludgeon I got during the conference.  I've listed F# as my "someday language" and it will remain so since Ruby will occupy my time along with Python in learning mode over the next year or so. Nevertheless, it was good to see a demonstration of the language and some of the implications thereof.

5. Kevin Dangoor on Gears and Dojo (DojoX Offline)
The second session I sat in on with Kevin, this dealing with Dojo's offline capabilities in large part courtesy of Google Gears.  It was as good as the first Dojo session and left my mind popping with ideas for leveraging that functionality. 
Soon - I'd say around the release of Silverlight 2.0 - people like me are going to face a fork in the road of using browser plugins and thick (they use the word "rich") vendor technologies, or using javascript and existing web technologies like CSS on a new level.  All the Dojo stuff represents, to me, what Microsoft and Adobe (no need to even mention JavaFX, oops I just did) are not tuning to as they ramp up Silverlight and Flex.  Not that it's in their interests: the stuff of web standards isn't really the profit center that proprietary technologies are.

6. Neal Ford on DSLs with Dynamic Languages
Neal was impressive this second time with some practical talk and examples of DSLs.  He started first with Groovy, which left me disappointed since I don't anticipate using it, but to show the "best" world he switched to Ruby.  I am really looking forward to IronRuby's release, but at present I think much of what he discussed can be implemented in Python. 

7. Dave Donaldson on RESTful Web Services
I've been familiar with the REST buzzword for some time but as a term thrown out in competition with standard web services (the WS-* stuff).  Dave did a good job of unpacking the essence of REST and showing demonstrations of usage.  It's interesting to see just how much backlash there is against WS-* and the manufactured complexity therein.  The only thing I disagreed with was Dave belittling Dave expressed reservations about the Astoria project teetering into the over-engineered realm of WS-* but I am hopeful it will retain its original intent - I really, really like the idea of Astoria (born of the same backlash to WS-*? I'm just talking here...).

8. Scott Hanselman on Mashups with IIS7
He has the gift and he knows it: first with a humorous prologue and then with a good presentation on IIS7 and using its underpinnings with a mix of PHP. Inspired by Bill Staples article on IIS7 and PHP, but with the detail and demonstrations with which Scott's earned his following.

I went to a few other sessions too, but these were the ones which, as the Brits say, "tickled my fancy."  I was disappointed to miss out on Jay Wren's intro to Castle as well as Bruce Eckel's thoughts on Python. I guess there's next year...

... and I do anticipate returning to CodeMash although I'm quite sure I'll fly rather than driving. :^)

}

Wednesday, January 02, 2008

Enemies and Organization

{

I usually try not to be an echo chamber, especially when posts show up on Coding Horror or Steve Yegge's blog. But what's interesting is a rebuttle to a notion that Yegge started, namely that size is an enemy in code base.

Franz Bouma has an interesting post to follow up that is worth a counter balance of views.

Conventions:

I commented once about LoC in one of our projects, not so much with an interest in maintainability, but as a comparison with how much code was being "generated" on my behalf by the IDE.  The project has grown since that post which had the codebase at around 30,000 lines of code.  This is nowhere near the 500,000 line mark but one design decision made early on that has always helped in navigating around was the heavy use of conventions.  Because we followed a pattern for where we put things, it's easy to find which project a piece of code is in as well as which part of the code one needs to dive into to make a modification. 

Abstraction:

One thing I'm noticing about the open source projects I look at is how layers of abstraction can lead to the kind of indirection that's hard to follow.  I speak only of ideals but it seems like too much abstraction can lead to the kind of confusing codebases that people online are reacting to. That logic may be the Mort in me going against the grain; it seems like many think that indirection and abstraction may add flexibility, but that flexibility will be a trade off for how easily a person, especially not the original author, finds their way.

}

Sunday, December 30, 2007

xPathFinder

{

The short version:
I'm releasing xPathFinder, a tool I wrote for doing XPATH expressions against xml files on the file system. You can get information about it as a tool by going to the website. Here are some screenshots:

 

The long version:
Not too long ago I ran into a problem that I thought would be common but didn't seem to have a canned solution. We use a webservice to store some data in a database but we also store the xml files transmitted on the file system as a defensive maneuver in case the database is unavailable or the xml is invalid. After a while I was dealing with a lot of xml files - far too many to search one at a time and needing more structured lookup than a desktop search tool offered. This is the raison d'etre of this tool. Of course it could have been a quick script in -insert language of choice- but this was something I needed to do repeatedly and have more facility with than console output. I'm also planning to make it simple enough for our client to use. It was a goal of mine to get it up before the end of the year so I'm happily posting this a day early.

One more footnote to this tool - stylistically I've done quite a bit of blending between Windows Forms and Web by leveraging the WebBrowser control heavily for things I thought would be easier to quickly generate html for as well as the feedback mechanism which allows users to report bugs or request features. It's so tightly coupled that while it will work without an internet connection, it's a much more limited experience. I really like this model and will probably start doing more blending like this for new work.

You can get more detail from the website or just ask directly by submitting feedback.

Future plans?

1. XPATH functionality works for most xml documents, but namespace heavy documents with prefixes seem to throw a curve ball.
2. What I'm posting was actually a fast prototype I intended to use to make this tool in WPF from - I'm not sure that the WPF step is still necessary but I may release an updated version since this is a fairly straight forward utility.
3. I'd like to make it open source. Not sure of what steps to follow, but CodePlex is probably the best starting point. I always promise myself I'll clean up my code before doing something like that but maybe I should just bite the bullet since I think the idea is sound enough.

}

Tuesday, December 11, 2007

Installing ASP.NET 3.5 MVC Preview

{

Code Climber has this great list of what you need to download and the order in which you must install it. I just completed my installation and have begun to poke around.

}

Thursday, December 06, 2007

Someday Language: F#

{

There's a lot to learn these days (whenever isn't there a lot?) and one thing I will do for 2008 is make a list of technologies I'd like to dive into with some sense of priorities. 

Among the ASP.NET MVC, Powershell 2.0, and Iron Python (for starters) I've been interested in F#. First as a topic on Hanselminutes but I lurk on Harry Pierson's blog and he's been posting about it quite a bit.  Here are some links:

1. F# Overview on hubFS
2. From DevHawk:

Someday it is.

}

Mads Samples

{

Mads Kristensen has a listing of his code samples. One thing I like about Mads' samples is that they are all very straightforward without unnecessary layers of abstraction.

}

Wednesday, December 05, 2007

The FogBugz Salesman

{

Once or twice people have confused what I'm doing with sales. Some time back I met with a prospective client and kept having to explain that I actually do write code and would probably be a lead developer on any work they gave us. The reaction I had for even the mere perception that I was "sales" was a little surprising to myself although with some reflection I realized it was because I conflated most of what I disliked about salesmen into an image I couldn't deal with for myself:

  • Style over substance
  • Shallow understanding
  • Pandering for a quick buck

But once in my life I was a happy salesman. Some time back I pushed the company I worked for into adopting FogBugz and really building a large part of our lifecycle around it. I did so enthusiastically after reading Joel's early essays on bug tracking and seeing how well it applied to our situation.

I've seen other bug tracking software since but still think the FogBugz experience was best.  It seems simple, but because of how much thought has gone into the product, I gather a lot of work has gone into keeping it stripped from unnecessary features.

To be clear, I don't work as a bona fide "in house" developer. But as a consulting company, I spend a lot of time playing that role or working with people in it.  It's therefore conflicting when I read his understanding of what it means to work in house. Phil Haack had it right in the middle of 2005 when he wrote of the irony of this disdain towards the people that would be excited to use his software in the first place.

I wonder what kind of conditioning it is - maybe that I've liked musical artists who are fairly open about loathing their fanbase - but I still miss the simplicity and elegance of FogBugz. 

What's sad these days is that as much as I'd like to slip on the poorly fitting suit and do my sales routine, we get Sharepoint for free (okay, not free but let's just say Microsoft does an excellent job making it seem so) and it's the environment in which we track what I'd gotten my previous company to use FogBugz for so effectively.  I'm not a big Sharepoint fan (that's an understatement) so I'd even be tempted to go The Powers That Be and ask for FogBugz if I couldn't predict the answer right away.

Tomorrow I'll be unflustered but I've got a few comments on what it's like to be in house:

1. In a small enough company, it's great to have decision making power.  I've used technologies like Ajax and Perl where a larger environment would have involved committee meetings with some manager shooting me down for doing things differently. You don't have to be a renegade to do this, just document what you do well and communicate with anyone you're working with that may have to look at it on your behalf.

2. In consulting it helps a lot to condition your client.  First build confidence with a track record of success, after which the client is usually willing to listen to you when you'd like to do things "right" or improve a piece of software even if it's getting by functionally.  After a while, depending on the client, they will usually just trust your judgement and stay away from technical arguments unless there's some disproportionate cost.

3. Software is never finished.  This is true even for what is developed in house.  As a result the process of continual improvement still exists.  It takes a tremendous amount of discipline to try to develop things right when there's a small budget or a tight deadline but I always think of those moments I've spent late at night hacking the ugliest workarounds because of a bad initial effort. Most of the time finishing when it's "good enough" is about the taste and craftsmanship of the person who writes the software; whether they tried to think of the future or not.

4. From working in both a "software company" and a "consulting company" I understand that software development is always a process of coming to terms with friction - all the unexpected realities and circumstances of real life and real users. Different places will have different kinds of friction; where an in house developer may have to deal with the kind of discipline it takes to write unit tests on a deadline a programmer at a software company may have the dilemma of trying to be all things to all people.

}

Tuesday, December 04, 2007

Comment Spam Begone

{

I maintain a few personal websites, one of the closest to my heart is phoDak, a photoblog.  I wrote the site using ASP.NET about two years ago and intended it to be a low key, personal area to post pictures.  I had absolutely no validation on comments and my "what will be" attitude worked for a long time until about a week ago when I saw a comment spam link to porn right off the most recent picture.  No longer avoidable, I looked into a few ways to block unwanted comments and came up with a hybrid approach:

1. Use a photo/word as validation for a human user, just like Jeff Atwood's blog.
2. I heard about Akismet from Phil Haack who mentioned it in passing on a Dot Net Rocks episode. I found a free library and wrote about 10 lines of code:

AkismetManager akismetManager = 
new AkismetManager("my key", "my site");
string ip =
Request.ServerVariables["REMOTE_ADDR"].ToString();
if(akismetManager.IsValidKey()){
AkismetItem item =
new AkismetItem(ip, Request.UserAgent.ToString());
item.AuthorName =
CommentOwnerTextbox.Text;
item.AuthorUrl =
CommentURLTextbox.Text;
item.Content =
CommentTextbox.Text;
if(akismetManager.IsSpam(item)){
akismetManager.SubmitSpam(item);
return;
}
}

Q.E.D., really. Somewhat Mort-ish for me to lean solely on the library but it works beautifully: my spam comments since implementation remain at absolute zero.


}

CodeMash: I'll be there!

{

On a whim I've signed up to be at CodeMash 2008.  After learning about the conference when Hanselman posted he'd keynote, I mapped out that Sandusky, OH (Whiskey, Tango, Foxtrot!) is none too far (an audio book's worth of distance).

I'm really looking forward to the opportunity to walk among Elvis and Einstein, hopefully gleaning some direction along the way. The session list is impressive, I'm thinking it will be hard to choose a particular direction.

I've been studying Python of late, so I'm really looking forward to Bruce Eckel's Why I Love Python. Another interestingly titled Python presentation Crash, Smash, Kaboom Course in Python will be run by MIT alum Catherine Devlin.  Finally on the Python front, I'll try to squeeze into the Getting Started with Django session.

On the "indy" .NET programming, I'm interested in the Introducing Castle session from Jay R. Wren. Because Hanselman is going to be there I can't imagine no mention of ASP.NET MVC stuff, so hopefully it will somehow be mentioned at least comparatively.

Jesse Liberty is going to present on Silverlight, so that's something I won't miss either. There are other Microsoft technology presentations I should see but it would be hard to sit in on a Sharepoint session when I could be learning Python design patterns.

The other area of interest I'll have is the Dojo stuff, two sessions in particular: Overview of the Dojo JavaScript Toolkit and Working Offline with Dojo+Google Gears, both by Kevin Dangoor.

Well, it should be interesting from start to finish, I'll be working on my note taking skills so that I can share what I do learn.

 

CodeMash – I'll be there!

}

Monday, December 03, 2007

Tis the Season

{

Don't get me wrong, I love Christmas too, but I really like the Advent Calendars that wind up the year. 

24 ways
Drew McLellan and his crew have been putting together web development tricks to round out the year for the last few years.

Perl Advent Calendar
None too late and looking like it was designed by a Perl programmer.

Two advent calendars I'd love to see:
1. Microsoft .NET
2. [Iron] Python

}

Thursday, November 08, 2007

Firefox 3 Coming

{

LifeHacker has a first look at the forthcoming Firefox 3. It's interesting to see lots of improvements to the storage and management of places visited online - I'm sure this will provide inspiration for the Internet Explorer team at Microsoft to implement cool new features too.

A feature I asked for (and got a skeptical response) was the ability to do what Firefox seems to aim for but in a Google-ish way. That is to say that it would be nice to have a browser history management/search capability that precluded real effort in organization. In simpler terms, the whole "search, don't sort" experience one has with Gmail, except with browsing history and favorites.

}

Tuesday, November 06, 2007

Web Shell: Prototype & IronPython

{

I've been experimenting with IronPython of late trying to get the gestalt of Python as a language.  It occurred to me that something I had been thinking about for a while as a web project would make sense as an Iron Python project so I dabbled a bit.

The idea I had was a command line type application that approximated commands going to a windows shell and sent the results back to the user.  It's a part of a larger suspicion that I've had: that command lines are crisp, efficient user interfaces that are easy to lose sight of because it's not a natural way of thinking on the web.

The screen shots tell you the basic story: you open your browser to nothing but an underlined textbox after which you type your command and press the enter key. 

The client code is pretty straight forward - I've become disillusioned with YUI and moved back to using Prototype:

function runCommand(cmd){
    var request = new Ajax.Request(
        'eruServer.aspx',
        {
            parameters:'cmd=' + cmd,
            onComplete: handleResult
        }   
    );
}

function handleResult(response){
    $('loaderImage').style.visibility = 'hidden';
    var cmdResult = response.responseText;
    $('stdoutDiv').innerHTML = '<pre>' + cmdResult + '</pre>';
}

So that's all pretty simple, on the server processing the request is equally simple in IronPython.

from System.Diagnostics import *
from System.IO import *

def Page_Load(sender, e):
    cmd = Request.cmd
    p = Process()
    p.StartInfo.FileName = "cmd.exe"
    p.StartInfo.UseShellExecute = 0
    p.StartInfo.CreateNoWindow = 1
    p.StartInfo.RedirectStandardInput = 1
    p.StartInfo.RedirectStandardOutput = 1
    p.Start()
    myOut = p.StandardInput
    myIn = p.StandardOutput   
    myOut.WriteLine(cmd)    
    p.StandardInput.Flush()
    p.StandardInput.Close()
    output = myIn.ReadToEnd()
    p.StandardOutput.Close()    
    p.Dispose()
    Response.Write(Server.HtmlEncode(output))

The web project is fairly small - go ahead and download it here. If you have any improvement, let me know - I'm not sure how to start this as an "open source" affair but it would be a great solution as a light weight tool for remotely operating on a server.

Oh yeah, security: I was thinking of simple NTFS permissions on the files along with Windows Security on the website.  Should do the trick...

}

Monday, November 05, 2007

Innovative Thinking

{

 

There are some great videos at the Business Innovation Factory -

Jason Freid (37 Signals) -
I've been watching these guys for a long time. Although I'm a little resistant to some of the accolades associated with them, the 37 Signals crew thinks clearly and has a clear identity with which they seem overwhelmingly successful.
My favorite comment is Jason saying that they (37 Signals) want to be "enemies of mediocrity."

Richard Saul Wurman -
I first learned about Wurman from TechTV's "Big Thinker" series - although he is trained as an architect his career spans the sort of multidisciplinary mix that makes him special. He originated the TED conferences which have become quite popular of late. He's got an interesting new project called 19:20:21, be sure to check out the information graphics.

Clay Christensen -
One of the most interesting thinkers in the theory of business at present.  I wonder if Clay is more an economist than what one would consider a conventional "business" person. His gifts as a teacher shine through in this particular presentation.

 

}