Posts Tagged ‘tricks’

My love affair with Visual Studio: Error Correction

I have been working with Visual Studio for years, and I’ve found a few tricks along the way that make my coding easier. In this blog post I’ll show one of my favourite time savers the Error Correction feature.

When you are writing code for a form or a class as part of a team, or even if you are just starting work on a project which will be made up of multiple classes, you always end up having to reference classes, properties, or methods in your code that haven’t been written yet. So you either have to comment out those calls, add them later, or add stubs so your code will compile. In Visual Studio 2010 they added a neat little feature that will add the stubs for you!

Say I am writing code for a click event handler that will create and populate an instance of a Student object who will be registering for a course. I haven’t created the Student class yet so I see a squiggly under the word student and this little rectangle at the end of the squiggly.

image

Now comes the cool part, I can carefully hover the mouse over the tiny rectangle and a little warning symbol will appear, if I hover just right it will appear with an arrow beside it that I can click on.

ErrorCorrectionOptionSmall

Clicking on that little arrow will bring up a menu of options that will fix the error for me! By the way, if like me, you find using the mouse to bring up the list fiddly, you can use the keyboard to bring up the correction menu by putting the cursor on the word student and hitting CTRL + . that’s CONTROL KEY and a PERIOD.

ErrorCorrectionListSmall

Visual Studio is offering to create a Student class for me, or to define a new type (variable essentially). If I click on Generate ‘Class Student’ I can see a new class appear in Solution Explorer called Student.vb

image

If I open up the Student class I see it has not only created a class, but because my code called a constructor and passed in two variables, it created a constructor method in the class as well that accepts two variables!

image

The code isn’t complete by any means, but it’s enough to get rid of the squiggly on Student in my event handler!

image

Of course now I have squiggly lines under vFirstName and vLastName because I haven’t declared those yet, but if I bring up the Error Correction list for those variables I select Generate field for vFirstName and then Generate field for vLastName and it adds the declarations for me!

image

Sure, it didn’t’ know what data type to make the variables, it’s not perfect, but when I am trying to test something quickly these little Error Correction tools that will generate code stubs for me can be a real time-saver.

This blog also appears on the Canadian Solution Developer Blog

Want Your Presentation to Rock? Hook Your Audience Early!

Every day professors there is a lecture room with someone standing up front talking about Fourrier Transforms or looping algorithms. Whether it’s a class presentation,  a lunch and learn for fellow students, or a presentation on a co-op term, all of us are called upon to present from time to time. When we put together a presentation it can be tricky to deliver the information the audience needs in a way that will hold their attention. You want a presentation that will grab and hold their attention. Luckily there is a very easy 5 slide structure you can use in your slide decks to quickly get the audience invested in your presentation.

I really believe you have to get your audience hooked right from the beginning. Whether you are presenting at a conference, to a client, to your boss, or to co-workers. You want to make sure the audience understands what you will be talking about and why they should care right away! We all have limited time, so when I sit down to listen to someone else present I want to know right away what am I going to get out of this presentation.

The structure I use at the start of my decks is based on the principles in Beyond Bullet Points by Cliff Atkinson.

Let’s say I wanted to talk to a group of programmers about developing an application for a Windows Phone. A typical presentation might start out with a slide that shows a picture of a windows phone, then it might display a slide that lists the tools you need to download to start developing, then a slide listing the hardware and software requirements to use the tools, you have a few slides talking about the different types of phone applications you can build, then maybe you do a Hello World example, and you do various code examples and demos and finish up with talking about how to publish an app to the marketplace. Sound about right? That’s fine, but it could be so much better! All you need to do is put careful thought into the first 5 slides!

Slide 1 The Setting

The very first slide in your deck should give your audience the setting, telling them where we are right now. Think of it like a sort of one sentence status update, a state of the union. Ideally this setting should be expressed as a single sentence with a single image on the slide to reinforce it. For example

“The Windows Phone MarketPlace offers great opportunities to get noticed” and an image of someone who stands out in a crowd.

Other examples of setting statements

“SQL Server 2012 CTP3 has just been released”

“MVC is becoming a popular model for web development”

“All companies need accurate information to make decisions”

Slide 2 The Protagonist

The second slide should help the audience understand how they fit into this setting, so they can understand how your first statement is relevant to them. Again keep the slide simple, one sentence, one image!

“You know .NET, so you can code a windows phone application” with a picture of a happy programmer, or the .NET logo, get creative have fun with it.

Other examples

“We are currently running SQL Server 2005”

“Our team maintains 15 corporate websites”

“We have 45 databases at our company storing 61 TB worth of data”

Slide 3 The imbalance

This slide should give a sense of the conflict, the problem, it should start to make people feel like we need to do something. Stick with the one sentence, one image format.

“The Windows Phone Marketplace is an untapped opportunity” with a picture of Monty Burns from the Simpsons rubbing his hands together with glee (like I said you can have fun with the images)

Other examples

“We need the business intelligence features in SQL Server 2012”

“None of our websites share code”

“There is wealth of information in our data that can help our company succeed”

Slide 4 The balance

This slide should tell the audience the desired outcome, where we want to be in a week, a month, a year, or even in an hour when this presentation is completed. Oh and guess what format the slide should be…yup one sentence, one image. By the way lets be clear, I do mean an actual sentence, with punctuation and everything, a bullet point is not a sentence.

“We want to develop windows phone applications” with an image of a windows phone showing the company logo on a tile

Other examples

“We need to upgrade to SQL Server 2012”

“We want our code to be re-usable across websites”

“We can get information about trends and patterns from our company data to plan company strategy”

Slide 5 The solution

Now it’s time to reveal what you will really be talking about in your slide deck, the solution, how will we get from where we are now to where we want to be, from the imbalance to the balance!

“You can develop a phone application” with an image of a finger pointing at the audience.

Other examples

“There is an upgrade path from SQL 2005 to 2012”

“MVC will allow us to re-use more of our code”

“SQL Server Analysis Services cubes will help us report on trends in our data”

Put it all together and it comes out like this

The Windows Phone Marketplace offers great opportunities to get noticed. You know .NET, so you can code a windows phone application. The Windows Phone Marketplace is an untapped opportunity. We want to develop windows phone applications. You can develop a phone application

or

All companies need accurate information to make decisions. We have 45 databases at our company storing 61 TB worth of data. There is wealth of information in our data that can help our company succeed. We can get information about trends and patterns from our company data to plan company strategy. SQL Server Analysis Services cubes will help us report on trends in our data

If you were in the audience after these slides, would you know what was coming next? that’s the whole point, now I understand what you’ll be covering, how I am affected, and why we are having this discussion.

Just 5 slides and you are well on your way to a great presentation. An interesting aspect of these first 5 slides: they don’t take long to cover in your audience. I probably average about 30 seconds a slide on these. So they add very little to your overall presentation time yet they go such a long way towards setting the stage for the rest of your presentation. So next time you are firing up PowerPoint, before you jump straight into the content, take a minute to think about those first 5 slides. By the way, if you go back and read the first 5 sentences of this blog post…you’ll see this format can work for introductions to blogs as well Smile

 

This blog is also posted on the Canadian Solution Developer