pull down to refresh
Maybe this is where my inexperience as a real developer starts to show.
My thought process was: If there was an edge case I didn't think about, I'd rather the app just proceed on, with a slightly messed up carousel order, than for it to error out. Happy to be corrected as to what k00b and ek think the standards should be in this case.
undefined
because it is always set on every possible code path, then you shouldn't put a default but instead do error handling (and logging!) when encounteringundefined
. Assigning a default value on a case that should not exist is a problem because if for any reason (in the future) it does exist, it shouldn't just gracefully apply your assumption. Assigning a default value is what leads to hidden tech debt in this case, because it will mask future errors.