Showing posts with label vi. Show all posts
Showing posts with label vi. Show all posts

Friday, September 16, 2011

Visual Studio 2010 + Resharper 6.0 + ViEmu + AutoHotKeys = Developer Bliss

I just got a new work machine. It's strictly for work, so my job paid for it. My boss helped me configure it and allowed me to get a few mods that make it even more bad-ass. It's a Lenovo ThinkPad W520 with 8gb of RAM, 500gb 7400 RPM HD, and he also got me a 128gb SSD drive that I plan to swap out for my main drive. It's already fast, but when I'm done with it all, it's gonna scream. :) Thanks Bob!!

My MacBook Pro is still the bee's knees, but it just wasn't cutting it for my day-to-day Windows programming solution. I'll absolutely be using it for all of my personal use and Ruby on Rails development. It has gigs of music, movies, and photos on it, along with my Quicken and lots of other personal documents and files. It will continue to be my Unix playground and I'm very excited to use it for just that... It has retired from the hustle & bustle of the daily grind, and plans to live the high-life now as a "personal computer". It's earned it!

During my transition to my new laptop, I was able to configure my development environment to be exactly how I wanted it. Since my new machine has 8gb of RAM, this allows me to trick my VS2010 environment out to the max without having to worry about slow downs. My biggest problem with Parallels was that I could only (safely) allocate 2gb of RAM to my Win7 VM. I had to disable the nice Aero / translucent theming, and lots of other goodness. Even after doing all of that it still came to a crawl whenever I'd be flying along with my coding. There were times when would literally just have to put my laptop down and walk away or else I would throw it against the wall. This new laptop should curb those impulses. :)

One of the main problems with switching to any new laptop is learning a new keyboard layout. This is especially important for programmers who rely heavily on hot keys, like CTRL, ALT, HOME, END, INS, DELETE, PGUP, PGDN, F[1-12] keys, and the 4 arrow keys. There is no real "standard" for these key locations, and it seems like every computer manufacturer has their own idea of where they "should" go. My personal opinion is that the Microsoft Ergonomic Keyboard 4000 nailed it! I actually own this keyboard and it has moved with me through a few different computers. The function keys were laid out perfectly; they were exactly where they were "should" be.



As you might imagine, it was a hard transition to move to the Mac and learn the key combinations. Especially since the mappings were even altered in order to pass through into Parallels. There was no DELETE key, no INSERT key, no HOME key, no END key, no PGUP, and no PGDN key!! I had to use a combination of other keys to get to those "functions" using Mac's 'fn' key (ie. the fun key). Even the function keys were different; for example I had to know that F[1-7] worked as expected, but F[8-12] required that I press the Mac's 'command' key. After 2 full years of learning these nuances and mastering the different key mappings, I'm now back to the beginning with a new layout of hot keys. Ugh!!

While I can't fully alleviate the pains of switching keyboard layouts again, I can take comfort in knowing that I'm a Vim junkie and Vim doesn't use most of the hotkeys for editing text.
  • [h] = {left arrow}
  • [j] = {down arrow}
  • [k] = {up arrow}
  • [l] = {right arrow}
  • [0] = {home}
  • [$] = {end}
  • [x] = {delete}
  • [ctrl+d] = {pg dn}
  • [ctrl+u] = {pg up}
  • ... and MUCH, much more!
I just needed to find a way to switch up my keyboard mappings to mimic the keyboard mappings of Vim. Luckily, someone has already thought of this!! There is a product out there called ViEmu that extends Visual Studio's text editor with all of the Vim goodness that I've so pains-takenly learned over the last year. I'm currently running an evaluation version of it, but I can already predict that I'll be forking over the $99 for a license very soon. It's simply genius! Thank you Symnum for this wonderful product. :)

Once I installed it, I had to re-enable my ReSharper keyboard mappings going to ReSharper - Options... - Visual Studio Integration - Keyboard Shortcuts and selected the 'Visual Studio scheme'. This allowed me to continue to use things like [ctrl+T], [ctrl+R+R], etc..). There are a few nuances that I need to work around, but in the grand scheme of it all, this is much more fluid than looking at my keyboard every 2 minutes for simple navigation. I'm loving it!



To help further keep my hands on the "home row", I found a post by another fellow-Vim'er by the name of Jean-Paul S. Boodhoo. Jean-Paul described how he used a tool called AutoHotKey to map various key combinations to be more "Vim-like". This way I don't have to use [ctrl+shift+alt+up] to move code up and down. The first three keys are easy (bottom right corner of every keyboard layout), but the [UP] key changes and takes my hand far off the home row. Instead AutoHotKey allowed me to map it to [ctrl+shift+alt+k]... Very Vim-savvy.

I finally feel comfortable writing code on my new laptop. Yesterday was a LOOOOONG day, because I was forcing the new layout onto myself and it slowed my coding down so much. I'm used to coding at the speed of thought, and felt crippled. With ViEmu and AutoHotKey both configured now, I'm flying. The last 2-3 hours have been simply painless.

Now if only Blogger had a Vim editor...

Sunday, January 16, 2011

CodeMash v2.0.1.1 (Recap)

As I mentioned in my last post, Codemash is a top notch event.

Live Concert on Wednesday NightWednesday night ended rather perfectly actually. After the Pre-Compiler sessions, Chris Castle and The Womack Family Band showed up to rock out the attendee party in the grand hall area. These guys were awesome! I purchased a CD of the Womack Family Band after their set, and purchased Chris Castle's CD directly off of iTunes. They had a great sound, and best of all they were fairly local (Norwalk, Ohio).

I got to talk with a lot of people at the party, and Jennifer came to join me after she got the girls out of the water park. We had a great time and she got to see me in my element (true geek talk). I ran into a few people and we would just start talking about programming languages and different technologies. She was a sport and stood by my side with a smile the entire time. :) After the attendee party, we walked around and ended up sitting at the bar for another hour before calling it a night.

Chad Fowler KeynoteThat next morning, the alarm went off fairly early for me and I was out the door for breakfast around 7:30 am. Chad Fowler was the keynote speaker this morning and he did an AWESOME job. He talked about what defined "quality" in code and showed lots of different examples. One story that caught my attention was a discussion about a chunk of code that he looked at and thought it was horrible, but then later discovered that the code has not been touched in 20+ years and was still working... That little story gave me a whole new definition for "code quality".

Kids Programming - Aydin Acksu

After the keynote, I attended a session by my good buddy Aydin Acksu, titled "Kids Programming". Of course, my girls all met me there for it and they got to control me around a grid using commands: step, step, right, step, left, step, etc.. This taught them how how computer programs worked. Once they ran the the commands once, they would navigate Aydin back through the course to "test" the program, and then they "edited" the errors out to make it faster, and "tested" it again, etc... Basically everything a programmer does with a keyboard and a debugger. It was really cool how he approached the talk and all the kids in the class had a blast!

Rails A to Z - Matt Yoho
After that session I attended Rails A to Z by Matt Yoho (from EdgeCase). I learned quite a bit at this session and was amazed at how little code is required to make a Rails app. With about 10 lines of Ruby code, a user can connect to a database (build its schema), add records, and then disconnect (and destroy the table). This would take about 50 - 100 lines of c# code. Wow! Matt did a great job and he had my undivided attention for the entire hour.

WebMatrix 1.0 Product Launch - Josh Holmes
For lunch, we got to see WebMatrix 1.0 be launched to the world along with a lot of other amazing technologies (details). Codemash ain't no joke no more. This event has had all kinds of top notch speakers, and this year Microsoft had live streaming video from the conference to developers all over the world about this long awaited product launch. Congratulations to Codemash organizers for outdoing themselves each year. See Scott Guthrie's blog post for a list of everything that was announced today.

After the keynote, I skipped the next sessions, as there was nothing being presented that sparked my interest. I used this time to get in a quick run and workout in before the rest of the evening got ahead of me. I actually met a guy in the gym (ironically named Jim), who is close friends Mark Goodale (a local ultra-marathon hero). What a small world! We talked for about 30 minutes while we ran on treadmills next to each other.

Top Ten Tips for Moving from WinForms to WPF - Michael EatonThis session was pretty informative. Michael broke down all the differences between WinForms and WPF. I actually dabbled in WPF for a few weeks last month and got so frustrated with it. It was such a paradigm shift from everything I'd ever learned about windows application development. Buttons with click events and coordinates get's thrown out the window. Now developers use DataBinding to UIElements on various types of LayoutPanels through MVVM... Yeah!? Anyway, Michael's session confirmed that it wasn't just me. :) He gave some tips and suggested some 3rd party tools to help ease the pains. Great talk!

A Modern Open Source Development Environment - Gary BernhardtThis session was one that I was REALLY looking forward to even days before the conference. Gary uses terminal app and Vi as his development environment. This is what would eventually like to do as well so that I don't rely so much on VS2010.

Unfortunately the session was more about him showcasing how fast he types and navigates through different commands inside terminal. He didn't really focus on useful tips for users to do the same. It kind of turned into a "look what I can do" session, as opposed to a "here's how I do it" session. Don't get me wrong, I did learn something; I learned that I need to just bite the bullet and use vi exclusively outside of my day job. All in all, nothing very "constructive" came from this session (for me). He moved too fast, and assumed everybody in the session was familiar with Vi, Pyton, shell scripting, Git, and zsh.

He did answer a lot of questions about how he got so fast, but again he didn't explain anything with hard examples. It was mostly just pre-recorded videos of him typing in vi while he commented about his typos in real time, and then summed up the video with a benchmark. It wasn't what I thought it was going to be... :( I'm still a Gary fan though, and will continue to follow his blog: http://blog.extracheese.org/

Ford Fusion Keynote - Tj GiulliFor dinner, we all got to hear a developer from Ford talk about some of the new technologies that they are putting in cars, and it was pretty cool. Tj showed some of the new GUI's for the upcoming nav screens. He showed how traveling with a group of other drivers can be more "interactive" in that each car can talk to one another to know how low they are on fuel. Lots of other cool stuff was in here too, where the car could actually tweet it's status at any point along the route (ie. "Pulled into Taco Bell" or "I need fuel soon"). Pretty cool stuff really. Best yet, there was an API that was available to allow developers to tap into the engine and interface with it. However, I must admit that the API was a bit kludgy with their use of multiple yield keywords inside of a single void method. (?)

Cocktail Party, Jam Session, & Water Park Party
This is where it got fun! We all got to loosen up and mingle for the rest of the night. My good buddy, Greg Malcolm helped me setup my drums this year for the jam session. We had quite a turn out this year. Best of all Chris Castle and The Womack Family Band came back to the Kalahari to jam with us. They brought their gear back with them too. Of course, Carl was there and he's always a great entertainer. Again, we had quite a little crowd gathered up at a few points. There are a few videos on YouTube that showcase some of the shenanigans. :)

After the Jam session, Jennifer came to retrieve me so that we could all go to the water park and swim. The girls were so excited that I got to go with them and we had a blast!! We played water basketball, we hung out in the wave pool, and just relaxed and had a great time. After the water park, we split out separate ways and I went back to the grand hall to gather my drumset. As it turned out, I sat down and talked with Carl and Richard for a while on a couch and then we all headed back to the water park to mingle with other devs and get some drinks. There I met Justin Etheredge, and we talked for about 30 minutes about Ruby on Rails, and various javascript utilities that we used.

I didn't get back to the room til about 1 am.

Developing High Performance Web Applications with Javascript - Timothy FisherWell... I wanted to go to this, but couldn't. :( I slept in and rushed down to the breakfast area with moments to spare, then had to turn around and head back up to the room to get it back in order. Checkout was at 11 am and there was a LOT to do. Jennifer and I got it all done around 10:45 am. I kissed them all good bye and headed back down to the sessions... Jennifer was going to get some candy from the candy hut and then make the drive back home.

Rules for Good UX Design - Joe NuxollThis was a great session. Joe is an old Borland, turned Apple developer who now does other things I guess (?). Anyway, he had lots of useful information on what NOT to do with user interfaces (avoid "assy-ness"). :) He showed me some old user interfaces that mimicked some dialogs that I once (or twice) built that make end users cringe. He also showcased many user interfaces that were simply beautiful, and that hid a LOT of underlying complexity. This guy clearly knows his stuff and everybody in his session learned quite a bit about good UI design.

GitHub Keynote - Scott ChaconThe lunch keynote on Friday was pretty interesting. A developer from GitHub.com came to keynote about how they run their business. Basically, there is ZERO business processes or management structure across the entire company. Clearly it's working for them, but it has disaster written all over it in my eyes. From what he explains, people just kind of do whatever they want, whenever they want and for whatever reason. It's a very "open source" environment and sounds rather risky to me...

Everybody in the company has full trust of the entire enterprise. Everybody has the ability and permissions to do whatever they want. This means that anybody at GitHub.com (from the new guy to the CEO) could delete the entire site if they wanted to. Of course, this would never happen (or should never happen anyway), but the fact that there are no checks in place to prevent such a disaster seems a little haphazard to me. Scott indicates that everybody at GitHub gets the same pay. There are no vacations; you can just do what you want, whenever you want. No meetings, no deadlines, no feature list, no time frames, no nothing... It's amazing to me that they've had no problems yet. Good for them, but I (personally) like having a little bit of structure and credibility for my actions. Perhaps I'd feel different if I was put in this environment and saw it work. To me it seems a little chaotic and unpredictable.

How? It's because each employee is passionate about what they're doing.

Infinitely Extensible - Alex PapadimoulisThis was a great session. I follow Alex's blog (ie. The Daily WTF) and knew that this guy has seen it all. People send him code snippets from some of the most crazy logic puzzles. Many are just bad programming, but some are really funny dialog prompts that developers thing users would never see. Check out his blog to see what I mean. :)

Anyway, the session talked about how to keep it simple and avoid over-engineering simple problems. We as programmers do this by default; we over complicate everything and try to prepare for future enhancements that may never see the light of day. I really enjoyed his talk because it showed me things to look for when I sit down and start over engineering simple problems.

Anatomy of an E-Commerce Website - Joe WirtleyI was pretty excited about this session too. Joe is a really nice guy that I run into quite often around various events throughout the heartland area. His session was great and he basically just described how an international e-commerce site is setup to deliver real time results using caching and highly optimized data services across multiple databases. I learned quite a bit before I had to sneak out of his session...

Node.js - Open SpaceUnfortunately I had to sneak out of Joe's session because I was really interested in learning about node.js. It was an open space idea that somebody posted on the board and I wanted to see what it was all about. As it turned out, I got there way too late and didn't really get anything out of it. :(

Awards and Wrap-upAnother year passes, and I don't win a damn thing. GRR!! I guess I'll just have to come back next year and try again. :)

I'm now extremely excited about Ruby, Rails, Git, Shell scripting, Vi, and all things Unix. I plan to consume myself with knowledge of everything Ruby until I'm comfortable with all that it has to offer. While learning Ruby, I'll need to learn terminal app and vi pretty extensively. But that goes with the territory and hopefully I'll "get it" so that it can just get out of my way and I can focus on being productive on my Mac.

This all starts now!