Re: Does Ruby simplify our tasks and lives?


#1

Simplicity [mailto:removed_email_address@domain.invalid] wrote last Tuesday, April
04, 2006 3:24 PM:

#I suppose anyone can make something complex or messy, no
#matter what the language or tool. Agree?

yes, but why care/think about that (and worst, aim for it??) ?

programmers solve (people’s) problems. it is not easy solving problems.
Ergo, the humble programmer must find ways that will make his life
happy… On my case, I found ruby, and it has lesser “abstraction
impedance”, and it has made me happy. Agree?

kind regards -botp


#2

I’m not sure people purposely aim for complexity, it is something that
many people, in my experience, just do naturally. Don’t know why.
Maybe, it’s an attempt to create something better than it needs to be,
but resulting in something more complex than necessary.

I agree. We all want to get home early, enjoy the family, and have a
life. Work smarter, not longer. Choosing the right tools for the job
is a smart thing.

Barry
http://www.simplicityfirst.org


#3

I think this may be more of a unix question than a Ruby question…

If I create a test script:
echo “echo hello world” > test_script

On “source” this from the unix command line:
. ./test_script

…and I get the expected result.

I can also run it from the unix command line:
chmod 755 ./test_script
./test_script

…again, I get the expected result.

However, if I now dive in to irb and try to run the script…
irb(main):001:0> ./test_script

It comes back with:
(irb):1: command not found: ./test_script

However, if I ammend test_script by adding a sh’bang line at the start,
so that it now reads…
#!/bin/sh
echo hello world

And run it from irb, it will “do the right thing”. :slight_smile: I’m just wondering
why?!?!?!

Thankyou for any elucidation,
Benjohn B.


#4

It’s because your shell is made to read shell scripts. Ruby needs to
know what to use if it’s a different syntax than ruby.