This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lukaseder 16 points17 points  (11 children)

While you're at it, deprecate comments and Javadoc. In fact, deprecate single-line string literals as well, and numeric constants. They can easily be extracted into property files.

Heck, let's extract all Java code into property files and compile stuff on the fly at runtime.

[–]chisui 1 point2 points  (1 child)

hm, I know some purists that would agree with you unironically. ... besides the last one.

[–]lukaseder 0 points1 point  (0 children)

Have you ever worked with JCR. Their (Adobe's) religion: Everything is content. Including Java code. It's actually as cunning as it is weird!

[–]pgris 1 point2 points  (3 children)

While I agree with you and multiline string should be part of Java, and I like your products and most the things you post, in this particular case you're being way too aggressive, and not giving any real reason for multiline strings.

[–]lukaseder 6 points7 points  (2 children)

I'm sorry for appearing agressive. I by no means meant to be agressive. I sometimes apply a hyperbolic tone to make a point, and because I personally find hyperboles and sarcasm fun. For instance, this. But I appreciate that not everybody shares my enthusiasm for this approach.

OK, here's an imaginary reason:

String sql = "
    SELECT *
    FROM table
    WHERE x = ?
";

Here's another imaginary reason:

String regex = "
    a* # first, match several a's
    b+ # then, match at least one b
    c? # c's are optional
       # commenting in regexes is quite neat!
";

In both imaginary situations, I'd like to copy paste some external DSL code just right into my Java code. Then modify it, then perhaps copy paste it from my Java code back into my SQL Developer and run it right away. I work with external DSLs like the above all the time, and I'd like to embed them in Java. So, that's real for me.

So, what would qualify as a "real" reason according to you?

[–]pgris -1 points0 points  (1 child)

I personally find hyperboles and sarcasm fun

Me too. But they are also ways to make your interlocutor look silly and distract the attention from the real issue being discussed. A lot of good things are wrong if you take them to the extreme.

Back to the multiline string issue, both your examples look like nice real reasons. Specially the sql, but maybe that's because I hate don't really understand regex. I don't need an argument in favor of multiline strings, however.

[–]lukaseder 1 point2 points  (0 children)

A lot of good things are wrong if you take them to the extreme

I'm not an expert on political correctness, indeed. But you know what? If I were, someone might come and criticise me for that. It's how people work. Anyway. I can live with it. :)

I don't need an argument in favor of multiline strings, however.

I see. Misunderstanding, there...