ss Is Much Better Than script/server

I was somewhat shocked when someone asked me how come I type “ss” instead of “script/server” to start the server. He also asked me how come it doesn’t work on his computer. It dawned on me that a good percentage of Rails developers are from Windows and never worked on Unix.

For those switchers to Mac, here’s what you do. Simply add aliases in /etc/profile and restart the terminal. Below is what my profile looks like. For those Unix geeks out there about to flame me for not having other aliases or why rm includes “-rf”, just go away, it’s my preference.

# System-wide .profile for sh(1)

PATH=”/usr/local/bin:usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/mysql/bin”
export PATH

# System
alias ll=’ls -alh’
alias df=’df -h’
alias rm=’rm -rf’
alias ping=’ping -c4′

# TextMate as editor
alias e=’mate’

# Subversion
alias sup=’svn update’
alias scom=’svn commit’

# Ruby on Rails
alias ss=’script/server’
alias sgen=’script/generate’

if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi

Developing on Windows

vmware_ubuntu.pngI wanted to see what it would be like to develop RoR using Windows. After many hours of trying to recreate the experience of my MacBook Pro, I came up with a solution that really works. My solution? VMWare!!!

That’s right, I’m using VMWare to run Ubuntu.

The way I see it, it’s the only way. Developing on Windows is just too much pain. Out of all the editors I tried, UltraEdit came out as a clear winner, but I can’t use any editor other than TextMate. I’ve tried Instant Rails, but it’s not my cup of tea.

Ruby Thought Process

10726789.gifOne of my favorite computer book of all time is “Object-Oriented Thought Process” by Matt Weisfeld. This book, in its first edition, helped this old C programmer overcome bad habits and truly reap all the benefits of object oriented programming. It’s really true that you have to change the way you think, not just learn a new syntax.

As I make my transition to Ruby, I still find myself thinking in C (when I refer to C, I’m referring to C, C++, Java, and C#). It’s just like learning a new language. You think of what to say in one language, a native language, and then translate in your head. I can vaguely remember (it’s been so long) when I came to US, I thought of what to say in Korean, translate into English, and then say it. That’s why you see so many foreigners saying things that just do not make any sense in context. However, it makes a perfect sense when translated to their own native language.

I’ve always been a native C programmer even when I programmed in VB. Now that I think about it, all my complaints about VB are due to the fact that I was still programming in C and VB was a translation. It’s very clear that in order to be proficient at Ruby, I need to change my thought process. Just as I became a native English speaker (didn’t take long when you’re that young), I need to become a native speaker of Ruby.

Things I Miss From .NET Development

After years of developing on Microsoft’s tools, I’m finding it hard to change my old habits. I’ve gotten too comfortable with Visual Studio and I must admit, there are things I miss. Here’s a short list:

  1. Intellisense!!! I didn’t realize how convenient Intellisense is. I rarely had to look for a documentation, even the ones that I wrote.
  2. Debugging. It’s so easy to debug with VS, I actually feel guilty.
  3. F5. Instant gratification, sort of.

I know there are IDE’s such as IntelliJ that just came out with Ruby support, but it just doesn’t feel the same. Now that I think about it, I had troubles adjusting to VS from a text editor I rather not mention here. I’m sure in time I’ll get comfortable with TextMate.

./script/../config/boot.rb:29:Warning: require_gem is obsolete. Use gem instead.

Now that I upgraded Rails to 1.2.1, I get this annoying message every time I run script/generate. This message is nothing to worry about since it’s harmless. However, if you’re annoyed with the message like me, then there’s a quick fix to it.

In order to remedy this, go to boot.rb and replace “require_gem” with just “gem”. There should be two incidents of this. Just make sure you don’t touch anything like RUBY_GEM_VERSION.

———————

# Update: New version of Rails, 1.2.2 has fixed the problem. As long as you’re using the latest Rails, this issue no longer pops up.
———————

« Previous Page