Sublime Forum

Indentation delimiting for Ruby inside Sublime

#1

I like the syntax of Ruby a lot better than Python’s, especially the object orientation is a lot more intuitive and cleaner. The only thing Python has that Ruby does not is indentation delimiting, adding this to Ruby would make Ruby’s syntax even more psuedocode-like. The one advantage to Ruby’s end keyword is that you can use a auto-indentation script (like perltidy) where as in Python if the indentation gets messed up you have to go through and read the code to find where indentation has gone wrong. I think its possible to get the best of both worlds in Ruby by having an editor that hides the end keyword so that the syntax looks like its indentation delimited, but you can toggle back to having the end keywords show up when you need them. And the file would always be saved with the end keywords in the file. Something similar is already implemented in some editors that have a search-and-replace script that replaces a keyword such as the lambda keyword in Lisp with the lambda symbol that you see in math books. Function folding is also very similar in that it hides code, which can be toggled open/closed with a plus symbol that the use can click on.

0 Likes