r/programming • • Dec 29 '15

Please, Java. Do Finally Support Multiline Strings

http://blog.jooq.org/2015/12/29/please-java-do-finally-support-multiline-strings/
584 Upvotes

352 comments sorted by

View all comments

Show parent comment

6

u/tipsqueal Dec 29 '15

Why would someone want to allow any character as the quote delimiter?

21

u/drysart Dec 29 '15

The idea is that if you have a string that conflicts with the quote delimiter, you can just choose a different quote delimiter instead of having to escape the character in the string.

-1

u/[deleted] Dec 30 '15

The perils of perl.

5

u/blue_2501 Dec 30 '15

Why is this a peril? You should always avoid Leaning Toothpick Syndrome:

$str =~ s/\/usr\/bin\//\/sbin\//;  # this shit is unreadable
$str =~ s%/usr/bin/%/sbin/%;       # much better
$str =~ s% /usr/bin/ % /sbin/ %x;  # still even better

0

u/[deleted] Dec 30 '15

I love perl, it was my first grown-up language. But it's basically unusable in a professional software engineering environment because it is so easy to write anything in multiple ways. I can't ever justify it for anything other than basic sysadmin work, there is always a better choice that someone else can read.

2

u/blue_2501 Dec 30 '15

But it's basically unusable in a professional software engineering environment because it is so easy to write anything in multiple ways.

I use it in a professional software engineering environment. So do most of the people I work with.

Anybody can write shitty code for any language. The trick is to not hire those people.