Saturday, June 28, 2008

Blogger Permalinks And SEO

Since I started doing the "Resharper Ninja" series my page hits to this blog have been on the downturn (by around 80%).  I started thinking about the permalinks that were getting created for each post; they were all the same except they had a unique 2 digit code appended to them.  Apparently Google's bots saw this and thought I was trying to fix the system by making many pages very similar.  After reading this article, I decided to recreate all the Resharper posts and create them with a unique title, then go back and name the title what I actually wanted.  Hopefully Google regains it's trust in me!!

So if you're seeing old content show up in your reader and are wondering what's going on - that's it.

Find Inheritor(s) Using ReSharper Keyboard Shortcuts

Ever wanted to see all of the classes that inherit from a base class or interface? ReSharper makes it easy peasy with a little help from your keyboard.

If you have an interface such as:

Interface_thumb[2]

Put your cursor on "IDoSomething" and hit "CTRL+ALT+B" ("ALT+END" if you're using the Visual Studio keymap scheme). If you have only one class that inherits from your interface/base class then it will take you directly to that file.

Implementation_thumb[5]

Multiple implementers? Use the same keyboard shortcut and then use the arrow keys to choose which implementation you want to jump to.

MultipleImplementations_thumb[2]

This is part 2 of a series of posts exploring how to become a ReSharper keyboard ninja.

Previously:
Part 1 - Quick Documentation View

Surround Code With More Code Using ReSharper

A common everyday need is to be able to surround portions of your code with anything from curly braces, to an if block. To achieve this wonderfulness with ReSharper, highlight a block of code, hit "CTRL+ALT+J" (or "CTRL+E, U" for VS keymapping) and choose from the resulting context menu with your arrow keys. Your choices are as follows:

if
while
for
do...while
#region
#if...#endif
{}
try..catch
try..finally
cast
lock

surround_thumb[5]

Also:
ReSharper released their keymappings for version 4.0 RTM.
Visual Studio Scheme is here.
IDEA Scheme is here.

This is part 3 of a series of posts exploring how to become a ReSharper keyboard ninja.

Previously:
Part 2 - Find Inheritors
Part 1 - Quick Documentation View

Discover Method Parameters Using Resharper

One of the great features of ReSharper is the context help it gives you as you work. The parameter information helper is one of those indispensable tools that I now rely on and can't live without. ReSharper gives you the parameter tips when you open the parentheses to the method you're calling, but sometimes you can lose the tip if you browse to another file or hit escape, etc. To get that window back, all you need to do is hit "CTRL+P" ("CTRL+SHIFT+SPACE" for the Visual Studio scheme).

ParameterInfo_thumb

This is part 4 of a series of posts exploring how to become a ReSharper keyboard ninja.

Previously:
Part 3 - Surround Your Code
Part 2 - Find Inheritors
Part 1 - Quick Documentation View

Find The Next Error Using ReSharper

istockphoto_1778141_dunce_cap1_thumb[3] We all make mistakes, and ReSharper is quick to point them out. Your job is to find out where it's pointing them out, and then fix them. So what is the quickest way to do that? Easy, hit "ALT+F12" (or if you're a VS keymap fan "Shift+Alt+PgDn").

When pressed, this keyboard shortcut tells ReSharper that you're looking for the next error in your solution. It will automatically place your cursor in the next place where there is an error, so you can correct your bad code and move on.

Thanks to @pmontgomery (pictured at right) for contributing this nugget!

This is part 5 of a series of posts exploring how to become a ReSharper keyboard ninja.

Previously:
Part 4 - What To Pass?
Part 3 - Surround Your Code
Part 2 - Find Inheritors
Part 1 - Quick Documentation View

Lenovo Thinkpad Slow Boot

This morning I had almost reached the end of my rope waiting for my T60 to boot.  It's been slow booting since I got the thing last year - but after boot is finished it flies. 

I noticed that during the logon process my hard disk access was through the roof, so I turned to my friend Process Explorer from SysInternals.  This handy tool is a  Windows Task Manager replacement that gives you many more options and is a lot friendlier to work with.  With this tool you can view tons of metrics about processes that are active on your machine; two of which are I/O Read Bytes and I/O Write Bytes.  This gives you a great indication of what's eating up your hard disk bandwidth.

procexp

When I looked at the I/O Read/Write bytes just after the login process finished, I sorted by I/O read and noticed that the "Thinkvantage registry monitor service" had written around a GIG of data!!  This was in about 2 minutes time.  To shut off this process I went to the control panel, clicked on administrative tools, then services and set the service called "Thinkvantage registry monitor service" to manual.  Now my machine boots in a much more reasonable amount of time.

Hope this helps someone out there.

Tuesday, June 10, 2008

Software Development Meme

docbrownb61406A colleague of mine, The Todd asked me to continue a blog meme about my personal software development history.  Here are my answers!

How old were you when you first started programming?

My first programming class was my junior year of high school, which put me at age 16.  We coded in Visual Basic 5, and I hated every minute of it.  For some reason it didn't click.  Later on I found out that I could make a few bucks designing web sites, so I started learning HTML and Javascript.  It was about this time that I became very excited about the web and the potential that it had.

How did you get started in programming?

I really didn't get started into real programming until my college days.  This is when I really started to develop my passion for software development.  My C programming professor was the first teacher to really challenge me and the more that he challenged me the more excited I got.  I still glean from wisdom I collected from him when facing software design challenges today.  If it wasn't for this class, I probably wouldn't have continued in a CIS degree.

My professional programming career started with an internship at a small manufacturing shop.  This is where I found the value of software as it applies to business.  I had an awesome boss who taught me everything he knew about programming.  People like him have inspired me to share everything I know with as many people as possible so I can help others be as successful as they can be.

What was your first language?

At that manufacturing shop, everything was based on an ERP system built using Progress.  I really cut my teeth as a professional developer using Progress even though (at the time) the language had many huge limitations.  Progress is a great language for the right situation... but it is definitely that skill that I have, that I don't advertise on my resume'. 

What was the first real program you wrote?

In my C class in college we wrote Conway's Game of Life.  For a Freshman in college this was a painfully complex assignment, but it was amazingly cool and I had the biggest feeling of satisfaction after completing it.

What languages have you used since you started programming?

C
C++
C#
Java
HTML/Javascript
VBScript
Visual Basic 5/6
Visual Basic .Net
ASP.Net
PHP
SQL
Progress
COBOL

Dabbled in:
Python/Ruby/F#

If you knew then what you know now, would you have started programming?
That's an interesting question.  When I decided on DeVry for my college education, I went to my high school guidance counselor and asked him which degree required the least amount of math.  His answer was Computer Information Systems, to which I replied, "sign me up!".  That is a serious story, so I think that for the most part I got lucky and stumbled into something that grew into a passion.  I do love software development, but I'm not completely subscribed to the idea of dedicating the rest of my life to it.

If there is one thing you learned along the way that you would tell new developers, what would it be?

Find quality people and pay close attention to what they say and do.  Out of that crowd, select one or two of them and make them your mentor. 

What's the most fun you've ever had ... programming?

I worked for a small manufacturer on and off for about 2 years developing a Communication Management Software application for them.  I enjoyed every last minute of it. 

On the spectrum of introvert <--> extrovert I probably lean more introverted, but I'm always inspired and energized by others around me.  I'm always having the most fun when I'm closely connected to a team of like minded people working together to achieve something great.

Next up:
Pete Gordon
Kris Scott
Greg Bahrey
Paul Montgomery
Alexei Govorine

Monday, June 02, 2008

Becoming A ReSharper Keyboard Ninja: Part 1 - Quick Documentation View

I need to get better at using keyboard shortcuts. When I'm doing common tasks over and over in Visual Studio, there are always threads spinning off in the back of my mind wondering if there is a way to accomplish the same thing using a shortcut. Well now I'm going to finally give those threads a callback and become more proficient with the keyboard shortcuts that are available to me.

My goal is to journal my experience, learn each keyboard shortcut, and write my thoughts here as I go along. This stuff is undoubtedly documented on ReSharper's site, and most likely it's more thorough.

To get started I downloaded the ReSharper default keymap that comes with R# 3.0. I'm using R# 4 EAP Beta 1, so we'll see if it's changed much. At the time of writing this I could not find a published version of the 4.0 default keymaps. The shortcut cheat sheet is great, but its going to take a little diving in to get a real sense of what I can do with them all.

The keyboard shortcuts I will be using are from the ReSharper 2.x / IDEA Scheme. (Change your keyboard shortcut scheme by using the ReSharper menu -> Options -> General. Look for the keybaord scheme section.

The first shortcut is CTRL+Q - Quick documentation pop-up. (If you're using the Visual Studio keymap the shortcut is CTRL+SHIFT+F1) This shortcut is a great time saver. It gives you a very quick, but thorough overview of the method or variable that you have your cursor on. Here is what it looks like:

ctrl_q

In the upper right corner of the dialog, you can click "Go To" to go to the declaration of the method or variable.

"Read More" seems like it should take you to some external resource, but with the build I'm using it redirects you to a page on ReSharper's website which does not have anything to do with the context of the quick help dialog. Bug??

The ellipse in the upper left hand corner indicates that there are more attributes than it has room to show you. If you click the ellipse you will see more detail about the attributes defined on the class.

Sunday, June 01, 2008

Code Complete Chapters 1 - 3

0735619670.01.LZZZZZZZI have been reading code complete by Steve Mcconnell with a good friend, Pete Gordon. This week we discussed chapters 1 through 3, and these were our primary points of interest.

What is "integration" in software construction?

Integration can mean a wide variety of things - it can be synonymous with any coding activity. It depends on what level of integration you're talking about.
Integration with a database or some external system?
...with another class that another developer wrote? 
...with a set of abstract classes?
...with another developer who is using code that you wrote?
...with code that was existing in the class that you are working with?

"Construction is a large part of software development"
It's a relative statement! After reading what he said about construction being a large part of the project - we looked at it from the opposite perspective. "Construction can be a relatively small part of the project". The book states that construction is usually between 30 and 80 percent of the total time spent on the project. Turn that around and you can say that 20 to 70 percent of the project is not construction! Interesting to think of it that way. Pete came up with a great concrete example:
Building a house is probably going to be about 10 percent design and 90 percent construction. Less time will be spent on design if you're using a canned blueprint/design. Now think about the St. Louis gateway arch. I think we can assume that a much greater time was spent designing the arch than was spent constructing it. Nothing is ever cut and dried in software development! Critical/creative thinking is required every step of the way!! 

Software Metaphors
Accretion vs. growing vs. building. How do you see a software development project? Which one is better? The author suggests that the visualization of building software is the best - I tend to agree with this. It also lends itself to being better able to serve your client. You need to continually be showing progress - by building out complete subsystems of the project you can show your customer progress that's been made after every chunk of effort.

The intellectual toolbox
Why do we need to be so religious about our development methodology? I have learned to be skeptical of someone who says they are strict in their approach to development by saying "I think xyz is the best way to develop software". Why hole yourself into a concrete implementation of a process? I think you need to be abstract in your approach to development and know what tools are available to you. This way you can adapt yourself and your team to changing circumstances.
How do you know what methodology to use?
I think to answer this question you have to ask what is most important to the project owners - both client and vendor. How easy is it to communicate to your client? If you sit on the opposite end of a desk, then maybe XP is great for you because you always have input and insight into how the system is to be built. If your client is halfway across the world and you have a weekly meeting to discuss requirements, then maybe you need to take a different approach with more documentation. I'm still trying to figure out how to think about this topic.

Trust
Something that Pete and I have been discussing almost every time we meet is the value of trust in your relationship with a client. When you come down to it I don't think a software project can be successful without a high level of trust.

Practices for your particular type of software project
We noted that the evolutionary model was acceptable for each of the three types of projects mentioned in the book. What I learned was that the evolutionary model takes two extremes (XP and waterfall) and tries to find balance in the middle. This brought up more discussion on how methodologies are really just semantics...you're always going to have to use critical/creative thinking in your processes..and be guided by a higher level process "ideal". I think that the reason that some projects leaders try to keep process rigid and stiff is because some people on the team will not be flexible and they need a definitive path.

What you need to start coding
The book suggests checklists to use before you start coding. One is requirements and one is design/architecture. I like the checklist because it's good to remember that there is a checklist. Folks who are not familiar with what it takes to construct code don't understand this and why you need to wait to start coding.

Justifying design and architecture
I really like the points that he makes about justifying your design decisions. One way that I learn the most is by analyzing design and picking out pieces I like and ones I don't. If you see enough designs you have a lot easier time coming up with one that meets your unique needs. Justifying your design also helps developers to understand your decisions - and will help pull them into the mold of your design. If developers are forced into a design they don't fully understand or grok, then they will probably make wrong decisions when they hit an edge case where a particular feature or design consideration is outside of what you've accounted for.

Conclusion
After reading the first three chapters of this book it is easy to see why it is considered legendary in so many circles. It is foundational to all software projects and I think that everyone involved in software should read and understand each key point that he brings up in this book. Great stuff - can't wait for more!