4 ms·
“Why is a comment "Increments i by one" for i++ not ok, while a function "incrementIByOne" is supposed to be good style?” It isn’t, but nextOrderNumber could b
by Someone 6y ago
“Why is a comment "Increments i by one" for i++ not ok, while a function "incrementIByOne" is supposed to be good style?”
It isn’t, but nextOrderNumber could be, especially if it is used in multiple places. That function could easily evolve into _doing_ “increment i by one, atomically”, “generate a random UUID”, “get a new unique ID from the database”, etc.