What Is A Good Beginner Book To Learn Ruby?

Solistra

Veteran
Veteran
Joined
Aug 15, 2012
Messages
593
Reaction score
247
Primarily Uses
I don't doubt they're used in a lot of places where strings would do the job just as well, though with strings being mutable in Ruby, I don't know how much of a performance edge one has over the other.
There are other String methods that could do the job more efficiently than a regular expression does a lot of the time. The performance difference is probably minimal, really, but it still seems unnecessary and a bit on the arrogant side ("look what I can do!") to use regular expressions when a method such as starts_with? would perform the same function with a little less overhead and a substantial amount more readability. It depends on what they're being used for, basically.

Oh, and while the history is interesting, you happened to mention it to someone who already knows a little bit about it. (You didn't mention grep, by the way, which is interesting....)
 

Mouser

Veteran
Veteran
Joined
Aug 19, 2012
Messages
1,245
Reaction score
264
First Language
English
Primarily Uses
Well, maybe some of the young 'uns in here haven't had the fun of programming in Unix IV on a Vax :)

Playing Hack before it became Nethack...

In truth, I mentioned the history because it does explain some of why Ruby does things the way it does, which affects us as scripter/coders. Once things start to "make sense", they can become easier to learn and to use (at least in my experience). That's probably my biggest hurdle learning the language. When I get that licked, the rest should be cake ;)
 

Solistra

Veteran
Veteran
Joined
Aug 15, 2012
Messages
593
Reaction score
247
Primarily Uses
Well, I wasn't there for the history, but my father is something of a computer historian -- he still has a fully functioning Altair 8800, along with innumerable older IBM machines (including a server rack that takes up half of his garage... literally).

I do own a complete copy of the UNIX System V Release 3 reference, though. I read through sections of it from time to time -- including the sections on ed, sed, awk....

Really, though, in my opinion, "mastering" regular expressions isn't something that I would invest too much time into for working with RGSSx. Ruby isn't Perl, like you said, even though there's quite a bit of overlap in terms of how versatile the string handling is by both. I just look up what I need to know when I need to know it for the most part, and having done that, I've learned enough of the basics to be able to do what I need to with regular expressions in Ruby -- but I still rarely use them at all.

But that's just my opinion, of course, and I'm not really much of a "scripter." Again, I just do what I need to do and move on for the most part. (Which also means that I'd appreciate it if anyone could correct me if I'm wrong about the performance of regular expressions versus Ruby String methods written in C, since I'm not completely certain about that.) If you're looking into regular expressions for other things as well, then... that's another story entirely and you'd probably benefit greatly from a good book on them.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top