Aug
21
2008
1

Review: Pragmatic Programmer (part 1)

After a few days vacation, I didn’t end up finishing the Pragmatic Programmer, but I made a significant dent in it. I read the first half on the way out, but spent the rest of the time relaxing by the lake or napping in the hammock. I’m glad I didn’t finish the rest of it because it was nice not doing anything.

I’ve found the book a surprisingly easy read so far. Most technical computer books I’ve read take some serious brain power to  chew through; however, this one provided plenty of analogies such as Stone Soup, Helicopter Controls, and Broken Windows that even a non-technical person can grasp what he is saying at first glance. 

One part of the book highlighted a talent of programmers I’ve admired. In chapter 4, if I recall, it mentions how the shell is extremely powerful and worth the investment to learn.  I whole heartedly agree. In addition, it recommend to know and use a single editor. 

I look forward to the rest of the book. Hopefully it doesn’t start collecting dust.

Written by mark in: Bookshelf, Programming |
Aug
21
2008
0

Ada Turns 1

Sorry folks, the programming language Ada is far older than one year old, and Ada Byron is even older still, but my baby puppy Ada turns one year old today.

Lovely Puppy

All good nerds, as my girlfriend puts it, has a dog named after a scientist. Doc Brown had a couple, Einstein and Copernicus.

Written by mark in: Nonsensical Rant |
Aug
19
2008
0

ReSharper Tip of the Day: Refactor This

The people at JetBrains have their ear to the ground again. After complaining about how introducing a variable via a keyboard combination wasn’t very discoverable, JetBrains came through again with pointing out Ctrl+Shift+R will point out all refactoring available in the current context.

Written by mark in: ReSharper Tip of the Day, Uncategorized | Tags:
Aug
13
2008
0

ReSharper Tip of the Day: Generate Equals

We’ve all probably had really basic POCO classes like this:

public class Fooberry
{
    public string Foo { get; set; }
    public string Bar { get; set; }
}

…and we’ve probably had to override Equals on them. When I went to go do it this last time, I saw ReSharper was trying to help me out.

So I expanded the context icon to see what it would do for me. It turns out it does something really cool.

It will complete the Equals statement for me! Awesome! I hate writing that method over and over.

Yes…I would like to compare those items…and we’re done!

public override bool Equals(object obj) {
    if (ReferenceEquals(null, obj)) return false;
    if (ReferenceEquals(this, obj)) return true;
    if (obj.GetType() != typeof (Fooberry)) return false;
    return Equals((Fooberry) obj);
}

public bool Equals(Fooberry obj)
{
    if (ReferenceEquals(null, obj)) return false;
    if (ReferenceEquals(this, obj)) return true;
    return Equals(obj.Foo, Foo) && Equals(obj.Bar, Bar);
}

public override int GetHashCode()
{
    unchecked
    {
        return ((Foo != null ? Foo.GetHashCode() : 0)*397) ^ (Bar != null ? Bar.GetHashCode() : 0);
    }
}

Pretty awesome if you ask me! The only downside is if I add new members to the class, I need to either add the tests in manually or generate the whole thing.

Steve (a co-worker)’s sharp eye noticed the unchecked keyword, and neither of us has used it so after looking it up it avoids overflow checks and trunks anything that would exceed normal bounds.

Written by mark in: ReSharper Tip of the Day | Tags: ,
Aug
13
2008
1

ReSharper Tip of the Day: Move Member Up|Down

I’ve been using this tip a lot today, so I thought I would post an internal tip passed along by Josh Buedel, a super sharp coworker of mine.

Some folks are real anal about how their class members are organized within a class. Often I find myself working on two members within a single class and I want them juxtaposed just for that editing session. Eventually I want to put them back. Whatever the reason, reorganizing members via cut and paste can turn into a mistake prone mess, especially when method bodies are long.

R# to the rescue with the Move Member Up/Down feature. Place your cursor anywhere on a member’s signature area, then Ctrl+Alt+Shift+(Up|Down) to move the entire member either up or down, shifting other code around it as you go. This works on methods, properties, even nested classes. And it pulls your 3 bar /// code comments along with it. Check out this sweet vid.

Bonus!: Issuing that four fingered hot key combo feels like you’re giving your IDE a so-who’s-the-boss-now-huh b!tch slap.

Written by mark in: ReSharper Tip of the Day | Tags:
Aug
12
2008
0

New Bookshelf Resident: The Pragmatic Programmer

I should come up with a new title for this category. Hopefully it is not a bookshelf resident, but gets read, passed around, written in, referenced, anything but sitting around gathering dust.

After a recommendation from a friend, and anticipating an upcoming vacation, I decided to use a Barnes and Nobel gift card to add The Pragmatic Programmer to my bookshelf.

It has come highly recommended and I look forward to getting into later this week. I was pretty sure David Thomas was the origin of the Angry Monkeys. In addition, he has several other books from his pragmatic bookshelf which are all highly rated.

I’ll be sure to post more as I make my way through it.

I passed on several other books. I was also considering, in several combinations:

After seeing the alternate cover for Here Comes Everybody, I remember where I first heard about it. Jeff Atwood wrote a post about him recently. Maybe that book bumps up a few notches on my reading list now.

Written by mark in: Bookshelf, Programming, Uncategorized | Tags:
Aug
12
2008
0

ReSharper Tip of the Day: Disable ReSharper in a File

Seeing the referring URL’s to fooberry.com has introduced me to some new sources of information. Even though there aren’t that many referring URL’s, …yet, they have some really great stuff.

The one that has the most diverse information in a single post is A Continuous Learner’s Weblog. It’s really great that he records the links he’s found useful over the past week or so. It’s something that I wish I had perseverance to do.

Anyway, to the tip of the day… He linked to my tip of the day, which led me to this tip.

How to disable ReSharper for a file: [CTRL + 8]

I’ll let you read it on their site. It would be really useful whenever we open up 10k lines of generated code (hopefully generated code) to see what’s going on.

Written by mark in: ReSharper Tip of the Day | Tags:
Aug
11
2008
1

Gymnastics Is Like NASCAR

I cannot get enough of the Olympics. I watch whatever is on at the moment, and flip between the concurrent events. When I say anything, I mean anything. I’ve watched badminton, field hockey, even equestrian.

When gymnastics came on last night, of course I watched, but I didn’t know what I was really watching. I decided it was a lot like NASCAR, which made my girlfriend think I’ve lost my mind, but it is exactly like NASCAR. I have no idea what I’m watching, but I know if they crash/fall it’s bad, and I really want to see them crash/fall.
The only differences is I don’t watch NASCAR, but if it was an Olympic event I absolutely would!

That probably seems really morbid or horrible. Really though, it all looks the same to me. I get handball. You put the ball in the net more often and you win. I get weightlifting. Lift more weight and you win. I don’t get gymnastics and equestrian. Seriously watch an equestrian event. It looks like they are walking around in circles.

Don’t get me wrong. I am positive that what each of those athletes do is extremely difficult and I cannot imagine the amount of training, effort and passion it takes to compete at that level. I just can’t see what makes someone better than someone else unless they fail miserably.

Written by mark in: Nonsensical Rant | Tags:
Aug
11
2008
3

ReSharper Tip of the Day: Introduce Variable

I recently wrote a post about how I wish I could have a context action to replace a string literal with a new constant. To my surprise, someone from JetBrains posted a comment saying it would already do it.

It isn’t as discoverable as other context actions, but it does work. With your cursor in the string you want to replace, you can press Ctrl+W to extend the selection to the entire string. This is important. Without selecting the string, it will try to introduce a variable for the entire statement. With the string selected, press Ctrl+R,V to introduce a variable. It will notice it can replace all the occurrences of the selected string.

Select that you want to replace all the occurrences, and press Enter. There is the constant that I wanted to introduce.

It gives you some suggested variable names too.

Additionally, you can use Ctrl+R,F to introduce a field if you want the replacement at a higher level.

Thanks JetBrains! That would be a cooler context action though.

Written by mark in: ReSharper Tip of the Day | Tags:
Aug
10
2008
1

Hex Color Picker Plugin for Mac OS X

Today, I was amazed yet again by the flexibility of Mac OS X. I was transitioning the color scheme from my text editor to the syntax highlighter for the blog and needed to convert the RGB values to Hex. The first couple I did manually, but realized there must be a utility out there that would do that for me. I found this nice little Hex Color picker.

What really amazed me was how easily extensible the Mac system color was. I dropped the plugin file in a folder, restarted my text editor and it was there. No installer. No registry settings. Pretty amazing.

Written by mark in: Uncategorized | Tags: , ,

Powered by WordPress | Kredit | TheBuckmaker