Enhanced String constructs for Java

Apr 30, 2009 23:39

*OVERVIEW ( Read more... )

humor, java

Leave a comment

Comments 4

kirideth May 1 2009, 08:22:59 UTC
No, no. LOLcode needs to stay in LOLcode, and not in Java.

Still funny, I guess.

Reply


firegoblin May 1 2009, 13:41:50 UTC
See, I thought this was actually going to be useful when I saw the title of your post. But maybe I'm predisposed to hear that, considering that I'm working on some annoyingly silly String stuff right now for work.

Reply

derakon May 1 2009, 17:12:09 UTC
Yeah, there's some pretty big demand for proper multiline string support in Java. I'm surprised it hasn't been added yet.

Reply


sithjawa May 1 2009, 21:26:22 UTC
I see some serious concerns with this syntax. Most concerningly, the HAI...KTHXBAI string expressions are to be used in an entirely different manner than the OMG...DO NOT WANT string expressions, which are not really string expressions at all but a macro for a function call. Furthermore, what happens in the not uncommon situation where one needs to express DO NOT WANT within an exception?

Finally what is the appropriate formatting for code using the HAI...KTHXBAI keyword?

String str = HAI
I HAS A CHEEZBURGER
DO U WANT 1 2???
KTHXBAI;

has some obvious issues. Do the indents become part of the string? TO what level should the KTHXBAI be indented to?

Putting the HAI on a newline helps solve the indentation problem but doesn't answer the question of whether the indents will become part of the string. Undoubtedly style-conscious coders will begin writing

String str = HAI I HAS A CHEEZBURGER\n KTHXBAI ( ... )

Reply


Leave a comment

Up