3 ms·
Yes, it is important in syntax. You're still entering the same information twice (this time in two different ways, rather than two different places), which all
by thedufer 15y ago
Yes, it is important in syntax. You're still entering the same information twice (this time in two different ways, rather than two different places), which allows the possibility that the two conflict (the main problem that DRY prevents), resulting in something bad.
- fennecfoxen 15y agoSome people would say that when a compiler blows up telling you "ur doin it rong", that's a good thing. This is surely why there's so much type information floating around a programming language like Java. (Of course, Java is a little extreme. It's obnoxious to be forced to catch/declare-that-I-throw 50 different exceptions when I do any file I/O, and doesn't bring much to my typical use case. I don't use Java much. :)
- artsrc 15y agoThese should all be compiler errors because the indentation and the delimiters don't match. if (expression) statement; statement; statement; or: if (expression) statement; if (expression) statement; else statement; or if (expression); { statement; statement; } So curly brace languages should have a defined formatting standard and anything else should be a syntax error.