-
-
Save ntd251/f27e86af54d36aacda1065735bb09c0e 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
# Bad | |
my_long_str = 'Hi, here is ' + name + '.\nThis is my multiline description.\nAnd it is still readable.\nRight?' | |
# Less Bad | |
my_long_str = | |
'Hi, here is ' + name + '.\n' + | |
'This is my multiline description.\n' + | |
'And it is still readable.\n' + | |
'Right?' | |
# Somewhat better | |
my_long_str = | |
'Hi, here is ' + name + ".\n" \ | |
"This is my multiline description.\n" \ | |
"And it is still readable.\n" \ | |
"Right?" | |
# Good | |
my_long_str = <<-TEXT | |
Hi, here is #{name}. | |
This is my multiline description. | |
And it is still readable. | |
Right? | |
TEXT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment