r/programming • u/calahanjim • Feb 26 '16
Please, Java. Do Finally Support Multiline String Literals
http://blog.jooq.org/2015/12/29/please-java-do-finally-support-multiline-strings/1
-1
u/IonTichy Feb 26 '16
Maybe I'm overlooking something, but why exactly does one need multiline string literals?
In my intuition, if you really need to use those then you are most likely doing something wrong.
I see overly long string literals that are hardcoded in the source as highly likely sources of errors and bugs, that's why I tend to avoid those whenever I can.
2
Feb 26 '16
As a C# developer who has multilingual sting literals, I literally use them every day. SQL or some text data or even an email body. There can always be "elegant" ways which often involve making sprocs or making dedicated files but sometimes I just need a quick solution.
1
u/gendulf Feb 26 '16
As a python developer, I mostly use them for verbose regular expressions (which would also be a nice thing to have in Java).
0
Feb 26 '16
[deleted]
3
2
Feb 26 '16
Now now, every language has its pros and cons, no need to be so aggressive.
2
Feb 26 '16
Troll account. You should probably tag it. Dude takes every opportunity to rail on Java and PHP (Not that PHP doesn't deserve it).
2
u/BloodShura Feb 26 '16
Paranoic retard. Go get a life instead of bullshitting in every Java post. This just proves that you actually love Java.
0
Feb 26 '16
[deleted]
1
u/gendulf Feb 26 '16
You know it wont. It's a pathetic worthless language stuck in the 90's which refuses to evolve, and is owned by bureaucrats at urinal corp. Better get over it already and switch to a language that doesn't suck a lot of balls.
0
0
u/BloodShura Feb 26 '16
Do you really think I'll even bother trying to explain a kiddo random from reddit the pros of the MOST USED PROGRAMMING LANGUAGE? Let me guess, your favorite language must be Python or other scripting language that you all lazy coders like because you don't actually need to even plan or design the software. You just start typing your goddamn guessed functions in any file and think your language is "cool" because they let you do whatever shit you want. And then you all get angry at OOP languages because they actually force you to think at least a bit.
0
Feb 26 '16
[deleted]
-1
u/BloodShura Feb 26 '16
Congratz for being an asshole. First, says didn't even bothered to read. And then tries to counter-argument everything I said. But yeah, you only tried: no success. This is no surprise coming from a person like you who can't even use your shitty brain fgs. And fyi: the generics are the way they are for a reason. But yeah, you're dumbass, can't even learn and study things. Keep talking shit in every Java post: it's best for who masters the language, more popularity => more jobs and more money for us! ;) kthxbye
0
Feb 26 '16
[deleted]
1
u/BloodShura Feb 26 '16
Why don't YOU come back when you GROW UP your mentality instead of being such an irritating kid? Keep flaming Java, while Java keeps getting success more and more ;)
3
0
Feb 26 '16
[deleted]
1
u/BloodShura Feb 26 '16
Ohhhh, look Muttley we have a hardcore, hipster wannabe-programmer here. Now I understand why you hate Java ;)
2
u/tdammers Feb 26 '16
I'd say that requiring multiline string constants is a weak solution, and if only Java were more suitable for writing convenient EDSLs or injecting into the AST at compile time (like, for example, Haskell's TemplateHaskell, or even just Lisp macros), pretty much all of the use cases for long string literals would go away. For SQL queries, we'd use a safer DSL to construct them, or we'd just pull in long strings from external sources at compile time.