I like how Kotlin removes the need for semicolons....
# announcements
t
I like how Kotlin removes the need for semicolons. There is absolutely little-to-no point in having semicolons in coding languages these days. When I used to code in C# (and later in Java) I never understood the point of having to press the semicolon with my pinkie finger after each statement. Who else agrees with this?
s
The designers of Kotlin 😁
👆 1
😁 5
s
how do you separate multiple statements in one line?
s
@stephanmg Take a guess; 😁
😄 1
😆 2
s
@streetsofboston I know 🙂 that’s what I wanted to point out
j
It is used as a "delimiter" when parsing the line telling the compiler that is the last character in the line.
The compiler for c, c++, presumably c#, ignore whitespace, so the only way the compiler knows you are finished with the line is the semi colon. you "can" write code with multiple statements (aka lines) in one line (e.g. for(int i;<10;i++){ printf("%d ",i);printf("\n");} ), the compiler only looks for semicolons, not end of lines. Trouble is its kind of hard for people to follow.
a
Also the “;” terminator for statements helped to produce useful error messages- the compiler could “reset” at that point, as opposed to thinking it was still inside parentheses etc