5 ms·
I've been writing quite a bit of Kotlin, lack of semicolon isn't a great idea in my opinion. The problem is that while Java is newline-agnostic (newline is jus
by lokedhs 9y ago
I've been writing quite a bit of Kotlin, lack of semicolon isn't a great idea in my opinion.
The problem is that while Java is newline-agnostic (newline is just another whitespace), Kotlin has some rather difficult rules to determine the what a newline does.
Granted, the rules are not quite as insane as those of Javascript, but I find it very unsatisfying newlines are sometimes significant, and sometimes not.
And just to make it clear where I'm coming from on this topic, my preferred language is Common Lisp, so I really prefer consistent syntax.
- andybak 9y agoYep. Consistency beats "syntactic noise". In fact lack of consistency is noise. If semicolons are always present, then my brain filters them out. If they are never present then great (yay! Python) However - occasionally present or absent semicolons means I have to think about each situation - at least to a small degree.
- morj239 9y agoThe only place when you really need semicolons Kotlin are the enum constants, everything else can be considered "strictly no semicolons", so pretty consistent.
- edem 9y agoI write Kotlin for more than a year and semicolon usage is pretty consistent: no semicolons. The only place I remember using them is in enum constants. I also came from the lisp world (CL -> Clojure).