https://kotlinlang.org logo
#codingconventions
Title
# codingconventions
k

Klitos Kyriacou

01/09/2023, 11:36 AM
What's the most conventional indenting scheme with multiline strings? I've seen these: 1:
Copy code
val statement = connection.prepareStatement(
    """
    UPDATE tablename
    SET column1 = ?
    WHERE column2 = ?
    """.trimIndent()
)
2:
Copy code
val statement = connection.prepareStatement("""
        UPDATE tablename
        SET column1 = ?
        WHERE column2 = ?
    """.trimIndent()
)
and various others.
1️⃣ 11
m

Mustafa Ozhan

01/09/2023, 12:44 PM
I think the first one, since detekt/klint doesn’t give warning for that
9 Views