Created
March 5, 2013 18:40
-
-
Save jonleighton/5092937 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This style of code is a complete abomination and you should never do it! | |
my_var = if whatever? | |
thing | |
else | |
other_thing | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I dislike it as well. We had a discussion over this in vim-ruby, and in the end, decided against changing the current behaviour with the hanging indent (so no, @mhfs, it's currently not possible to change this). My personal preference used to be @carlosantoniodasilva's, but I've noticed that this way the assignment clause tends to become difficult to notice. These days I just repeat the LHS.
One interesting solution @tpope came up with is this:
This works out of the box in vim-ruby. Recently, I've started to reconsider this style myself. It's also a reasonable way to do this: