Brian Hartsock's Blog

Archive for January, 2009

Superbowl Weekend – Uncle Bob vs. Joel

by bhartsock on Jan.31, 2009, under Uncategorized

battle_royal

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.

Post to Twitter Post to Digg Post to Facebook Post to Reddit

Leave a Comment : more...

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.

Post to Twitter Post to Digg Post to Facebook Post to Reddit

Leave a Comment more...

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.

Post to Twitter Post to Digg Post to Facebook Post to Reddit

1 Comment :, more...

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.
1-27-2009-5-30-33-pm-0011

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.
1-27-2009-5-30-52-pm-0010

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.
1-27-2009-5-31-23-pm-0009

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.
1-27-2009-5-31-29-pm-0008

Aliases

Aliases are just a simpler, shorter name for a command. To get a list of aliases, just type the command get-alias.
1-27-2009-5-31-45-pm-0007

Now you can see a list of aliases, and what command they correspond to.
1-27-2009-5-31-50-pm-0006

Also, we can use the same pipeline trick to page the results.
1-27-2009-5-32-07-pm-0005

1-27-2009-5-32-15-pm-0004

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>
1-27-2009-5-35-24-pm-0003

Now you have detailed usage instructions for the command.
1-27-2009-5-35-37-pm-0002

You can do the same thing for aliases. Type get-help <Alias>.
1-27-2009-5-35-52-pm-0001

1-27-2009-5-36-10-pm-0000

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.

Post to Twitter Post to Digg Post to Facebook Post to Reddit

Leave a Comment : more...

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.

postscreenshotPaying 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.

Post to Twitter Post to Digg Post to Facebook Post to Reddit

Leave a Comment :, , more...

Post by day

January 2009
M T W T F S S
« Dec   Feb »
 1234
567891011
12131415161718
19202122232425
262728293031