Aug
04
2008
0

ReSharper Tip of the Day: Suggest a Variable Name

R# Tip of the Day goes Hi Tech with its first video post.

If you find naming your variables mundane, press CTRL+Space after you type the type name and it will suggest a couple for you.

Want something a little better? If you start typing, it will tack on the suggestion to the end of what you started.

I need to figure out how to stream this.

Written by Mark in: ReSharper Tip of the Day | Tags:
Jul
31
2008
0

ReSharper Tip of the Day: Use Format string with StringBuilder

Some classes like StringBuilder build in the string.Format functionality. ReSharper knows this and helps you out. It’ll recognize you should probably be using a format string.

…and then turn it into the right method.

Written by Mark in: ReSharper Tip of the Day | Tags:
Jul
30
2008
0

ReSharper Tip of the Day: Templates Revisited, and the Surround With

Today’s ReSharper Tip of the Day is a guest posting from Josh Buedel,  It is a great tip that extends ReSharper’s use into the CSS and HTML space.

Resharper templates come in two flavors:  Live Templates which are invoked by typing keyword and pressing tab, and Surround With Templates, which are invoked against the current selection.

 

Did you know that R# templates can be used in any file type?  You aren’t limited to just the sections of files that it understands.  For example I’ve built up a handful of templates for Aspx pages.  Surround With templates are particularly useful in a markup language like html. 

 

I first invoke my custom Surround With CSS Comment (Ctrl+Alt+J). 

 

Then I type the keyword data and hit Tab, which invokes a custom live template for databinding code.

 

In this one I select all that and again do a Surround With, this time using my custom Link Tag (<a/>) template.

 

Lastly, I have this generic tag inserter. 

Notice how as I change the name of the opening tag, the end tag is updated right along with it.  I accomplish this by repeating my template variable (which I have named $TAG$) within the template.  Once the template mode is exited the cursor ends up positioned inside the opening tag, but just before the closing > character.  This is by design, by using the predefined $END$ variable, and is right where I would need to be to insert an attribute should one be needed.  Here’s the complete template for this:

 

Written by Mark in: ReSharper Tip of the Day | Tags:
Jul
29
2008
0

ReSharper Tip of the Day: Highlight Usages

To highlight the usages of a current symbol, you can press Alt + Shift + F11.

You’ll see all the usages both in the code view window:

…and in the right gutter:

As a bonus tip, you can click on the highlights in the right gutter to go directly to them in the source window.

Written by Mark in: ReSharper Tip of the Day | Tags:
Jul
28
2008
0

Angry Monkeys and the Save Icon

When was the last time you used one of these . Not the icon, but the actual physical media? I think it’s been at least three years since I owned a PC that could actually read them and a couple years before that since I’ve actually read something off of one.

Now everyone knows the Angry Monkey story right? To paraphrase it in a sentance:

Whenever you hear “…because we’ve always done it that way,” first shut off the alarm in your head and secondly, ask for another reason. 

It might be that the reason is valid, but it might be that no one knows.

Which brings me to the de facto save icon . I would be willing to bet the kids graduating college today have never in their years at university, or probably life, ever used a floppy disk, but every one of them knows it means to save their documents by clicking on it. Now, they know what one is, and might have seen a couple in their parents’ desk drawer, but as visual correlation to its function, it falls well short. 

Following the icons down the toolbar, the bold icon looks bold, the italics icon looks like it is read to fall over, but the save icon looks like a box, within a box.

But that’s always been the save icon

Yes it has, but why? Because I use to actually put something that looked like that into my computer, click that button, and then take my stuff floppy disk out and walk away. Surely since we don’t save to floppies anymore there has to be a better icon. Some progressive company like Google surely thought this up already and I’m sure they have a cooler save icon on Google Docs. Nope. They still use . That’s actually a different icon, even through they look identical.

So why is the blue floppy disk the de facto save icon? What would a better icon be? Will people in 10 years still be putting floppy disks on their Minority Report UI’s? How could you even change something that is already so installed into nearly every user’s brain of every software community.

There is probably no other visual clue that is so widely understood. Not even the X to close a window is shared across platforms as much as the save icon. So maybe that is the reason why it has never changed and Tom Hanks is going to punch his floppy disk floating in mid air. The cost of breaking those now decades of education is too expensive.

We’re all going to be angry monkeys because angry is the new content. We stop you from climbing the latter, not because we know the outcome, because if you climb it, we all have to climb it in order for it to work.

Written by Mark in: Uncategorized | Tags:
Jul
28
2008
0

ReSharper Tip of the Day: Go to File Members

Everyone uses, or at least knows about the member dropdown in Visual Studio

ReSharper will give you that same list of members in the current file via Alt + \ and let you search on it.

Again, don’t forget how powerful the ReSharper search boxes are. 

Written by Mark in: ReSharper Tip of the Day | Tags:
Jul
25
2008
0

ReSharper Tip of the Day: Go to Next Tip

It’s obvious that R# gives us outlines several problem areas in the right gutter.

Did you know you can use Alt+Page Up/Page Down to cycle between them?

Written by Mark in: ReSharper Tip of the Day | Tags:
Jul
24
2008
0

ReSharper Tip of the Day: Create a New Method

I needed to create a list of categories in my class that I want to populate using my facade. So instead of going to the facade and creating it there, let’s just do it right here where I need it. It’ll help get the signature right, granted this one is pretty simple. I type how I want to use it and press my handy dandy Alt+Enter.

Why yes Resharper, I would like to create a method with that exact name on that exact class. Thank you. It generates the stub for the method in the right class.

Here is where I start my unit testing.

Granted this method was really simple, but if you had two or three parameters it becomes much more valuable.

Written by Mark in: ReSharper Tip of the Day | Tags:
Jul
21
2008
0

Welcome to Fooberry!

Welcome to Fooberry.com where sweetness has no context. This is the replacement site for Ontological Reciprocity, which was too hard to type and to difficult to explain. This will be the new home to my ReSharper Tips of the Day and any other ramblings I might have.

So welcome everyone and I hope you enjoy what I have to say.

Written by Mark in: Uncategorized |
Jul
14
2008
0

ReSharper Tip of the Day: Go to Type

Today’s is a shorty, but goody. Do you need to go to a type, but don’t want to find it in the solution explorer and don’t have a reference in the current source to go to definition?

Press Ctrl + T:

clip_image002

Type the name you are looking for:

image

Arrow down and press Enter.

Written by Mark in: ReSharper Tip of the Day | Tags:

Powered by WordPress | Kredit | TheBuckmaker