Thursday, October 9, 2014

Books - your next best mentor

For a long time I was of the opinion I have read a lot of books back in school and college days and I wouldn't probably ever have to read that much going forward, from thereon. With the advent of online tutorials(videos, blogs etc.,), sometimes, there used to be a feeling within me that one can learn faster through videos and similar media then why should I even consider reading books that much?. I thought reading books might be more time consuming compared to these alternate resources at my disposal. That's kinda true but doesn't really apply always. Below is an experience that I went through which may tell you why..

Recently, I had applied for a job to a company where their first round of interview was actually a coding assignment. The way this works is, you're given a problem statement and you have to solve it within two days(ideally this is taken up by a candidate during a weekend). After submitting the solution to the problem I had requested them for some feedback. The interviewer was kind enough to share the same and highlighted a couple of important pointers after reviewing the submitted code. Overall, out of all the points shared in the form of feedback by the interviewer, I was able to clearly comprehend only some of them.

Out of the points I couldn't really understand very clearly was that my logic to the solution was procedural. I did know what procedural programming is but I couldn't really get a succinct understanding of how I was writing procedural code using an object oriented language like Ruby as part of my solution. This might seem very technical, if you're a non techie who is reading this but the basic point that I'm trying to drive home here is I was for a while lost as to how can I improve further on the quality of my code or solutions that I'd submit going forward without guidance from a physical mentor.

As a work around, I took to reading this book by Sandi Metz called POODR. I had heard enough through people's reviews/recommendations about this book before I decided to give it a shot. It not only helped me better understand what I was missing with respect to my solution but also really opened my mind to looking at developing solutions differently at least from what I had learnt thus far.

This overall experience made me reflect that sometimes, when you don't have an actual physical mentor to guide you, you can with no second thoughts rely on books. After all, people who've written books also would have their experiences and them sharing it in the form of a collection of many articles is for us learn from their experiences and broaden our ways of thinking by looking at things from another's perspective.

One more thing when I look back from this experience, I realized I was actually reading some books even as part of my professional career, not that religiously but definitely I was picking up some important lessons that I could apply in my job here and there. It was just that I didn't realize the true value of those books back then.

From now on, I'm going to make it a point to read more books regularly as they can really help me not only when I need guidance but also to open my mind to new ways of thinking, sometimes making me think - "Hey!, why didn't I think about that :)". Just one thing, just make sure you choose your books wisely. So what book are you going to read next ?:).

Sunday, May 25, 2014

Learnings from participation in my first Open Hack

Hi there,

I’m grateful to Multunus for hosting an Open Hack on 24/5/2014. Let me just start with telling you a small tale on how I made it there. Read on :)

Background -

The day I heard about this event and by the time I registered for it, I was quite late. But nevertheless, I dropped a mail to Vaishnavi from Multunus and she promptly replied and asked me to register on the waiting list although I had faint hopes of actually making it back then. Just one day prior to the actual event I got a mail from her in which she mentioned about a last minute drop out and I was happy I could fill in that person’s shoes. 

Getting Started -

Coming up with ideas for the open hack could be interesting as you can even take up something inpromptu. Some of the participants did come with some plans as to what they'd want to work(which is a good thing in its own way). The way people ended up working on ideas was after their self introduction and also after stating what they'd like to work on with what language they'd like to use for the same. I think the best part of this brainstorming session was that when anybody came up with an idea as to what they'd want to work on, ideas kept coming from other participants as to what else they can do to or how they can actually better go about better implementing the original idea. 

For instance, this happened with me. I wanted to contribute to Rails documentation and I was suggested why don't I try running a spell checker on the app to get a quick fix :). I was like yeah, why didn't I think about this... Hmm..

Learnings - 

I've just tried to pen down some of the learnings that I had as part of my participation at the event. I'd be glad if someone finds it useful.

a. For contributing to the Rails documentation, you don’t really have to run your tests. When we commit any documentation back to Rails, what we need to do is add [ci-skip] as part of the commit message.

b. The exact path where you’d want to contribute to the rails documentation would be - https://github.com/rails/rails/tree/master/guides/source

c. I always wanted to know why so many developers these days are using Mac till date. During Lunch I had a discussion with a couple of well experienced folks(Swanand, Nikhil) who were using Mac and they gave me great insights on how Mac can help speed up your development on a day to day basis in comparison to Linux based machines. Their inputs are summarized below to what best I can recall -
i. One of the most important pointers that I found during the discussion was that the defaults that Mac comes with wrt Rails development help you really speed up your work.
ii. They also mentioned that Apple comes with great hardware. The Mac book Air for instance comes with 8-9 hours on an average with a single charge.
iii. Also they recommended to get it from the US in case you’d like to save some money and in case you’re buying from India, buying from an Apple Store would mostly be your best bet to get the latest products.

d. Couple of useful links that can help you getting started when you want to contribute to rails -

e. I learnt about a new rake command- rake -A -T
i. rake -A: gives you the list of rake tasks which have a comment about what each one does.
ii. rake -A -T : Not only gives you the list of those rake tasks which mention what each task could do but it also lists down those rake tasks which don’t have a comment against them as to what they can do.

f. Generate Raw SQL using ActiveRecord::Base.connection.execute and extracting a hash out of the same


   
g. If you want to upgrade your Rails project, this link will be very project might be very helpful - http://railsdiff.org/

h. In case you want to contribute to an Open Source Project and don’t know where to get started the best thing you can do in such a case is -
i. Clone the project
ii. Grep for to do or fix me and that should get you started...

Some Pics taken at the OpenHack -






All in all, I don’t think I would have learnt this much if I wouldn’t have attended the event. I can definitely tell you that you’re being regular to such events/meetups really broadens your perspective around things and definitely helps you ending up learning more. 

Lastly, I would once again thank Vaidy and team at Multunus for being such good hosts.

Thank you.

Credits to Dheeraj Kumar for points e. and f. 

P.S.: Credits to all those inputs helped learn me new things. I’m sorry if I missed mentioning anybody’s names, I'm not able to recall all of their names at the moment. Feel free to correct me/comment below in case I missed something or in case you’d like to add more pointers with respect to the above article.

Saturday, May 17, 2014

Useful RVM commands

RVM stands for Ruby Version Manager. A handy tool to help you manage different Rails projects(on different versions of rails) that you've setup on your system. It also help you easily switch between different Ruby versions.

Below are some useful rvm commands that I use from time to time-
1. rvm list known
To list all *known* RVM installable Rubies
2. rvm current
The current version of rvm you're using
3. rvm gemset create gemset_name
To create a new gemset. It's quite useful when you're system has multiple apps installed, each using different versions of ruby/rails
4. rvm get stable
Helps you upgrade to the most stable version
5. rvm list
Lists the different installed rvm rubies
Sample Output -

rvm rubies

ruby-1.9.3-p327 [ i686 ]
ruby-1.9.3-p374 [ i686 ]
ruby-1.9.3-p392 [ i686 ]
=> ruby-2.0.0-p451 [ i686 ]
ruby-2.1.1 [ i686 ]
* ruby-2.1.2 [ i686 ]

# => - current
# =* - current && default
# * - default
6. rvm install 2.1.2
To install a particular ruby version via rvm.

7. rvm gemset use gemset_name

It uses a specific gemset specified by the gemset_name

8. rvm set default ruby

Helps you set up a default ruby version you'd like to use as soon as you open up your terminal

rvm --default use 1.9.3-p374

9. Create the ruby version that your project should default to when you change directory(cd) into it

rvm --create --ruby-version ruby-2.2.2@my_project

Here, my_project stands for the gemset you'd be using for this project.

10. rvm info

It gives you information about your ruby environments.



Sunday, April 6, 2014

Increasing your productivity by using an extended desktop with your primary display

Recently,

As part of an onsite assignment I had the opportunity to be in the UK. Over there I had seen that a lot of my colleagues where using two monitors that were connected to one machine as part of their day to day work.

After trying it for a while myself, I found this kinda setup is very helpful. How? Say for instance your a web developer and you've recently made some change in your application code. One of the monitor screens can help you see the front end changes that you've made on page refresh and simultaneously the other screen can be used to trace your log in case you want to debug something with respect the changes made.

When doing this on a regular basis you'll find that this actually speeds up things as the number of times you need to switch tabs back and forth is comparatively reduced. Many a times people can use one of the screens to perform a specific operation whilst using the other screen to regularly check something else(like your emails for e.g.,).

You can try this kinda setup in two ways atleast as far as i know -
a. Connect your laptop to a monitor and use 'Extended Desktop' Option.

b. Connect two PC's with one another  


To check more details on how can you achieve the same you can have a look at the link -- http://www.makeuseof.com/tag/monitors-extended-desktop-3-check/
or simply google for any link specific to the OS you're using.

Give it a shot and see if you find the difference.. :).