MHTip Archives - Dirk Strauss

Programmer’s Survival Tips – #7

On 13 September, 2010 08:00:40, in Programming, by Dirk Strauss

Visual Studio 2008 Item Templates

In one of my previous posts (Programmer’s Survival Tips – #3) I looked at having your own code library or repository. While this is a really important aspect of programming, there are times when you would want to do a bit more than simply delve into your bag of code snippets. When I started out programming .NET applications, I frequently found myself wondering if there wasn’t an easier way to do things. Well to tell you the truth, there are so many gems out there, but I would like to focus on one in particular. Item Templates.

Now for some of you, this will be old hat, but I bet that there are some of you who are not familiar with Item Templates in Visual Studio. Lets say for example that you would like to extend the error message screen that is displayed to the user in the catch portion of a try / catch block. So you go about designing your new screen and adding extra functionality, bells and whistles. Once your application is completed and QA’d, you know that it is ready to be rolled out to a live environment. Along comes the next project, and you would like to use the same extended error message screen as in the previous project. So now you copy the code and form from the previous project, and paste it into a new form in the new project. Well, there is an easier way.

Continue reading »

Tagged with:  

Programmer’s Survival Tips – #6

On 10 September, 2010 08:20:02, in Programming, by Dirk Strauss

Make use of Tools

What tools do you use in conjunction with your IDE to extend your capabilities? In the previous article in this series, I looked at how important it was to know your IDE. On Twitter I received a comment from @IBBoard to one of my posts that was retweeted on the fact that Visual Studio does not show line numbers in the code window by default. While this option can be toggled, the comment got me thinking. I realized that it is also good to know the limitations of your IDE. How many other actions are we as developers performing that can be automated or that can be done more efficiently with a tool?

So let me start by saying this; first and foremost remember that you are a programmer. If you need a tool, and it is within your means to do so, instead of buying a tool to do the job, just write one yourself. In my company, most of the applications we write make use of settings to store the database connections and Web Service URL’s. This data is always encrypted. So let’s say for example there is a problem on a customer’s site and the application can’t seem to establish a connection to the database, I will always go and verify that the settings are correct. Well, those settings are encrypted. So what I did was write a decrypting application. This small app will take in the encrypted string as one parameter (among others) and decrypt the string.

Continue reading »

Tagged with:  

Programmer’s Survival Tips – #5

On 8 September, 2010 21:34:55, in Programming, by Dirk Strauss

Know your IDE

Your IDE (Integrated Development Environment) is your tool for creating great applications. Without it, you don’t mean much, unless you are a hardcore .NET developer that can write a whole application in Notepad and compile it with a command line compiler. The bottom line is, you need your IDE.

What is really astounding to me is how little the average programmer knows about their IDE. (I will be specifically referring to Visual Studio Team System 2008 throughout this post.) They know just enough in order to do the most basic of tasks (and I don’t mean writing code). Your Visual Studio IDE is a very powerful tool, and your utilization of that tool impacts directly on your productivity.

Continue reading »

Tagged with:  

Programmer’s Survival Tips – #4

On 7 September, 2010 16:54:54, in Programming, by Dirk Strauss

When writing code, the simplest solution to a problem is the best

Occam’s razor according to Wikipedia is “the principle that ‘entities must not be multiplied beyond necessity’ (entia non sunt multiplicanda praeter necessitatem). The popular interpretation of this principle is that the simplest explanation is usually the correct one. Simplest is not defined by the time or number of words it takes to express the theory; is really referring to the theory with the fewest new assumptions.” (See the article here)

Continue reading »

Tagged with:  

Programmer’s Survival Tips – #3

On 6 September, 2010 17:00:26, in Programming, by Dirk Strauss

Build up a code library or repository

How much code do you rewrite? Be honest with yourself. I am a very lazy programmer. So lazy in fact that I created a project template for myself. (More on this later) But as any good programmer knows, having a stash of code is essential! And really, with all the tools available to you, there really isn’t any excuse not to have a code repository. Try http://codesnipp.it/ online and request an invite (or contact me for one. If I have left, I’ll share).

But let me start from a point. I started noticing that certain aspects of my projects were reusable because I was writing code over and over again.

Continue reading »

Tagged with:  

Programmer’s Survival Tips – #2

On 1 September, 2010 21:42:25, in Programming, by Dirk Strauss

Never commit to anything without doing proper research first

On a couple of occasions I have been approached by one of my clients wanting a change to a system I or one of my colleagues wrote. They will start off by saying that they need a ‘small’ addition and that it is really simple. (That usually coming from somebody with NO programming experience at all) They will then proceed to explain the change and at the same time tell you that it shouldn’t take you more than x amount of hours to complete.

This is probably one of the most frustrating situations for me.

Continue reading »

Tagged with:  

Programmer’s Survival Tips – #1

On 1 September, 2010 11:22:06, in Programming, by Dirk Strauss

Never give your mobile number to a client, unless you work for yourself

If you are a programmer, and you work for a company (not for yourself), giving out information like this is just as good as signing away any possibility of being able to take some time off. Clients automatically think that when you give them your mobile number, that you are giving them a golden key to IT advice and support on tap.

It will start of slowly, possibly only related to the project you are currently busy working with on site. After that, it will escalate. What’s even worse, if you do your job well, the level of being bugged will increase. Soon you will need to give advice on anything IT related. The final straw will come when you are on vacation. Going away means getting away. Any contact regarding work related issues, will end up bugging you and being on your mind, effectively spoiling any chance for you to switch off and relax.

Continue reading »

Tagged with: