I’d rather not revisit the tabs v spaces v curlies war. It’s an example of how people have a tendency to go to war over trivial things. To me it’s a bit like arguing XML is broken because it uses angle brackets instead of square brackets, which are obviously better because you don’t have to press shift for square brackets. What was the W3C thinking?
Well that example is a little off. Tabs verse Curlies is a scenario-specific thing imo.
Tabs work well here because its tightly packed and ordered.
Curlies don’t work well here because the space the user uses doesn’t need to be maleable, for example using enter to create constructors that stay on the page rather than scrolling.
There is no reason to start a debate.
I rather use square or curly brackets over <> any day, thats why I made a cute little html editor to do so.
Haha. Yeah. Thats a procedural approach. When I was coding in Lua for Roblox, I’d eventually find myself having these long lists of ifs and closures. Although, the way I work now is more “if not this occasion, break/return like it would” which quickly fixed that massive amount of text going on. It stays in line.
public static final int returnsStuff() {
int result;
if(1 + 1 == 3)
return -1;
result = 5;
if(new Integer(2+2).hashCode() == 4)
return -1;
result++;
// etc..
return result;
}
Versus
public static final int returnsStuff() {
int result;
if(1 + 1 == 2) {
result = 5;
if(2 + 2 == 4) {
result++;
// etc..
}
}
return result;
}
(forgive my laziness of not doing this in notepad++ or anything)
They are two VERY different concepts and they both have their purpose. If you don’t need the scope, don’t retain it.
Oh and BTW I got hit up on for saying procedural a lot.
This is procedural programming
I can knock out a TreeML schema in 5 minutes, which is QUITE a lot faster than XSD or RelaxNG or DTD
I updated the Gist with a hacky early version of support for curly-structured files. In the interests of being arbitrarily strict, the curly character must be the last non-whitespace character on a line in order to be evaluated.