Home > Programming > Ruby post-Python: first impressions

Ruby post-Python: first impressions

July 16th, 2010

I’ve been using Python for a while and really like it. I’d heard a lot of good stuff about Ruby so decided to have a go to see what all the fuss was about. The list of differences between Python and Ruby on ruby-lang.org was useful in writing this post. Here are my first impressions:

  • One of the things that always bugged me about Python is its lack of proper lambdas. Sure, you can use a locally defined function instead, but it doesn’t give you the kind of fluency you can achieve programming in Scheme or JavaScript, say. I haven’t done much Ruby yet, but it seems there are various ways to do lambdas/closure, in a more flexible way than Python. This wouldn’t have mattered to me, but since I’ve been working through SICP and using JavaScript more, I’ve been thinking in closures.

  • This doesn’t really set it apart from Python, but it does seem to have good consistent coding conventions, which I think are important for a language. And I like the fact that capitalised class names and lowercase variables are enforced by the language.

  • I used to think it sounded dangerous, but I like the fact that parentheses are optional for function calls. I can see how this can make Ruby a very expressive language.

  • I’ve never understood why in Python objects have a __len__() method, but the standard way is to use the len() function to access it. Why not treat objects like objects and use method calls?

  • One type of array, not lists and tuples. Minor headache resolved!

  • Parsed and unparsed strings like in PHP, making use of the distinction between single and double quotes. Useful.

  • Private methods – thank you!

  • 0 as a truthy value – not sure about this. Although I suppose it’s clearer to say if count > 0 rather than if count.

  • elsif instead of elif. That’s going to cause me a lot of typos.

Categories: Programming Tags: , ,
  1. July 31st, 2010 at 21:45 | #2

    Hi Bastien, thanks. Yes, that does make sense.

  2. July 1st, 2013 at 07:21 | #3

    Hello, all is going well here and ofcourse every one is sharing information, that’s truly good, keep up writing.

  3. July 30th, 2013 at 08:44 | #4

    Fabulous, what a web site it is! This website gives useful facts to us, keep it up.

  4. October 9th, 2013 at 05:53 | #5

    Way cool! Some very valid points! I appreciate you writing this write-up plus the rest of the website is also vey good.

  5. December 10th, 2013 at 07:51 | #6

    Nice post. I learn ѕomething nеw аnԁ challenging оn sites Ӏ stumbleupon on a daily basis. Ιt wioll always bbe exciting to read content frkm othеr writers and practice somеthing from thеir web sites.

  6. April 10th, 2014 at 00:09 | #7

    I was suggested this web site bby way of my cousin. I am now not sure whether this post is written through him as no one else recognize such distinctive about my problem. You’re incredible!

    Thank you!

  7. July 25th, 2014 at 04:40 | #8

    It is a safe product that is widely used in lotions and other cosmetic products to color and hydrate the skin. Remember, it doesn’t matter if a person is religious in the usage of pre-tanning lotions and various types of SPF formulations; the aging of the skin is bound to occur. The salons that are being discussed here are the ones that have the people as well as the products that would make the common man look good. When you receive a spray tan, make sure to wear loose clothing for several hours after application. This is the ingredient that is responsible for turning the skin brown. Because of this sudden increase in demand for fake tan there are now so many different fake tans on the market that it can all be a bit of a blur.

    Self tanning lotion takes about an hour to give the skin a tan but the effect lasts for several days before you would need to reapply. Even though most people won’t have this kind of allergy, it’s definitely worth having the test done before you set foot in a tanning booth. Apply sunless tanners before going to bed and use a normal sun screen product during the day. There are lotions, creams, sprays; pills, air brushing and accelerators just to mention a few.

    Look at my site :: [perfect fake tan application](http://gitacntkembxxknvu.wordpress.com/2014/06/11/news-on-clear-cut-secrets-for-spray-tan/ “perfect fake tan application”)

Comments are closed.