0

For instance:

Every time the user logs in, increment the login variable.

vs

Every time the user logs in, increment the login variable by 1.

Which is more correct? My gut tells me the first example is correct, and in the case of a number other than one, one should use "increase" instead of "increment".

  • In mathematics and computer programming, yes. – Hot Licks Mar 3 '15 at 14:50
  • Hi henrebotha: Welcome to English Language & Usage Stack Exchange! Have you consulted a dictionary? If your question can simply be answered by consulting a basic reference resource, it should not be posted here. If you have trouble researching the question, or still have questions after you do so, please edit your question or create a new one if this one is later closed. (I recommemd closing as off-topic, general reference.) – Jim Reynolds Mar 3 '15 at 15:04
  • 1
    Every year they give me an increment in my salary. I hope it is more than one dollar! – GEdgar Mar 3 '15 at 15:29
  • Somewhat surprisingly, the full (subscription-only) OED doesn't even list increment as a verb at all. – FumbleFingers Mar 3 '15 at 15:49
  • @GEdgar - Had better watch out -- it might just be a penny! – Hot Licks Mar 3 '15 at 18:21
1

In non-computerese it doesn't need to refer to a single unit, though often it does.

Etymonline says it comes from

mid-15c., "act or process of increasing," from Latin incrementum "growth, increase; an addition," from stem of increscere "to grow in or upon" (see increase).

We often refer to something increasing by a small amount as "increasing only incrementally" to stem the notion that the increase was great or significant. But the increase doesn't have to be a single unit, and most often it is not. Sometimes a single unit doesn't even make much sense, as when a probability increases, or something increases by a percentage.

In programming, however, when you increment a variable it implies 1 unless there is a specific other amount. (Cf. the "increment" operator in C-syntax languages. The ++ always means +=1 and the decrement operator (--) always means -=1.) When might there be such another amount? When you need to quantize values so that, say, a 3 or a 6 must round up or down to produce always a "five" block. This is by far the exception, however. Absent any other information, you should assume you must increment by 1. Note also that when there is a specific other value to be incremented, that amount will, or should be, explicit: e.g., "increment by 5."

  • 2
    To this, I will add that even when increment does specifically imply 1, saying increment by one is still exactly as correct as saying increment. It is merely redundant. Redundancy is not incorrect. It is merely redundant. I have just shortened the question title by 50% percent without changing the meaning. That does not mean that the original title was "less correct". It is not a rule of English, or any language, that every word that can be left out, must be left out. – RegDwigнt Mar 3 '15 at 14:43
  • @RegDwigнt: In my opinion, there's certainly a difference between acceptable redundancy and unacceptable redundancy. For instance, "continue on" is unacceptable to me. So while I agree that "increment by one" is redundant, the question is whether or not that redundancy is acceptable. – henrebotha Mar 3 '15 at 15:06
  • 1
    @henrebotha: "increment by one" is certainly an acceptable redundancy. It might seem over-careful, but sometimes it pays to be sure you are understood precisely. – Robusto Mar 3 '15 at 15:11
  • @henrebotha "unacceptable to me" does not mean "incorrect", though. These are two entirely different things. Just because you happen to not like apples, does not mean apples are wrong. The question you asked originally was not "which alternative do I, henrebotha, like more", but "which alternative is more correct". To the former, we'd have no answer anyway. We can't know what you personally deem acceptable and why. "Continue on" is impeccable English, and COCA has 1061 cites for it (vs. only 253 for "cold beer" and 11 for "orange car"). And if you think about it, "go on" is no less redundant. – RegDwigнt Mar 3 '15 at 16:41
  • @RegDwigнt: One can "go back", or "go elsewhere", but to "continue" is to keep going in the direction one was going. – henrebotha Mar 4 '15 at 7:10
0

In most programming contexts, "increment", unqualified, means "increment by one". A larger increment is still an increment, so "increment by five" is equally correct.

in Visual BASIC, for example:

FOR X= 1 TO 10

the increment is implied, and it is one.

FOR X = 1 TO 10 STEP 1

ok to explicitly describe the increment value, too

FOR x = 1 TO 10 STEP 2

  • Fair enough, but I'm talking about using natural language in a programming context, not using a programming language. – henrebotha Mar 3 '15 at 15:07
  • ... and a smaller step is also still an increment ... FOR X FROM 0.0 TO 1.0 BY 0.01 – GEdgar Mar 3 '15 at 18:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.