Hi Ed Lomonaco, thank you for your feedback.
Kotlin is just an example. Most of the statements I post on should also apply to Swift and Scala.
I agree that many languages today still requires semicolons at the end of the statement, else the compiler will fail. In fact, newer languages like Kotlin, Swift, and Scala do allow people to do so as well. However, it is considered a non-preferred style in these languages. I would state C# is somehow evolving from C++ and existed earlier than the existence before the languages I mentioned about. Besides, it tries to be as matchable to C++ as it bears the C name. It is more of the Java language period (newer than it though I agree).
Nonetheless, I do see some newer language also start adopting the “modern language approach”. One good example is C++11 is adopting Type Inferencing. So I won’t be surprised one day the conventional languages as it evolves on will drop semicolon one day. But it’s an uphill battle as the developers are used to it already, just like JavaScript today, where there’s a war among its developer debating if one should or shouldn’t use the semicolon.
The love of { } on the same column is somehow one get acquaintance to it. I understand to change, it is hard as the eye will auto scan for them. However, if you search today on any tutorial languages on function, 90% of the time, the guide is to have the { at the same row as the function name, this is to avoid wasting a line. This is also partly for consistency purpose when we use if-else
e.g.
// The preferred codingif (someBoolean) {
// Do something
} else if (anotherBoolean) {
// Do another thing
} else {
// Do other thing
}// The flow that looks oodif (someBoolean)
{
// Do something
} else if (anotherBoolean)
{
// Do another thing
} else
{
// Do other thing
}// This looks wastfulif (someBoolean)
{
// Do something
}
else if (anotherBoolean)
{
// Do another thing
}
else
{
// Do other thing
}
Agree IDE has been around for a while, but undeniable IDE today is much more powerful and coding friendlier. I don’t remember seeing the auto expand and collapse code feature available 20 years ago in back IDE like Visual Studio.
True, at the end, it’s the team decide. Those are style and not syntax (for some languages).
To me is stick to one rule. Make the code consistent. My preference is to stick to the newer convention if possible, as it’s the newer generation will come in and challenge it. Nonetheless, we’ll go through a phase of transition, and that’s always a tricky bit where we’ll have a mixture at some point.