Sunday, December 7, 2014

Indent two spaces per tab in Sublime Text 3

Indenting two spaces per tab is useful when programming in languages like Ruby. I was able to search for an easy way to do this in Sublime Text 2 but it took me sometime to figure out how to get this right for Sublime Text 3.

Here's how we can set this as a default for a user in Sublime Text 3

Step 1 : Sublime Text -> Preferences -> Settings - User. (Please read the PS below if you're a linux user)



Step 2 : Within the existing set of flower brackets("{}") that are specific to the user we need to add customized settings to override the default settings that one would find in Preferences -> Settings - Default. We need to add the below settings to use two space indentation -



Below is an example of how the user settings file would look like after you override the default settings with the above changes.



 Step 3: Save the changes and you should be good to go. 


P.S: Surprisingly, I found the Preferences section for the debian package(I had it installed on Ubuntu 14.04) of Sublime Text 3 at a different location than where it is when one sets up the same through Mac OSx.



Sunday, November 23, 2014

Refactoring code along the lines of the DRY principle by leveraging the power of Ruby blocks and lambdas

In my early days as a ruby programmer, I used to always look for good examples through which I could understand Blocks and lambdas in Ruby. I did understand them after some research but I guess the connectivity of a real life e.g., was somewhere missing to help me remember how can one use them always. That's how I relate to this post and here's an attempt to help drive home the concept of Ruby lambdas and blocks for beginners at least to some extent. This has been tried and tested on Ruby-1.9.3p484

Here we'll try to explore how one could leverage the power of Blocks and Lambdas to make your code look more clean by refactoring one's code along the lines of better adhering to the Don't Repeat Yourself(DRY) principle.

Below is the original code of a singly linked list before any refactoring is done -


Refactoring 1 - 

Problem Context - Methods list_count(returns the number of linked list elements)  and list_elements(list the linked list elements) basically traverse through the entire linked list including the last node and both have a duplicated linked list traversal condition @current_pointer != nil .

To do - Remove the above duplication

Solution - Blocks to the Rescue! 

Adding blocks - If you have a look at the list_elements and the list_count methods they have duplicated for the lines 35-39(excepting line 37) and 45-49(excepting line 48). This doesn't adhere to the DRY principle and hence requires further refactoring. 

Below is a screen shot of what gets changed. You can have a look at this commit which shows the full modified version of the code as part of the first refactoring.


End Result - Lesser lines of code.

Refactoring 2 -

Problem Context - If you observe carefully, you'd find the other traverse_list method has the linked list traversal condition @current_pointer,next_node != nil and they are used to add a new node to the linked list at the end through the add_in_end method and the same is used in the get_tail method to get the last node. With the above condition, the current pointer stops at the last node but on the other hand with the condition @current_pointer != nil used by the list_count and list_elements method use the current pointer goes past the last node to satisfy the specific method requirement. The question now is, can we still remove any further duplication? The answer is yes.

Solution - Introducing Lambdas because we can't use past multiple blocks to methods in Ruby 1.9 . Read this link for more info.

Below is a screen shot of what gets changed. You can have a look at this commit which shows the full modified version of the code as part of this refactoring.


End Result - More concise solution adhering to the DRY principle.

Credits to the Pickaxe book by Dave Thomas for the learnings and to Avinasha for recommending this book.

P.S: This code has scope for further refactoring. I have just taken two sample use cases in an attempt to try and explain Blocks and Lambdas in Ruby.

Saturday, November 22, 2014

Think simple and Look within as a way to solve problems

There are so many times in life that we think we look outside for the solution of certain challenges we come across or certain things that we may encounter in day to day life. Looking outside helps, but not always.

Solution of many problems is within. Recently, I came across two experiences that makes me echo this thought and which make realize how much I got to improve on this way of doing things as well.

Experience 1 -

Problem/Concern - I always found it difficult to keep track of so many tweets from the different folks I follow on twitter on a day to day basis, I was wondering how to get around this.

What I used to do -
1) To some extent after some amount of exploration, I figured out the way of doing this is using the 'lists' feature in Twitter. That helped to some extent.
2) Not satisfied, I still was experiencing the problem so I used to keep thinking 'outside' for a better way of doing this.

A better solution - Although I don't have a complete solution yet, but the below point has helped me tackle this problem better at least to some extent.
1) Often one might be tempted to follow new folks on twitter, it's also equally important to regularly 'unfollow' those tweeple whom you think aren't adding that much value. I know this might be 'common sense' as one would call it, but it's just the way I at least thought of it initially was - may be I need to use some external service(some third party website) or similar stuff on those lines to manage my tweets better. 

Moral - The solution was within Twitter itself. Think Simple :). Think Within..

Experience 2 -

Problem/Concern -  To set a context, I'm a web developer who uses Ruby on Rails, a framework that's used to make websites. I find it sometimes difficult to keep a track the development log in the terminal for any new action I perform as a end user through the web interface of the application whenever there is a background process running within the application which may be for instance is constantly polling something for real time updates that would eventually be displayed on the UI(User Interface) .

What I used to do -
1) So I use an editor called Sublime Text for day to day development. Their search functionality is pretty powerful, so I used to go into the development log and find may through the log to find the things executed as part of the most recent action executed on my part from the UI.
2) I used to do a 'rake log:clear' to clear the log often so that my search can retrieve faster results.
3) Sometimes, in the past I used to even comment out that piece of code that runs a command which triggers the functionality to regularly check for updates. I was doing this in the local box so  I took this approach. I do realize now, it's not the ideal way of doing things especially when you have automated tests in place which might probably link your background process related functionality with what you'd be newly implementing.

A better solution -
1) Simply do a 'Ctrl + C' to stop tailing the dev log soon after you've executed your action from the UI and you'll have the most recent set of actions to explore from the terminal itself. This prevents you from digging out the solution from elsewhere. Isn't that a faster way of doing things? I didn't think of it at least.

Moral - Don't look for something outside(looking into the editor) which involves more effort(searching, cleaning up) when things can be simply achieved within the same terminal itself.

Overall Moral - Think Simple. The solution is within, not without :). 

Credits for the better solutions go to suggestions by Avinasha Shastry.

P.S:- Pardon me for the technical jargon if you don't understand much from this feel free to give me a shout or use google to help you understand the problem 2 better. I've made an attempt to make problem 2 to be understandable by any lay man.

Also, I'd be really happy to hear from folks who have been able to find a better solution to Problem 1, if any better solution exists.

Cheers.



Tuesday, October 14, 2014

Ten Questions you'd want to consider asking when interviewed for a Ruby on Rails position

Taking a decision to move on from your current company or may be even joining a new company in itself as a fresher out of college is not a small decision. A lots of lives can be impacted directly/indirectly by the decision you'd take on which company you'd want to join. Everybody would want to make this as right as they possibly could. Below are just some pointers that I learnt from experience about the questions one should ideally ask before embarking on a journey of exploring newer pastures. Hope asking these questions would help you better decide which company would be most suitable for you going forward. Please be noted this list is not exhaustive and has no direct/indirect bearing on any company in particular whatsoever.

1. What is the version of Ruby and Rails currently being used in the project? If it is an old one, do they plan to upgrade sometime in the near future or this isn't currently on their road map?
2. What is the development environment like?. This question can prove to be quite important to ask because some enterprise companies don't use dev environments like Linux/Mac directly i.e., in other words for instance they might use a Virtual Machine or connect to a remote box(like connect to a linux box via putty) for various security related reasons which they might have.
3. One more question that I've learnt from experience that might be worth asking is does company allow access to blogs, social networking sites(like Twitter, Facebook etc.,) and video sharing sites like Youtube. Access to these sites can really prove handy as part of your day to day development when one is looking for some help through tutorials, guidance etc.,
4. Do you have download access? This is something that'll prove pretty handy whenever as a hacker you'd want to experiment with new stuff(and thereby install the related tools, packages etc.,) and whose true value you'd want to demonstrate through a proof of concept to any stake holder of the company for which you'd be working. Sometimes getting download access to install gems in big companies can also be a challenge in itself especially if they don't have any other teams within the company who are already working on projects that use Rails.
5. Can you please tell me more about the project and how much of it is rails based? Certain projects use rails but may be not completely, the core part of some projects might be some other framework or language. It's important to know how integral is rails as a part of the project as this can give you a direct or indirect idea to what extent does Rails actually bring value to the table which thereby can even give you a hint of how important could be your role or contribution to this project on an ongoing basis.
6. Do you do Test Drive Development or basically is your code driven by automated test cases. Do you use Continuous Integration(CI) tools like Jenkins etc.,
7. What source code management system do you use as part of day to day development(Git, SVN etc.,).
8. What software development models(agile, waterfall etc.,) do use for the projects? Go a step further sometimes, if they say agile for instance ask explicitly for what software development methods(like SCRUM, Extreme Programming etc.,) in Agile do they use for their day to day projects.
9. a. Are the working hours flexible?. Sometimes as a developer what you'd want most is the flexibility to work when you think you'd be most productive. Of course, in addition to this there might be a couple of times when you'd have to run some personal errands for which you'd not be able to login to office during normal working hours.
b. Is there a work from home option?(This can matter a lot if you'd really want to save the time you'd otherwise lose in traveling to office and your way back). Don't be hesitant to ask this as many startups already provide this option as they value your time. You can check if this can be provided on a periodical basis(from time to time) if not on a continuous basis.
10. What are my roles and responsibilities as part of this project and team? What would be the expectations from me once I join the team?

These are ten main questions I can think of that really mattered at least to me based on my experience of being interviewed thus far for a Ruby on Rails opening, I'm sure there are a lot of other questions that can be added on, but I hope answers to these questions help you better decide on where to join next.


P.S: Please feel free to add additional questions as comments to the blog post if you think asking these questions would prove really handy.

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.. :).

Tuesday, February 18, 2014

Enumerables in Ruby

Using Enumerables in Ruby - Source for the tutorial is Ruby Programming Language
by Yukihiro Matsumoto(creator of Ruby) and David Flanagan.

The blog below has a sample code with output. The sample code below with inline comments in a way summarizes the concept(refer blog title) covered as part of the book.



Loops in Ruby

Using Loops in Ruby - Source for the tutorial is Ruby Programming Language by Yukihiro Matsumoto(creator of Ruby) and David Flanagan.

The blog below has a sample code with output. The sample code below with inline comments in a way summarizes the concept(refer blog title) covered as part of the book.



Iterators in ruby

Using Iterators in Ruby - Source for the tutorial is Ruby Programming Language by Yukihiro Matsumoto(creator of Ruby) and David Flanagan.

The blog below has a sample code with output. The sample code below with inline comments in a way summarizes the concept(refer blog title) covered as part of the book.



Conditionals in Ruby

Using Conditionals in Ruby - Part 1 - Source for the tutorial is Ruby Programming Language by Yukihiro Matsumoto(creator of Ruby) and David Flanagan.

The blog below has a sample code with output. The sample code below with inline comments in a way summarizes the concept(refer blog title) covered as part of the book.



Operators in Ruby - Part 2

Using Operators in Ruby - Part 2 - Source for the tutorial is Ruby Programming Language
by Yukihiro Matsumoto(creator of Ruby) and David Flanagan.

The blog below has a sample code with output. The sample code below with inline comments in a way summarizes the concept(refer blog title) covered as part of the book.



Operators in Ruby - Part 1

Using Operators in Ruby - Part 1 - Source for the tutorial is Ruby Programming Language by Yukihiro Matsumoto(creator of Ruby) and David Flanagan.

The blog below has a sample code with output. The sample code below with inline comments in a way summarizes the concept(refer blog title) covered as part of the book.



User input in Ruby

This is a sample program which takes user input and prints the same in Ruby



Arrays in Ruby

Using Arrays in Ruby - Source for the tutorial is Ruby Programming Language
by Yukihiro Matsumoto(creator of Ruby) and David Flanagan.

The blog below has a sample code with output. The sample code below with inline comments in a way summarizes the concept(refer blog title) covered as part of the book.



Playing with Numbers in Ruby

Using Numbers in Ruby - Source for the tutorial is Ruby Programming Language
by Yukihiro Matsumoto(creator of Ruby) and David Flanagan.

The blog below has a sample code with output. The sample code below with inline comments in a way summarizes the concept(refer blog title) covered as part of the book.



Helloworld in Ruby

Hello world program in Ruby



Using Hashes in Ruby

Using Hashes in Ruby - Source for the tutorial is Ruby Programming Language
by Yukihiro Matsumoto(creator of Ruby) and David Flanagan.

The blog below has a sample code with output. The sample code below with inline comments in a way summarizes the concept(refer blog title) covered as part of the book.



Saturday, February 8, 2014

One plus One is eleven - Individual Ubuntu dev boxes vs Single Redhat dev server for a team of developers

Hi,

Below are certain points(based on my experience till date) on the basis which I've tried to put forth my two cents on the pros and cons of having an individual development setup(for each developer)(using Ubuntu) v/s using a single development box(in this case it is Red Hat Enterprise Linux OS on which each developer would have individual user account through which they would go about day to day development - this is a sample case study with no direct/indirect reference to any individual/organization) for a team of multiple developers who would be working on a Ruby on Rails application.

Also, I would like to clarify why this comparison is done is because we are assuming a hypothetical scenario where the production app server is deployed on RedHat OS and the debate is about having the right development server in place for day to day development - keeping in mind the specific goal on how can one achieve more(be more productive and kinda spend not more time than what's ideally reqd for day to day development) with less(for e.g., simply by being smart when one has to be and finding the shortest path - reminds me of Dijkstra's algorithm ;) )

An attempt to list down the differences one by one follows below -



SE NO
Point of discussion
Ubuntu
Non Ubuntu - RedHat
1
Development setup
Individual for each developer
Common for all developers(one server, multiple user accounts)
2
Internet required for development
No
Yes(because we connect via putty installed on Windows to dev server).
From Home – via some VPN
From Office – Office intranet
3
Chances of intermittent connection loss to dev server when moving laptop from one place to another say to attend meetings etc.,
No concept of connection being effected as internet not used for day to day development(Your development box is your local box – Cheers J )
0 – 15 %(approx.)
Impact – Need to again reconnect to the server and open multiple putty sessions again(this mean logging into each individual session multiple times).
1.       For starting the server
2.       For tracing the log
3.       Opening the rails console
4.       (optional) for accessing the mysql console
4
Need to commit to see if your code changes work properly on the application
No
Yes and No.
Yes in the case where -1. You are working from your local desktop
 2. You’re using an editor like Sublime Text
 3. Committing those changes via something like Tortoise SVN(an interface to ease you SVN committing process)
4. Doing an update from the server side to fetch latest code and only then checking if your changes work properly or not.
This approach is not recommended because the general rule of thumb to committing code is that you make changes, test them.. If all things work fine only then go about committing the same.

No in the case where
1 Directly code via putty
2. Don’t have an editor
3. Overhead of not having the editor –
a. copying the code is a challenge if same/similar functionality has to be used in different files within the same application
b. Copying the code from one place to other spoils the alignment and the entire copied code needs to be realigned(as a result development becomes more time consuming).

It's kinda everyone's wish to get the best of both world's isn't it :). There's a way through Samba by which you can actually map your local boxes network drive to point to one of the remote servers(provided you have access to the same) and you can specifically point it to the codebase on which you're currently working. Through this service your changes made using the editor which basically opens the code on the remote server will automatically reflect in the remote server. Sound's good isn't it :). Well yeah, I've heard sometimes people use Samba as means to deep dive into their application logs(for debugging etc.,). Hmm, but having this for day to day development would be an icing on the cake, isn't it :). The prerequisite for it to be allowed for day to day development might be that you need to have support for Samba(not sure about it in detail just sharing knowledge based on what I know or have come across till date).Things can actually get more challenging as mentioned above if you don't have Samba support.
This seems to take care of this point, but what about others... read on before you reach to any conclusion ;).

5
Do we have an independent platform where a developer is empowered to showcase Proof of Concepts(POC’s)?
Yes
No(because we are all using a shared server – we need to be very cautious when we experiment with things).
6
Will your application break if you develop in Ubuntu and deploy(for prod) on Redhat
It depends(can’t be taken for granted it will or it won’t). A best way to answer this is to see if equivalent packages/plugins that are used as part of the application are available for Ubuntu and Windows. Bottom line, if this breaks for one application it can’t be taken for granted it will break on all applications. Root cause analysis needs to be done to go into exact details and decisions need to be made based on the same.
7
Freedom of a developer to have his/her playground to demonstrate his potential
Can do more. Every user will have his/her own root access to install additional softwares which can be used for the benefit of the company. Sometimes when you want to install app specific packages also, it’s easier to do it without any approval process in the loop(provided you are confident of what you are DOING)

It’s more of show me the code first before you talk.(taken from the saying – “talk is cheap, show me the code” – mentioned by Linus Trovalds the creator of the Linux Kernel)
Can do very less – needs to take approval for every single installation as this server is used by multiple people. What happens in the bargain ? – More time consuming for a developer to show his/her potential. Every developer will not have the root credentials only sys admin will have it(in some cases it’s the linux support team).
8
Cost
Free – Open Source. Can development be cheaper J ?
Huge cost involved for every developer to have the individual Red Hat development Setup.
9
Support
Independent. Not required, as it’s an individual desktop. If one breaks only a developer is impacted not the entire team. To fix any issues we have Ubuntu forums like – AskUbuntu, UbuntuForum, Ubuntu Mailing List, IRC
Dependent on Linux support teams within the corporate organization(if such a team exists) or on the Red Hat support staff from whom we’ve originally bought the OS.
10
Security
Shouldn’t be a concern as we will be using Ubuntu VM’s on Windows platforms. There should already be company firewalls protecting our internal systems through firewalls etc., IMHO.
Already taken care in a way by the support from Red Hat, Linux support team within the company(if exists) + support from firewalls setup with respect to the company network.
11
Single Point of Failure
No. One machine goes down. Use the VDI and clone the setup. We can keep a master copy of the setup and distribute it among all team members. Any changes to the application should be reflected in one of the master setups(which nobody plays around with). Thereby if  one developer ends breaking things, he doesn’t have to do much to get back the latest setup reqd for the application to be up and running. Only he will have to rework his local changes(say wrt the POC’s which will be in WIP)
Yes. One machines goes berserk, several developers are impacted(that’s why nobody wants to take risks and sometimes you lose out in the competition just because we don’t take calculated risks to speed up things).


These are my own personal views and I'm open to any pointers in case I'm missing something with respect to the differences mentioned above or if you'd like to add more differences the ones already mentioned above.

I'd be happy to pass on the mantle to all readers who would like to discuss more on this topic through comments on this post. It's your playground from here, take it away :) .

Net-Net - I think the differences talk for themselves and IMHO one should be in a position to independently take a call on what works best for them as some things could vary on a case to case basis.

Cheers :)

P.S:- One plus + One equals eleven is a pun that I've used for two individual entities being combined together to give you a single result.. One of the entities is Windows and I leave it to you to figure out what the other entity stands for .. :);)


Debugging your Rails apps - how I go about it generally

Hi,

To debug your Rails apps the following cmds are what I generally use.

a. Rails.logger.info . They are many variants to using this based on different scenarios. One of them is -
1. To just get a better hang of the flow of how the call passes goes from one place to another-

Rails.logger.info " Your Message goes here"

An easy way of finding the same in your log could be

Case 1

Rails.logger.info "\n*********\n Your message goes here\n********\n"

2. To get the flow and also to see the values used/passed anywhere in the method(s) called as part of your action which triggered the functionality

Say if 

Case 2

a = "hi"
Rails.logger.info "\n*********\n Your message goes here - #{a}\n********\n"

The above statement will print your message with the value of a.

3. Another very useful thing that I use from time to time is making use of the 'inspect' option. With experience I can definitely say it's very helpful when you for e.g., want to see what all are passed as part of a click of a submit button, the entire list of params that are passed(with the exact format like for e.g., say your passing a hash with multiple key value pairs) or basically the object values can be clearly seen and printed via the Rails Logger.

Sample e.g.,

Case 3

Rails.logger.info "\n*********\n Your message goes here - #{a.inspect}\n********\n"

Hope you find them useful. In case you have better suggestions on can one better debug, please feel free to share your suggestions as comments to this post.

You can read more about how to better debug your Rails apps from the Rails Guides (I've taken a reference from Rails 2.3 guides just as an e.g.,).

Thank you.