I like to dig in and learn the details of any programming language that I’m working with.
Here are some of my thoughts from my first read through of some of the Programming Ruby book. You can read the first edition of Programming Ruby The Pragmatic Programmers Guide online at RubyCentral.com..
Things I like about Ruby:
- No explicit self. I really liked the Python language, but there were two things that got to me, the explicit self, and the __.
- Overall, syntax seems very clean.
- Builtin string expression interpolation using the #{name} syntax.
- Good regular expression support.
- Code blocks, closures and the yield statement.
- printf
- mixin support through modules
- here document support
- operators as methods you can override
- parallel assignment
- good class library
- built in threading support (Ruby threads)
- simple interop with C code
Things I’m not so sure of yet:
- Coming from the statically typed world of C++/C#, a dynamically typed language takes a bit of getting used to. I am familiar with the concepts from using Python, but it’s something that I’m still not completely used to.
- There are probably a whole lot of semicolons that I’m going to be deleting from the end of each line of my code.
- $, @, @@ used to indicate the type of variable. The development teams I’ve worked on have standardized on a variable naming convention, for example a leading underscore to denote member variables. In Ruby, it looks like this decision was made once for the language, which is good — I’ll just have to get used to the symbols used.
- rescue instead of catch & ensure instead of finally is going to take some getting used to, with catch and throw meaning something a little different.
It’s a pretty short list of things I’m not sure of, and most of them are just observations on how things are different that what I’m used to. I’m looking forward to working more with Ruby, and I’ll come back to this list at the end of this blog post series.
Post a Comment