I started as a software engineer in 1978, so I’m a bit ‘set in my ways’. That being said, I was very intrigued by the GO language, but quickly found a distaste for the way the compiler forces a restriction on me:
func main() {
}
compiles just fine, but:
func main()
{
}
gives a syntax error. I did some reading on this, and found that the problem is that the compiler has “automatic semicolon insertion”, where the compiler will put in semicolons where it THINKS they need to be.
No problem, I thought. I’ll just end the first line with a line continuation character, and that will make the compiler happy. But wait! There is no line continuation character. Why? Because the language designers insist that it isn’t needed.
I understand that Ken Thompson had much to do with the design of the language, and I would never imply that I know more about language design than he. That being said, I have written a number of parsers for various languages over the years and a line continuation character is very simple to implement.
I do not like to accept the idea that ‘they know better’. I have this problem with cars with automatic transmissions, Windows 11, and now this. Someone please help me to understand why this behavior by the compiler is ‘a good thing’ - with details, not just ‘because’.