Talking about how you use brackets and white space is always a good way to get people riled up. I had a professor start this debate to get the class going once and everyone got pretty into it.
I don't like that, eitherit's another case of getting confused while skimming. the else being on the same line as the closing bracket makes me think it's just more code in the initial if
But it loses an indentation level so it's clear that the if has ended, then since immediately it is indented obviously it's entered an alternative control flow. It actually makes it easier for me to identify else statements while skimming because if there's only one line that loses indentation then the next line is the else clause, versus if it's another if statement it follows a different form:if(x == y) { // foo}if(x == z) { // bar}
0x90
pet peeve: not putting a space after the "if" before the parenthesisit's not a function -___________-
pet peeve: putting a space after the "if" before the parenthesis.
you guys are weird
if() { //Stuff}
if(){ //Stuff}
braces*****
"i should probably test the API i've been writing"https://github.com/TheBlackParrot/strimmer-nwjshttp://i.imgur.com/EpkQAdI.pngi'm probably not even using nwjs to its full extent but w/e
Im taking a C++ elective at my college because it's required for my degree and this is my last semester. It just took me 40 minutes to make a 7 line program that averages three test scores, I hate this lol.
if (fileExists(filepath)) { GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString("Reading file.")); std::fstream file; file.open(filepath, std::fstream::in); char check; std::string buffer; FString convertString; int32 value; int32 key = 0; while (file.good()) { check = file.get(); if (check == '\n') { convertString = buffer.c_str(); value = FCString::Atoi(*convertString); AdjacencyCache.Add(key, value); buffer = ""; continue; } else if (check == '.') { key++; continue; } else if (check == '\r') continue; else buffer = buffer + check; } }