Coping with syntax pains

A couple of months ago I had an idea. At the time I thought it was a good one. Still do too. I figured what better time to learn a new language and implement said idea in aforementioned language. Nothing helps you learn more then the practical application of newly learned knowledge. At least it helps me sometimes. Also the idea of using a MVC framework was pretty appealing since I would like to get this idea out relatively fast and have the production be quite agile as well. So I narrowed the choices down to Ruby on Rails, Python’s Django, or use PHP with either Cake or Code Igniter. So in the end I chose Ruby on Rails because it seemed everyone was having a lot of fun with it and I could find a ton of information relatively easily.

Let me first start off by saying Ruby on Rails is very nice. I enjoy it a lot. But I do have a beef with it. Honestly I’m not a fan of the syntax. I understand a lot of people are. Yes I think it has tremendous amounts of niceties. Perhaps it’s the fact that I enjoy good design, code aesthetics, and readability that I find issues with the following. This is the first thing that jumped out at me.

123.to_s

What does it do? I imagine it converts to something since it contains the word “TO” in it. If that is the case, then what is “S”, perhaps a Single, Symbol, Signed Integer, String? Oh a string. That makes sense. Now contrast that with C#

123.ToString()

There is no question about what that method aims to do. You could even be more verbose with it writing Convert.ToString(123). Granted while the example is a simple one it still stresses the same point. With all Ruby’s syntactical sugar aside, when it comes to design and convention, it’s a bit rough. When I started learning programming the main thing I picked up was to be verbose and informative with your naming and designing. And to me a language itself should follow such principles as well. I could go on with more, but I just want to know if I’m all alone in this. Again with all that said, I do like Ruby on Rails and will most likely use it for my project, I just wish it could be better.

What say you dear reader?

Add a new Comment

Your email is never published nor shared. Required fields are marked *

*
*