Wednesday, March 14, 2012

Stuck in zoom mode

In visual studio sometimes my mouse wheel gets stuck in zoom mode.  To fix this in the past I have shut down visual studio.  Depending on the size of your project this can take some time.

I found a simpler solution.  clrl+a to select all and the mouse wheel zoom scroll is broken no longer.


Thursday, March 8, 2012

Command Window in Visual Studio

Tired of scrolling through your solution explorer looking for that class. You know the name of it, but you making that mouse wheel work overtime to find the class in your project.

To get around this just use your Command window in visual studio.  To open the command window
1. click on the view menu on the menu at the top of visual studio, or better yet, just 
2. Go to the other windows 
3. select command window
or shortcut keys ctrl+alt+a

this will open the command window docked at the bottom of visual studio.

Inside the command window you can just type "of" and part of the file name.  The command window will give you suggestions and you can pick the class file you want.


This has been a huge time saver for me.  Try it out.


Wednesday, March 7, 2012

#region #endregion - You might have stinky code

Methods perform one and only one function. Methods with less than 15 lines of code makes me want to take a deep inhale. Getting a good whiff of that fresh smelling code.

Having more than 15 lines of code most likely mean you are doing more than one function. When I see these types of methods, I want to hide my nose under my t-shirt. Or maybe just pinch my nose closed.  Writing unit tests for run on methods that reach 100's of lines is nearly impossible. The maintainability of long stinky methods is low. Of course there are always exceptions, but short  methods are always my goal.

If your method has regions, you might have stinky code.

Applying the same idea to classes works also.  I really don't have a target for a class.  No magic number of methods or number of lines of code in a class. Your code is most likely stinky if you have one class in your library or application that has hundreds of methods and over 50 percent of code in your application.  Even more likely if the class is called main, or util.

Again in a class if you might have stinky code if you have regions.

Leaving #region out of your code leads to fresh smelling code.

No regions also means you don't have to remember those pesky shortcut keys to expand those regions any more.


Tuesday, March 6, 2012

Keyboard and mouse

As a software developer one of my most important tools is my keyboard and mouse.  It is my connection to my computer.  Most times I am thinking about what I am doing so much the keyboard is an extension of myself.  I don't really think about what I am typing, I just think about it and it goes into the computer.  The typing is nearly subconscious.

However, if you have a poor mouse or keyboard, then this subconscious work of typing the keys becomes more of a conscious decision.  You have to think about where the keys are you need to press.

Ok, so I think a lot about the keyboard and mouse that I use. I have had many over the years, and my favorite right now is the Logitech wireless wave keyboard.  The keyboard feels very natural.  I don't have to think about typing i just think and type. I really like the small receiver, not like some of the old wireless stuff I have that has long cords.  The built in wrist wrest is stylish and looks very modern. The USB receiver is super small and you don't even notice it.   The combo has many other features I am sure are nice, but I really don't use them.

I have one both at home and at the office. I have found various deals on the combo but you are most likely going to pay around $60 dollars for it.  For me who uses a keyboard for many hours each day it is certainly justifiable.



Here is a link to it on amazon.
http://www.amazon.com/Logitech-Wireless-Combo-Keyboard-920-002555/dp/B003VAHYNC/ref=sr_1_1?ie=UTF8&qid=1331091048&sr=8-1