Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

This is a really basic question: Say this is a question:

A painted line is increased by length $x$

Can $x$ be a negative number? just by the wording of the question. What would be a better way of rephrasing the question to make it clear that $x$ can be negative.

(The reason I'm asking is that I'm programming and a method name needs to indicate that the parameter can be negative or positive, in order to decrease or increase a size)

Basically I'm looking for a generic term for decrease and increase.

share|improve this question
    
Can't you just say "x may be negative" in a comment? –  Qiaochu Yuan Feb 4 '11 at 21:12
    
I have but it would be better for it to be part of the method name, which is currently increaseLengthBy: –  Jonathan. Feb 4 '11 at 21:18
4  
@Jonathan: Well, if want to allow x to be either positive or negative (or 0), why not say "The length of a painted line changes by x"? Then the method could be changeLengthBy. The generic term is "change". –  Arturo Magidin Feb 4 '11 at 21:37
1  
Or, "adjusted" so that the method could be adjustLenthBy. One of the guidelines in Microsoft's opus Code Complete is to use strong verbs in function names. Actually I like the use of negative arguments with increaseLengthBy. I should think it would make perfect sense to any mathematician who programs. –  hardmath Feb 5 '11 at 2:58
    
@hardmath, could you put that as an answer? –  Jonathan. Feb 9 '11 at 18:43

2 Answers 2

up vote 2 down vote accepted

As a "neutral" verb regarding increase or decrease, I propose "adjust" so that the method would be adjustLengthBy. This is concise but conforms to the MS Code Complete dictum to use strong verbs in function names.

share|improve this answer

I'd say that "A painted line is changed by length $x$." The use of 'increased' implies the change is positive and it sends a confusing mixed message.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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