Archive for January, 2009
Superbowl Weekend – Uncle Bob vs. Joel
by bhartsock on Jan.31, 2009, under Uncategorized

This is the weekend when titans collide. Where everything is put on the line. Where Uncle Bob challenges Joel to a post-off.
Today on Object Mentor, Uncle Bob railed Joel Spolsky and Jeff Atwood for their recent Stack Overflow Podcast.
Whose side am I on? Well, if it’s on SOLID principles, Agile, testing, or anything to do with code, Bob.
Falling of a giant
by bhartsock on Jan.30, 2009, under Uncategorized
Maybe not, but I did cancel my MySpace account today. I am part of too many social networks, and I didn’t use MySpace at all.
Friends use Facebook.
Specialized industry groups use Ning.
MySpace just didn’t have a real purpose anymore for me.
They grow up so fast
by bhartsock on Jan.29, 2009, under Uncategorized
A few days ago, a developer at work said something that made me cringe, “Every day we write more legacy code”. My first instinct was to reinstate our corporal punishment policy.
Then he said something quite amazing that I didn’t expect, “Any code we are afraid to change, because it isn’t thoroughly tested, is legacy code.” I cried. Literally.
Figuratively.
I know he read this in Working Effectively with Legacy Code, but to really see him get the importance of testing is awesome.
After hearing a few developers say this book is in their top five, I need to get on the ball and read it myself.
Intro to Powershell, Part 1 – Commands
by bhartsock on Jan.27, 2009, under Uncategorized
Today, I decided that I didn’t like most of the Powershell intro articles and books out there. They focus a lot on semantics, details, language structure, and really complex use cases. But those are all orthogonal concerns. What really matters is what you can do with Powershell right now and what you need as a foundation. This is my attempt at creating a simple, light weight introduction to Powershell so that you can get started in minutes, not days.
Commands
For now, just think of Powershell as an updated DOS prompt, or even a Bash shell. Both of these have commands, and parameters to these commands. Powershell comes with a lot of built in commands that you can access as soon as you install it. For this article, I am going to focus on three commands, get-command, get-alias, and get-help. Once you understand these commands, you can start playing around with every other command Powershell ships with.
Let’s start with get-command. Just type it in the shell, and hit enter.

As you can see, this lists out all the commands that are currently loaded into Powershell, along with the type (which we will talk more about in future posts) and usage information.

Since this list is pretty long, you can pipeline the output into the more alias. Don’t worry if you don’t understand what these mean yet, we will get into the details in the future. Just type get-command | more and hit enter.

As you can see, this is similar behavior to the Unix more command, which allows you the page through the results instead of listing them out all at once.

Aliases
Aliases are just a simpler, shorter name for a command. To get a list of aliases, just type the command get-alias.

Now you can see a list of aliases, and what command they correspond to.

Also, we can use the same pipeline trick to page the results.

Help
I know what your thinking, what good are commands when I have no idea how they work. What the hell does Export-Console or Copy-Item mean? get-help command to the rescue.
Just type get-help <Command Name>

Now you have detailed usage instructions for the command.

You can do the same thing for aliases. Type get-help <Alias>.

What next?
Hopefully this gives you a super simple starting point for learning all the commands in Powershell. Although you can’t do a lot, you can at least get started using it in 5 minutes.
As for what I am going to talk about in Part 2, I really don’t know. I was thinking the pipeline, variables, or even scripts and functions. Feel free to post any suggestions in the comments.
Using Snagit to create rich posts
by bhartsock on Jan.26, 2009, under Uncategorized
“A picture is worth 1000 words”
Most blogs that I read integrate media, specifically pictures, into their posts. A video can be avoided. Text can be skimmed. But pictures can’t be overlooked. Good pictures draw you into an article, or website, and add to the story the author is trying to tell you.
Last week, I posted a setup guide for NHaml with nearly 25 screen shots. Surprisingly, I was able to grab all the screenshots, cropped and everything, in about 15 minutes. Using the old school method of Print-Screen + Paint would have taken at least twice as long, and looked half as good.
Paying money for a screenshot utility seems ridiculous, but after playing around with it for a few days, I had to buy Snagit. I only used about 1% of its features, and that 1% is good enough to warrant spending the money. If you want to create media rich blog posts, I would highly recommend it. Even though the example is a little ridiculous, it shows how effortless creating great looking graphics with Snagit.

