3 ms·
Maybe I miscommunicated; I'm not against declaring variables at scopes smaller than the function - I declare variables at the top of conditional branches as wel
by alanctgardner2 14y ago
Maybe I miscommunicated; I'm not against declaring variables at scopes smaller than the function - I declare variables at the top of conditional branches as well. I still don't buy the 'twice as many lines' reason for mixing assignment and declaration.
- swift 14y agoYou should be using const variables as much as possible (and in general preferring immutable data). In that case assignment and declaration _must_ take place at the same location.
- lttlrck 14y agothis
- alanctgardner2 14y agoThere's an upvote button to agree with a comment, no need to post a single word. Generally, terse answers aren't really appreciated here (unless they're very good).