From: 7stud 7stud Date: 2007-03-10T12:23:04+09:00 Subject: Re: A couple of questions from a Ruby neophyte Chad Perrin wrote: > In the quartet of commonly cited web > scripting languages (Perl, PHP, Python, and Ruby), PHP's regular > expression handling is by far the worst. It's kludgy, inconsistent, and > unwieldy. I try to avoid it. I don't like Python's much either, but > it's a darn sight better than PHP's. > It seems like regular expressions are slightly different from language to language, but not so much so that it is much of a problem. Although, if you are used to using advanced features like negative look behinds, and they aren't available in the language you are coding in, I guess that would be frustrating. What deficiencies are there in Python's regex support? > I think I've been spoiled by working primarily with Perl regexen. PHP's > regex handling is actually better than that of probably 90% of languages > that have regexen at all. I just think you need to be in about the 98th > percentile before you get to the languages that actually have *good* > regex support, and Ruby is definitely in that category. > > >> >> >So, would anyone be able to help me work out if Ruby is the language I >> >need? >> I guess the thing to do would be to find a simple task you need to do, >> and actually try it out, and see how it feels - and check back here if >> you need help. That's how I got hooked :-) > > That's a pretty good take on it. > > The languages I'd suggest, off the top of my head, for the tasks > mentioned here include: > > Perl > Python > Ruby > > Each has its benefits and detriments, of course. I personally am not a > fan of Python, but it's still a great language in (most of) the ways > that matter. Ruby's my favorite, by a long shot, for OOP. Perl may > provide the most comfortable syntax for people who like a unixlike > environment (including me). All three of them handle the needs outlined > in the original post of this thread admirably. I've been looking at Ruby and Python this week, and I am drawn more to Python. I went through the "Ruby in 20 minutes tutorial" at the Ruby website here: http://www.ruby-lang.org/en/ and the syntax is not that appealing to me. I also started reading the book "Dive into Python", which targets experienced programmers moving to Python, and which is also available for free download at the author's web site: http://www.diveintopython.org/ It's given a 5 star rating in the python book reviews here(click on the book names for the full reviews): http://www.awaretek.com/book.html How great is that?! A free 5 star rated programming book? It has a unique format: the author starts each section with a few lines of some indecipherable code, and then spends the rest of the section introducing the concepts and language features that make the code crystal clear by the end. The first two chapters are definitely worth reading, and they introduce Python's data structures: arrays(called "lists"), dictionaries("associative arrays, i.e. arrays with non numeric index values), and tuples(immutable arrays). The poster might be interested in a quick look at a "python in 10 minutes tutorial": http://www.poromenos.org/tutorials/python Anyway, I was wondering if you could give some further insights into why you prefer Ruby and don't like Python? -- Posted via http://www.ruby-forum.com/.