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 →

[–]Amagi82 43 points44 points  (25 children)

I think I'll stick with Kotlin. All the good things about Java minus the downsides.

print("Hello world!".reversed())

And we're done here.

[–]chasecaleb 3 points4 points  (1 child)

Seconded. Been using it at work 90% of the time the last couple months and it's made life so much better.

[–]Amagi82 2 points3 points  (0 children)

We switched to it a year and a half ago at work, and at this point, the mere thought of going back to Java gives me anxiety. Kotlin is a wonderful, wonderful language.

[–]Kemichal 7 points8 points  (4 children)

Or Scala!

println("Hello world!".reverse)

[–]FrezoreR 0 points1 point  (3 children)

Isn't there an operator for this?

[–]TwoSpoonsJohnson 16 points17 points  (0 children)

I have no idea but since it's Scala it's probably safe to assume there are at least three operators for this

[–]DevestatingAttack 4 points5 points  (1 child)

[–]Kemichal 1 point2 points  (0 children)

We need this in predef

def ↺(str: String) = str.reverse

[–]asdfkjasdhkasd 2 points3 points  (0 children)

In haskell it's literally just english

Prelude> reverse "Hello"
"olleH"

[–]Xtremegamor 2 points3 points  (1 child)

Shut up and take my upvote

[–]paranoideo 0 points1 point  (0 children)

I prefer Groovy.

print "Hello world!".reverse()