Moved from TextMate to MacVim

Being a developer, you should be very thoughtful about your tools. You pick programming language, operating system, system shell, font, color-themes and most favorite of all; Text Editor!

I have used many text editors in more than a decade long programmer life. As I am working on Ruby on Rails my obvious choice was TextMate. I used it for a while and thought to give RubyMine a spin. Since I was a Java developer for most of my career, I extensively used IntelliJ IDEA. No doubt it is the best IDE for Java developers out there! Eclipse and Netbeans are good but they have no upper hand when it comes to extensive features which IDEA provides. That is not the point of this post so I will skip writing about it.

RubyMine has the most of the key-bindings same as InteliJ IDEA and it was very natural for me. I didn't need to learn anything new to get productive in RubyMine. I loved it. Very soon I realized, all the features which made IDEA so great, are not very important in Ruby on Rails! e.g. refactorings, type checking, name changes etc. Since Ruby is dynamic language, type checking is not required. When it comes to refactoring variable names, you can't trust an IDE to make those changes by itself! Properties hidden behind meta-programmed methods are tricky to find and rename accurately. So in short all the great powers which IDEA boasts, are not required.

Did I mention RubyMine is resource heavy? :)

So I went back to TextMate tried it for second run. TextMate is great editor. Period. I enjoyed working in that software a lot. It has almost all the features any developer will need. It got its popularity in Rails community but it is useful for anybody for any text-editing needs.

When it came to searching full project or loading large files, TextMate isn't the king of the land. It often shows you pretty spinning wheel and lets you wait for long times. Sometimes it just refuses to load large files which you accidentally open. e.g log files.

So I thought, let's try VIM. I used VIM for last 10 years as my terminal editor of choice. My usage was very limited and not VIM specific. I could have done all the editing using pico without a doubt. So I wouldn't call myself a power user of VIM for 10 years.

I met a guy on my last project (Selvakumar Natesan) who introduced me to MacVim as Rails IDE. I used it for a while and loved it a lot. Although, I was fairly naïve in terms of its usage. After a while the enthusiasm to use VIM faded away and I was back to TextMate. On my current gig, I met two guys who were using VIM regularly (Priyank Gupta and Carl Leiby). This gave me another reason to start using it, and I did it this time!

I realized that I can't just depend on my pair to drive most power from VIM where I just stare at them and appreciate VIM. I needed to learn it and get used to that style. So I did spend some time reading cheat-sheet (more time in practicing!) and watching few screencasts where people showed few cool tricks.

After spending couple of weeks working daily on VIM, now I am fully productive and don't have any reasons to switch to TextMate or Rubymine anytime soon. I think I found my soul-editor. :)

If you're interested in switching to VIM as well, here are few links which helped me a lot during this transition:

  • A Starting Guide to VIM from Textmate: This guide will get you rolling pretty quickly on VIM if you are on Mac.
  • Janus VIM Configuration Bundle: Undoubtfully most comprehensive set of tools for RoR development using VIM. I use non-customized version of this currently.
  • PLAY BY PLAY: GARY BERNHARDT  : Very good screencast if you want to see a pro using VIM in 100 min video. I paid $12 for that and it was totally worth it! There are bunch screencasts available for free as well. Look for them.

On Github you'll find all the help needed to bootstrap to your new development environment.

After learning this, all I can say, "It is easier than you think!"

Posted in Articles, Developer, General, Ruby on Rails | Leave a comment

Hacking with Arduino

Recently I started learning about Arduino and its applications. Lately, I started coming across really cool projects done with this small wonder. Few interesting once are -

  • Secret knock detecting door (link)
  • High speed photography using Arduino (link)
  • Arduino project>

I didn't know that micro-controller programming is this fun. All these years, I wrote software in higher level languages and thought micro-controllers are for only electronics engineers. I was obviously wrong!

Arduino is fully open-source and community supported. Arduino programming happens in C++ and all the software required for programming is available for free from its website. You can develop for Arduino on all popular platforms and its very fun to use. All the Arduino libraries are well documented and it won't take long before you build something cool in the world of physical computing.

I have created a simple LCD display library as well. I am still learning my way around this and expecting to do better in coming days. You can find all my Arduino projects code on github.

Want to do more hacking in coming days.

Posted in Articles, General | Tagged , , | Leave a comment

Android: Downfall or Prosperity for Google?

Android, launched in 2007 by Google is a huge success. Recent sales reports show that Google is beating iOS by 2:1. This is no small feat. When Apple released iPhone, it felt like best thing ever. It was. Android had huge gap to fill before it can stand strong against apple. With huge innovation put in by google and other supporters, android soon became really popular. This success is coming as result of OHA (Open Handset Alliance). Mobile manufacturers and carriers poured in their efforts in customizing, marketing and making android a huge success.

This deal is a win-win for Google and OHA members. Google got their search and ad revenue, OHA members got buzzing hot operating system for practically free.

I read Harvard Business Review article about android, I was seriously thinking about future of Android and Google. I am no business expert but I am seriously disappointed by authors narrow point of view on android and its future. Android has its serious issues, but the goldmine of google is not going to get shut-down just because default search engine.

Let me step back. Google released Chrome browser. They allow you to change your default search engine to Yahoo, Bing. I wonder how many did that?

Ubuntu changed default search engine provide for Firefox to Yahoo! I wonder how much search revenue Yahoo gained? People can switch back to Google if they want to. If you care, you will change it.

Android is just not about search engine revenue. If you perceive google wants to just get more search hits, we are making a mistake here. Google makes money by ads in apps, search hits and apps sales. Navigation, Gmail, Google Voice is all done by Google. People want to use these services on iPhone as well if they could.

Fragmentation

Android suffers from fragmentation. OHA members keep maintaining their own version of android, resulting in splitting away for mainstream android. How many Linux distributions exist? 1500. How many are known to most of the users and well maintained? 10. This is same situation, if more forks will happen, away they go from benefits of android. It will be nightmare for application developers to support app on all the devices and operating systems.

All OHA members should keep their changes to minimal from mainstream. Easy and fast upgrades to customers. I had android 1.6 on my mobile 6 months after Google released android 2.2! This is plain unacceptable. We shouldn’t forget, one of strengths of android lies in upgradable operating system. Better software is pushed to phones to improve performance or add new exciting features. Gone are the days when people purchased smart-phones and never updated their firmware.

If Google keeps innovating on android future versions, customizations done by Baidu and Bing will not impact them much. This will keep user’s interest in using Google’s version of android and not a third-party. In the world of open-source best product always wins. People will always have freedom to replace their firmware if they are not satisfied with what they got.

Hardware Differences

Android has been around for 3 years now. Android has more than 225 handsets so far. Various hardware configurations and processing power. Optimizing android experience for all these devices is a complicated task. You can see the same problem with iOS family as well. Already 1st gen iPod touch can not receive updates of latest versions of iOS.

Introducing Nexus One was very good move by Google. Unfortunately that didn’t fly well. Nexus one gave users option to have a phone which is free from customized versions and you can always install latest android community software without any special customization.

In coming days, it will be interesting to see how Google does with second version of Nexus. Google should keep introducing successors of nexus on regular intervals. There is huge value in showing customers and OHA members what is value in plain vanilla android version.

Where Google Wins?

Google wins at innovation. That will be always a deciding factor in future on android. Maps, email, contacts, purchases all things tied down to your google id brings tighter integration to phone. This strategy puts android in-game for now, at least.

Google makes money from iPhones, Windows phones and android devices. Quality of products will decide future of companies who are manufacturing these phones. iOS is a strong competitor for fair reasons.

I have no intentions of declaring a winner here. One thing for sure, android gave a very strong alternate to iPhone and is pushing forward the competition on every milestone. This competition will bring better and better things for consumers no matter who wins.

Posted in Articles | Tagged , , | 1 Comment

DNS-323, PS3 and UPnP

I recently bought Dlink DNS-323. I am using this in RAID 1 mode to copy my data and archive images.

Dlink DNS-323

I am also using it as media server (UPnP) for streaming video / audio and image content to PS3. The whole setup is very easy and lot of fun! I copied entire catalog of movies / audio and digital image archive and realized the setup is not working properly. I kept getting error while movie streaming on PS3.

"This content cannot be played (800288D8)"

I was very frustrated by the error message. Earlier I thought this is happening due to lack of processing power at DNS-323 end. After careful examination that possibility faded. DNS-323 has Marvell 500 Mhz processor, 64 Mb RAM, 1000 Mbps Ethernet connectivity. There are two Samsung Spinpoint 1 TB each HDD placed inside. I wasn't expecting any bottlenecks for couple of users.

I was about to return the unit and then I came across this fantastic online resource. I installed Mediatomb as UPnP server and disabled in-built application. This allowed me to have seamless access to my video content without any issues! I will recommend you to install this on your DNS-323 so that you can enjoy secure storage and media server. :)

This setup is good for -

  • Archive of all of your files. No more nightmares of hard-drive failure!
  • Cheap and abundant storage.
  • Media serving capabilities at home.
  • Expose firewall-enabled FTP server over internet.

Don't expect miraculous speeds though. 3-4.5 MBps is average transfer speeds for me. This is enough for me to backup and access stored data. For faster access, I prefer firewire or USB 2.0 drive. Figure out yourself about your requirements. Ciao!

Posted in Personal | Tagged , , , , | 4 Comments

Rewards of “Frequent Check In”

I have worked with many developers and many times, I ran into following conversation. Whenever we are in the middle of development and I ask for checking in the code, one of following reply is heard -

  • Umm, lets do check-in towards end-of-the day. We are not yet done with the code.
  • Let me clean up these things and make them perfect.
  • I don't want to check-in as I have some ongoing changes and I can't checkin partial files.
  • Lets checkin tomorrow when we complete major functionality.

I am sure you must have heard similar conversation (or had it). Can you give a moment and think about why do are we afraid of checking-in? I have been constantly thinking about this issue and there are many reasons which makes sense on this issue. Few of them are -

Fear of bad code - Developers are afraid of peers criticizing their code. Its GOOD! Believe me, you're never going to write perfect code without receiving feedback about it. Sooner you receive the feedback, better you perform in short time. This is the reason, people don't make their changes public until they are convinced that they can't do any better. It is clearly a false fear.
One of the way to improve and influence your team is to make your work public as it is in progress. This way, you make team aware of your approach. If there is any conflict in approach or disconnect in understanding, it becomes visible sooner and you can resolve it better.

Not sure about impact on other parts of the system - Yes! This is very valid reason. You're in middle of a feature and you're not sure how it will impact rest of the system if you check-in early. Half baked features can take the whole system down. To get over this fear, unit testing your code, running a full build before check-in and having continuous integration makes sure your changes are fail-safe. Make sure that you are providing a working build to the team by writing solid unit tests and more comprehensive integration tests.

Working on multiple parallel streams - It is often a bad practice to work on multiple parallel streams of work. Even worse when you don't commit any of those changes in VCS.
If you're working with DVCS like Git, it is very easy to branch and commit code. If you're working on central VCS like subversion, then it is little tricky to keep your parallel working streams with minimal effort. There are few simple things you can do to make your life little easy -

Use DVCS. This will prove immense value in long run, if you use it properly. There is a learning curve associated with it, but it is definitely worth it.
If you are using SVN, create a branch if it is a big change. If it is small change, evaluate if you can checkin without breaking application. Taking patch is another option too. Use unit testing safety net on your side and make sure you progress smoothly.

In any situation, its not helpful when you're working on parallel streams of work and those changes co-exist. I have often observed people checking in partial or missing content. This happens when they are confused and trying to understand what all files are required to make one of streams live.

Why frequent check in is important?

  • Getting feedback from your application and team.
  • Never lose any of your changes and hard work. Machines do crash and when they do, its bad!
  • Avoid stepping on each others toes, particularly when team is distributed and code churn is faster.
  • Making whole team aware of your approach and remove silo operations. This helps bringing everybody on the same page and triggers conversations whenever required.
  • You can't explain in 30 minutes of speech what code explains in 10 minutes. It eliminates confusion.
  • Discipline of frequent checkin allows you to make sure, changes are not causing any conflicts.
  • Smaller changes, encourages you to refactor and improve code quality.

If you want to read more -

Golden principle of development: Check-in-early, check-in-often.
DVCS introduction from the master: Google Video on Git.
Continuous integration: Wikipedia entry.

Posted in Articles, Developer, Programming | 4 Comments