-
-
Save ahoward/2636753 to your computer and use it in GitHub Desktop.
did i mention style is everything?
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
# | |
# perl got some things right. here-docs were one of them. YAML takes this | |
# further when we have to define large data structures. | |
# | |
# if you find yourself typing " ' ) ( [ ] too many times in a row, whack | |
# yourself on the wee-wee with a keyboard and whip out the YAML | |
# | |
this_fucking_licks_hairy_balls_to_edit = | |
[{"name"=>"Ara T. Howard", "email"=>"[email protected]"}, | |
{"name"=>"Ryan Cook", "email"=>"[email protected]"}, | |
{"name"=>"Garett Shulman", "email"=>"[email protected]"}] | |
and_this_does_not = | |
YAML.parse ' | |
- | |
name : Ara T. Howard | |
email : [email protected] | |
- | |
name : Ryan Cook | |
email : [email protected] | |
- | |
name : Garett Shulman | |
email : [email protected] | |
' |
I tend to separate the delimiters even more, but that's probably just because TextMate's native indentation support isn't as robust as I wish it were.
I also tend to add a trailing comma after all hash or array entries, even the last one (Some of my coworkers took to calling it "the Livingston-Gray comma"). I like to reorder large hashes to group related keys together, and it sucks to wait 10 seconds for Rails to load and then get hit with a syntax error because I moved the last item up and forgot to add the comma. ;>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
moving the code lines separate from the delims is nice for editing....