“When a professional software developer asks you whether they should try out a tool that is free or has a trial period the answer should always be “YES!””- Winston Zeddemore, Ghostbuster (paraphrased)
On Reddit yesterday someone posted a question in the Ruby forum who wanted to know what some of the advantages of using a specific tool were. In this case they were asking about the RubyMine IDE. Several people chimed in that they use it (great, not answering the question though) so I chimed in that I use it in conjunction with my Vim development environment because of it’s powerful refactoring, formatting, and code-insight tools that can’t really be replicated in Vim. Given the nature of Reddit what ensued was a gentile and mature debate with another developer over whether we should only ever need to use command-line tools (which totally didn’t devolve into me generating Zoidberg memes or me finally asking the question “Y U DO SO MUCH WORK?”
I use RubyMine alongside Vim (my day to day editor). Being able to use some of their advanced refactoring, formatting and code-insight tools can be incredibly handy despite me having a fairly complete Ruby/Rails development configuration for Vim. Nobody should only use one tool but should apply the best tools they can for a job.
Naturally, a complete replacement for the RubyMine IDE is a simple `find | xargs` command. Pffft!
find app -type f -name *.rb -print0 | xargs -L1 sed -i '' -e "s/old_method/new_method/" in conjunction with Git was supposed to be superior to using the “rename” refactoring functionality in RubyMine.
Wouldn’t run on my OS X Mavericks
find app -type f -name *.rb -print0 | xargs -L1 sed -i '' -e "s/old_method/new_method/"
This worked, also added global to the pattern
find app -type f -name "*.rb" | xargs -L1 sed -i '' -e "s/old_method/new_method/g"
Seriously, piping to xargs? Also, the find tool sucks for this kind of search and replace because EVERY FILE GETS OVERWRITTEN. Git sees that each file has been updated and they all get their permissions and descriptors f’ed up.
grep -Rl def app/**/*.rb -Z | xargs -L1 sed -i '' 's/old_method/new_method/g'
All of this ignores the simple fact of trying to rename a method named “find” is impossible using this technique. Unless you want to go and troll the the 1,000,000 files that have been modified because of the vague search pattern. Seriously, saying that you won’t use RubyMine because it’s a corporate tool or whatever is ridiculous. It has context-aware code refactoring tools. Use them, it’s like $75 bucks or free if you do F/OSS. Seriously.
Why not Zoidberg?
Oh, and edited just for this….
If you can’t tell I was getting a little annoyed at this point.
Trying to shoot down a focused and powerful tool like RubyMine by saying
find | xargs is a perfectly fine replacement for it’s refactoring tools isn’t going to win any points with me. But the core of their argument has some merit. Why bring in industrial equipment to hammer a nail? If you have a nail then the hammer is what you should go for. But we’re professionals, when’s the last time you saw a roofer using only a hammer to sheet a roof. Since the invention of the pneumatic hammer, probably never.
I actually rarely use RubyMine, it’s definitely not my editor of choice. I use Vim and a suite of plugins that do most everything I need on a day to day basis. RubyMine though suffers the same problem as Emacs for me though. They’re both mighty fine tools it’s just too bad they have such crap text editor capabilities though. ;D But if someone wants to try using Emacs or RubyMine or whatever then fine, great. Give them a whirl and see for yourself. Maybe still suggest that they can use a command line tool to get some specific capabilities — but never tell them they shouldn’t discover for themselves.
To me RubyMine is a Swiss Army knife of a tool. I probably wouldn’t use it to spread peanut butter on my sandwich but if I ever needed a corkscrew when I’m out in the middle of the forest I’ll sure be glad that I have it handy.
But when I hear someone say they can use “only simple tools” to get an adequate approximation of a sophisticated and professional tool then all I can think of is…