From: Daniel Carrera Date: 2003-11-30T03:48:23+09:00 Subject: Ruby vs Python (IMHO) Hi all, I guess I just want to share a tiny "case study" from a project that I'm doing in Python and which I wish I could do in Ruby instead. I am writing a BibTeX filter for the OpenOffice project (BibTeX is the bibliographic cousin of LaTeX). I am doing it in Python because, of the languages with stable bridges to the OOo component model (UNO) Python is the one I like best. My requirements are mostly related to regular expressions and string methods. This is an area where Ruby really shines and is light-years ahead of the competition. Regular expressions in Ruby are infinitely eaiser and more sensible to use than in Python. Ruby: str =~ /^(#{char})\s*{\s*(#{char}+),(.*)}/ Python: regex = re.compile(r"^(" + char + "+)\s*{\s*(" + char + "+),(.*)}") regex.match(str) Like this, there are many exaples. Quite simply, strings are much easier to manipulate in Ruby. Regexes are superior, there is varible substitution, and the string methods are much better. To make a long story short. If I could do this in Ruby the parser would be easier to write, more understandable, and I would be more confident of its correctness. Cheers, -- Daniel Carrera | Top 100 things you don't want the sysadmin to say... PhD student. | Math Dept. UMD | 19. hey, what does mkfs do?