Use of tab characters in indentation-sensitive code
I have found on a number of occasions that the use of tab characters in indentation-sensitive code is a cause of compilation errors, on occasions where I have opened the file with an editor which ap0plies a convention other than 8 spaces for a tab. I fear that sooner or later, one of these errors is going to manifest as a logic error. I would suggest that, where code uses the indentation-scope feature of Haskell, it would reduce the possibility for errors of all tabs were replaced with a corresponding number of spaces. I think that compilers should issue a warning when indentation that determines the scope of a construct is found to contain tab characters. #g ------------ Graham Klyne For email: http://www.ninebynine.org/#Contact
Graham Klyne writes:
I think that compilers should issue a warning when indentation that determines the scope of a construct is found to contain tab characters.
I second that. In the same spirit, the compiler should issue a warning when <tab> is used in literal strings, rather than \t, because some editors _do_ mess up the formatting and thus change the program! IMHO, <tab> is a character you'd really want to avoid using in source code at all, but obviously, there are others who think otherwise. ;-) Peter
participants (2)
-
Graham Klyne -
Peter Simons