My List of Tools I Cannot Live Without

February 2, 2010 13:47 | Programming | 4 comments

This one goes out to…me. I’ve recently spent a lot of time setting up new workstations and am soon going to be spending a lot more. This post is a rundown of all the tools and litter helper apps that I absolutely positively cannot live without. Are there some gems in here that you would like? Probably. But mostly this one is for my own sake.

  • Launchy - Simple, fast, open source application launcher
    • Launchy Plugin – Ty to post to twitter from Krzysztof Ko?mic
    • Launchy Plugin – GCaly to post to your Google Calendar
  • ClipX - Tiny little clipboard history manager.  I use this one about 70 times each day
  • WinSplit Revolution – Awesome utility to throw applications between dual monitors and tile them easily
  • Deskpins - A simple utility to force windows to stay on top. Not the love of my life, but the best that I’ve found since xNeat went for-pay
  • Firefox - With the firebug and Web Developer plugins. I really only use it for debugging pages and playing with javascript. This is mostly because I use
  • Chrome - Web browser. It just feels faster, ok? Oh and the too many tabs extension.
  • EditPad Pro – Great notepad utility. Has an unlimited trial version, and I’ve had a license for it for years. I might give Notepad2 a try, but I doubt I’ll make the jump.
  • jZip - Open source zip utility. Handles all the stuff that Winzip and WinRar do with less whining.
  • TortoiseSVN - Windows Explorer – Integrated SVN source control. As I use git more and more for personal projects I’m starting to regret how heavyweight the integration is though, might try something new next time.
  • MSysGit - While we’re on the subject.
  • Fiddler2 - Http viewer, debugger. Don’t use it too much but its handy to have around.
  • IE 8 Developer Toolbar – Its actually quite good
  • GIMP - I ain’t a fancy-nancy designer and I’m not paying for Photoshop.
  • Paint.NET – When I want to draw stuff but don’t want something as heavyweight as GIMP
  • Inkscape - For working with svg images. I use it surprisingly often
  • WinMerge - Great little application for comparing two files/directories/whatever
  • Console2 - Could never really get it to work better than the powershell default but it deserves another shot
  • Powershell – Are you a developer on windows and don’t use this? You need to be punched in the face (or at least have you mouse stole).
  • AutoHotKey – For scripting windows
    • AutoHotKey Script – BDD names from JP Boodoohoo. I had made some customizations to it but they were lost with the lastdisk crash. Oh well
  • Gallio Icarus – Sometimes you just want a stand-alone test runner GUI and this is the best
  • Putty - For SSHing
  • TweakUI – For Windows XP. Hopefully that’s a game I won’t have to play for much longer
  • Reflector - Must have for .NET development
  • Jing - Oh I love this. The best for quick screen captures (though it would be nice if it had a lighter memoery footprint).
  • FileZilla Client – Ftp I usually do with windows explorer (you knew it could do that, right?) but SFTP we need to bring in the pros
  • Ruby – I’m going to try just running IronRuby next time, I swear.
  • SQLite.NET – Tends to come up sooner or later, good for quick free file-based database
  • KeePass – I keep all my passwords in here – shh don’t tell anybody
  • Growl for Windows – I wrote a friggin’ log4net Growl Appender, obviously I want something to read it.
  • Synergy – To share mouse and keyboard with multiple computers
  • Visual Studio – duh, but also the following plugins/extensions
    • TestDriven.NET – can’t live without youuuuu
    • T4 Toolbox – gotta have it since I like Sharp Architecture so much
    • ASP MVC – nuff said
    • ZenCoding – I haven’t had a chance to use it yet but I really can’t wait till I do
    • Refactor Pro and CodeRush – It’s a love affair, though I just picked up a ReSharper license at the last VAN so I guess I should compare and contrast or something
      • CR_ClassCleaner Plugin for DxCore
  • Microsoft Live Meeting – For the virtual alt net sessions
  • Skype
  • Dropbox
  • SharpDevelop - I got to get into using this interesting IDE more
  • RubyMine – Great for ruby, and I have a license!
  • VLC Media Player – Way more lightweight feeling than the others and plays anything

Tags: ,

New Job – I’m the Man

12:57 | Uncategorized | 1 comment

Those who know me in real life (and the roughly zero others that read my blog) know the big news.

I have put in notice at my current company and starting February 21st I will be working full-time at EPS Software.

For me? That’s a big deal. For anyone else? Not so much. This post is a placeholder for expounding on this later.

Hey, I Think I’ve Invented a New Pattern

January 17, 2010 01:58 | Programming | 4 comments

Ok maybe not totally new, I am sure that its just a projection of something I once noticed subcionscioiusly in a F# project. But in the C# space, I’ve yet to see something quite like it.

The problem is that programs are complicated. I don’t tend to help the issue. In a flash I don’t hesitate to layer on additional complexity with domain models, frameworks, and complex infrastructures. Entities, sevices, repositories and aggregate roots – they’re the tools that we reach for all too often. That is not to say that Domain Driven Design is a poor paradigm – I’m a big fan – it’s just not always necessary.

Take for example a typical scenario. You are given an integer which uniquely identifies a customer and are asked to generate a report of all their orders, export it to a pdf file and return as a Stream. My first impulse is to start with the customer and order objects, identify the bounded context, figure out the aggregate roots, start writing data access mapping code, and so on. If I’m lucky, I only do this for a few hours before hearing the voice of an incorporeal Ted Neward yelling at me to STOP. I was not asked to build a domain model, I do not need to keep track of state, there is no validation, or (much) business logic. The problems that DDD is intended to solve are simply not present here. I need to do one thing and one thing only, map an integer to a Stream!

And yes, I do realize that this is exactly what the CQRS guys have been harping on for years.

My Solution:

Each of my last few projects has contained a very simple interface.

public IMapper<INPUT_TYPE, OUTPUT_TYPE> {
  OUTPUT_TYPE Map(INPUT_TYPE obj);
}

Get it? Put in an integer, get back a Stream, what could be simpler? Ok, maybe that’s too simple. Any change at all would require modifying the implementation. This is all that icky procedural programming stuff. What about reusability, encapsulation, separation of concerns, and our other OO goodies? Fortunately, we don’t have to give these up. All we have to do is introduce a couple of obvious seams. We no longer transform an integer directly to a Stream. Instead we:

  1. Take the id and map it to a DataSet that contains the report data.
  2. Map a DataSet to the appropriate fully built Crystal Reports ReportDocument.
  3. Map a ReportDocument to a MemoryStream of a pdf file.
IMapper<int, DataSet> _dataProvider;
IMapper<DataSet, ReportDocument> _reportGenerator;
IMapper<ReportDocument, Stream> _pdfReportExporter;

public Stream GetCustomerReport(int customerId) {
  return _pdfReportExporter.Map(
           _reportGenerator.Map(
             _dataProvider.Map(customerId)));
}

Pretty nice huh? Well not that nice. If you’re a naming perfectionist like I this should make you shiver. When it comes to maintainability, good intention-revealing namespace, class, and method names are worth a million unit tests and n-tier architectures. Forget requirements docs and self-documenting code, proper naming is the number one tool for communicating our intent.

I lecture my team on this constantly and yet I allow myself the use of the the term “Map”?! A generic term that could indicate anything except (unless you’re a cartographer) a concept from your ubiquitous langauge. I should be ashamed.

We want to keep our generic IMapper interface though, it’s so slick, allows us to write minimal code and you you could easily imagine it coming in handy. For example, perhaps as the domain itself becomes more complicated, it becomes useful to break our IMapper<int, DataSet> down further.
1. The integer is get mapped to a Customer entity.
2. This gets mapped to a ReportSpecification.
3. The ReportSpecification is evaluated and mapped to a StoredProcedureInvocation
4. The procedure is executed and finally returns our DataSet.

You could imagine all sorts of neat little tricks you could play with our IoC container – we could have it automatically link transforms together or subsitute out implemenations. Simply by knowing that all these components transform one object to another we could configure automatic caching, deferred execution proxies, and so on. All things that are made far easier because all transformations are achieved via IMapper.Map.

What we really need is a way to introduce aliases for the Map() method. Preferably ones that depend on the input and output type. So why sit there scratching our heads? C# is a flexible enough language, let’s just let’s do that thing that I just said.

public CustomerOrderReportGenerator : IMapper<DataSet, ReportDocument> {
  public ReportDocument Map(DataSet data) {
    // implementation
  }
}
public partial static class AliasExtensions {
  public static ReportDocument GenerateReportFrom(this IMapper<ReportDocument, DataSet> mapper, DataSet ds) {
    return mapper.Map(ds); }
}

And now we have aliases:

  _pdfReportExporter.Export(
    _reportGenerator.GenerateReportFrom(
      _dataProvider.GetOrderDataFor(customerId)));

The poor readability of this bothers me. The LISPers among us might not mind reading backwards through a stack of nested parentheses but as a fan of fluent interfaces I’d like to see my code read as close to natural english as possible.

Same trick, now featuring double dispatch!

public partial static class AliasExtensions {
  public static ReportDocument ComposeIntoReportUsing(this DataSet ds, IMapper<ReportDocument, DataSet> mapper) {
    return mapper.Map(ds); }
}

Allows us to do:

  return _dataProvider
    .GetOrderDataFor(customerId)
    .ComposeIntoReportUsing(_reportGenerator)
    .ToStreamUsing(_pdfReportExporter);

And there you have it. Nice, fluent, and composable.

What do you guys think? Aliased Maps a good name?

kick it on DotNetKicks.com

Tags: , , , ,

Enable/Disable FusionLog Powershell script

November 11, 2009 11:01 | Programming | No comments

If you use Windows and don’t use Powershell you should. Really you should. It’s great for getting all the little repetitive things out of the way.

Like for example enabling/disabling your Fusion Log every time you need to figure out why assembly binding has gone wrong. So here you go. Just put these in your profile:

function global:Enable-FusionLog {
	Remove-ItemProperty HKLM:Software\Microsoft\Fusion -name EnableLog -ErrorAction SilentlyContinue
	[void](New-ItemProperty  HKLM:Software\Microsoft\Fusion -name EnableLog -propertyType dword -ErrorAction Stop)
	Set-ItemProperty  HKLM:Software\Microsoft\Fusion -name EnableLog -value 1 -ErrorAction Stop
	Write-Host "Fusion log enabled.  Do not forget to disable it when you are done"
}
function global:Disable-FusionLog {
	Remove-ItemProperty HKLM:Software\Microsoft\Fusion -name EnableLog -ErrorAction SilentlyContinue
	Write-Host "Fusion log disabled"
}

Awesome.

Also we talked Powershell at yesterday’s GNO.NET and Cody Gros showed PowerGUI - which a totally free and seemingly awesome powershell editor. Woo!

Tags: , ,

Rhino.Mocks 3.6 Intro – What You Actually Need To Know

October 21, 2009 09:28 | ALT.Net, Programming | No comments

What’s a Mock?

For the purpose of this essay a mock is an object that uses the object oriented concept of polymorphism to create an alternate implementation of a class or interface. Essentially, a mock is just a fake version of an object.

A mock is used for two things

  1. Stub: Stand in for a service and provide alternate, simpler method implementations. An example would be to substitute for an object that would normally query the database – instead of querying the database the stub object will simply return a canned response.
  2. Spy: Detect whether an object was used in a certain way. An example would be when testing an object that decides whether to call ui.NotifyUser() depending on some criteria. A spy can stand in for the ui object and call tell you if the NotifyUser() method was called.
  3. Don’t worry if that is a bit obtuse, it should become clear soon

Read more »

Tags: , , , ,

Like 300 only geekier

July 20, 2009 04:15 | NOLA, Programming | No comments

I just got back from the New Orleans Barcamp and I’m going to go ahead and join everyone in singing its praises.  Day 1 was great – full of interesting presentations, introductions and exchanging of ideas.  I even got to present twice, once on Test Driven Development and again later in the evening with Stephen Bohlen’s slide-deck on Domain Driven Design. However, fun as it was, it went roughly how I expected, so I probably would not be blogging about its success alone.

It is the second day that was destined for real magic.  The challenge was simple: “Do something to help with the organization of the leagues of people who donate their time to volunteer for the New Orleans public school district”.  Those familiar with software development in general – and the challenge of herding hungover techies who get in at 10am to start and complete a project by 4pm in particular – will recognize it as simply jaw-dropping.  Especially when “something” is expanded to mean “create a full blown, maintainable, multi-media website to bring together and thank volunteers” – wowee.  And yet I’m proud to announce http://www.nolaschoolvolunteers.org/ which as of this morning did not exist and now does all those things and more.  Everything you see, including domain name, CMS installation, layout, and much of the content was created in one afternoon by a group of dedicated barcamp attendees.

In a word, everyone there was just astoundingly professional.  How professional?  Well a room full of 15 geeks from different backgrounds and diciplenes spent all of 10 minutes debating language choice and platform.  The conversation was literally:

- So it sounds like  PHP is our lowest common denominator and we’ve got a PHP guru?

- Yup.  So let’s do PHP.

- Ok.  Can we do this in wordpress?

- I think so.  We’ve got a couple guys that are good at wordpress and some more that are familar with it.

- Wordpress it is.

And if that isn’t shocking enough then we did it!  In one fell swoop and in no small part through the leadership of Matthew Tritico and others; requirements were defined, refined, scoped back, matched up with a technology, assigned,  implemented, and integrated in a whirlwind six hour session that I consider among the most productive hours of my life.

Oh and luck.  I’m going to go ahead and say that a lot of luck was also involved.

So take aways:

  1. Never underestimate the collective power of an enthusiastic, experienced, and focused group.  The trick is getting all three.
  2. Value of someone who’s done it once before is that of ten bright people. Value of someone whose done it twice is that of twenty.
  3. Take the time and pick the right tool for the job.  The site was created in wordpress with a variety of plugins, and a healthy dose of google products.  A huge amount of functionality with hardly any code at all!  Microsoft take note – this is RAD developoment done right.  It is possible, but drag-drop and a fancy IDE is no replacement for true knowledge.
  4. Finally, equally as important as the availability of the right component is the ability to integrate with the rest of the application.  Do not take this for granted – the excellent ecosystem of wordpress plugins was a major deciding factor for us and cut down considerably on integration time that we did not have.

So again, a spectacular job by all.  A lot of great relationships fostered, a lot of tech talk, and one kick-ass site banged out in an afternoon.  Frankly, given the glacial pace at which I see projects progressing in the enterprise space, I really needed to see this.  I’m not even sure what I think about this yet – was it all luck or did I really learn something interesting?

I think likely the latter.

Lambda Update

July 17, 2009 01:39 | Uncategorized | No comments

For the record, I am still working on the lambda posts. Actually I have written two. Unfortunately, bigbluehost (my hosting service) switched servers and by hook or by crook my post on introductions – which had already been published – got disappeared. And wouldn’t you know it, I only saved it online. Arg!

Therefore, although I already have 2 articles written, I am holding off on publishing any new ones until I have time to go back and re-write the one that got lost.

Sorry guys, but that’s the way its going to be for now. Hopefully I can get them all up by the end of next week.

You Can’t Dance the Lambda

June 22, 2009 16:17 | Uncategorized | No comments

Bing image search demands that you appreciate its features.  Its annoying annoying featurs.

Bing image search demands that you appreciate its features. Its annoying annoying featurs.

I will say it proudly. I use lambdas. I use them a lot. I use them everywhere. I think they are an incredible and elegant language feature to the point that I would never go back to a language that does not include them in its basic tool-set. (You hear that Java? I’m not going there.)

At the same time I see far too many developers who are confused by the topic. I am planning a blog series on why I think that lambdas are so great, how I use them and why you should to. The series will be broken down into several parts and will tentatively cover

  • Intro, definition and syntax.
  • Using lambdas to refactor similar code structures for ultimate DRY.
  • Using lambdas to publish and subscribe to events the easy way.  Using them to adapt to method interfaces.
  • Using lambdas for defered (and run-time overwritable) execution.
  • Strategy pattern with lambdas in a hash.
  • Using lambdas for fluent interfaces.

I’m unsure yet how many parts I will be breaking the series into but I feel like most of these can be a medium to long blog post in themselves so I’m sure I’ll be kept busy for a while.

And yes I do realize the available “Give up the Func” pun.

Hello world!

June 18, 2009 18:12 | Uncategorized | No comments

Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!

Screencast: Keeping Features Out Your Way With Branching

June 4, 2009 19:12 | ALT.Net, Programming | No comments

Pop quiz:  What’s the software developer’s biggest enemy?  It’s not marketing.  It’s not those snot-nosed DBAs.  The rigid chair that will invariably give you arthritis?  Nah.  Your know-nothing boss?  Not even close.  No, the developer’s biggest enemy is the customer.

That’s right customers and their god d*mn feature requests and bug reports!  Life would be so much easier without them.  And acknowledging the absurdity of that statement, unless you are some kind of programmer Adonis (which unlike a regular Adonis physically implies only that your esophagus is invulnerable to lesions caused by Bawls) and write flawless code you will have to deal with feature requests that can rapidly pile up and overwhelm your development process.

I had mentioned previously on this blog that I am working with a team of Indian contractors and this is exactly what they found happening with the latest high stakes omg-fix-this-now-or-we-all-die release.  The team was behind and the release went out mere minutes before users started working with it.  Of course in the rush to finish on time bugs cropped up and features were left out.  Lots of features.

So immediately the next morning, with tickets raining down and demands for new drops every day the team got to work.  And the daily releases never came.  On the 3rd day we finally dived into their process with them to identify the problem.  

Simply speaking, they couldn’t reach a stopping point.  By the time certain features were ready to go others were half-implemented and so no release could be scheduled.  It was like some sort of real life Zeno’s paradox.  Fortunately this one has a solution.  Fully acknowledging that it is probably named differently in a dozen books and Agile pamphlets (just not any that I’ve seen), I call it branch-per-release or “how to use source control to get yourself out of a tight spot”. 

The idea is blatantly simple:

  1. Chose a release date
  2. Decide which features will fit in that release date
  3. Use your source control chops to create a branch for that release
  4. Decide what release each of the features on your plate goes in
  5. Create a branch for each of those releases
  6. Implement each feature set in the branch for its release
  7. When development on a branch is completed and tested, reintegrate into trunk.
  8. Rinse, repeate.

I have created a presentation and a series of screencasts (3 x 5 minutes thank you Jing) to demonstrate the process.  And here they all are:

Apparently embedding videos on wordpress.com is a pain in the *ss (as is code highlighting) so as mere links they must stay.

Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.