Ruby Tutorial for beginners

Hi All,

This is to let you know that my good friend, Satish T. has put
together
an excellent site â?? Learning R. here â??
http://sitekreator.com/satishtalim/index.html

This is based on his Ruby study notes made while he studied Ruby
himself,
from various online Ruby resources like tutorials, blogs and Ruby
documentation. A site I would definitely recommend for Ruby newbies.

Thanks
Dibya P.

Neat thanks for the heads up.

One quick question in one of his examples he states that using single
quotes for strings is more efficient, why is this?

I see thanks for the info.

On 10/14/06, Kevin O. [email protected] wrote:

One quick question in one of his examples he states that using single
quotes for strings is more efficient, why is this?

I believe the theory goes that using single quotes means that there is
no
interperlation required, and therefore less work for the interpereter.
Thus
faster.

This was discussed here a few of weeks ago, with some benchmarks that
seemed
to indicate that there
really isn’t much difference between the two.

I’m not sure that the thread ended up reaching a conclusion though.

Hi Dibya,

On 10/14/06, Dibya P. [email protected] wrote:

Hi All,

This is to let you know that my good friend, Satish T. has put together
an excellent site ? Learning R. here ?
- Log In

Great turtorial, It was covered what a newbie need to learn about Ruby.

Thanks for the info, also thanks to Satish for a great Ruby stuff.

Regards,

On 10/14/06, Devin M. [email protected] wrote:

singles make less line noise.
Yes, the reason for single over double quotes isn’t about performance.

Personally, I try (or at least tend) to use single quotes unless I
need something which they don’t give me like interpolation and escaped
characters.


Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

On 10/15/06, Rick DeNatale [email protected] wrote:

On 10/14/06, Devin M. [email protected] wrote:

Personally, I try (or at least tend) to use single quotes unless I
need something which they don’t give me like interpolation and escaped
characters.

Same here…

Thanks

Dibya P.
Blog: http://dibya.wordpress.com

Daniel N wrote:

I’m not sure that the thread ended up reaching a conclusion though.

No, it didn’t. The hypothesis was that the parser has a little easier
time with non-interpolated strings, and the benchmarks didn’t test that.
They had N.times { “blah blah” } when they should have had N.times {
eval ‘“blah blah”’ }.

That said, it’s hardly a reason to go for single quotes. I mean, the
quintessence of premature optimization dude. /That/ said, I think the
singles make less line noise.

Devin

On Oct 14, 2006, at 8:41 PM, Devin M. wrote:

Daniel N wrote:

I’m not sure that the thread ended up reaching a conclusion though.

No, it didn’t. The hypothesis was that the parser has a little
easier time with non-interpolated strings, and the benchmarks
didn’t test that. They had N.times { “blah blah” } when they should
have had N.times { eval ‘“blah blah”’ }.

We did that too:

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/216376

James Edward G. II

On 10/14/06, Firman W. [email protected] wrote:

Great turtorial, It was covered what a newbie need to learn about Ruby.

Thanks for the info, also thanks to Satish for a great Ruby stuff.

Thanks Firman

Dibya P.
Blog: http://dibya.wordpress.com

Regards,

Hal F. wrote:

I find the double quotes more intuitive, but it’s a microscopic
difference and probably has to do with my years of C and BASIC
(notwithstanding the years of Pascal and Fortran).

Seconded. Though recently, my fingers protest against my Java day job
where double-quotes are the only thing I hit Shift for. (I make heavy,
heavy abuse of autocomplete.)

David V.

I am developing a Ruby tutorial as well. I will be covering CGI
integration and database programming too. I will also try ti hit web
caching and cookies for web programmers.

Devin M. wrote:

singles make less line noise.
A common convention is to use single quotes unless there is
a reason to use double quotes. I sometimes follow that, but
frequently forget.

I find the double quotes more intuitive, but it’s a microscopic
difference and probably has to do with my years of C and BASIC
(notwithstanding the years of Pascal and Fortran).

Hal

On Oct 15 2006, 12:06 pm, David V. [email protected] wrote:

Seconded. Though recently, my fingers protest against my Java day job
where double-quotes are the only thing I hit Shift for. (I make heavy,
heavy abuse of autocomplete.)

Seriously? What about common operators like “+”, “*”, “&&”, and “||”?
I don’t see how autocomplete would help with those.