views:

267

answers:

9

Ok, this may seem like a silly question, but it is seriously bugging me. Hoping some fellow programmer has a good word for it!

Thing is, I am making an ExpressionBuilder class to help me build up expressions to use with LinqToSQL. And my problem is about how word myself when describing what two methods. And it kind of is a problem in general for me too when talking about it. Here is the issue:

You have an Expression<Func<T, bool>>, A. Later you get another one, B. You are now going to combine that B with A using && / AndAlso or || / OrElse. So for example like this:

A = A && B;

Alright. So, what did you just do there? What is the verb for what you did with B to A? If you think in a series of this stuff, like A = A && B && C && D && E && ..., you could sort of say that you then "add" F to that series. But that wouldn't really be correct either I feel...

What I feed would be most "correct" would be that you take B and you "and" it to/with A. You take B and you "or" it to/with A. But can "and" and "or" be used as a verb?? Is that considered ok? Feels like incredibly bad English... but maybe it is ok in a programming environment? Or?

A: 

Compound?

Naming is always one of the hardest things.

IainMH
yeees. it almost makes me go insane sometimes!
Svish
A: 

If you are adding (e.g. numbers, or items to a set/list) then I'd say "Add"

If you are concatenating (e.g. strings) then I'd say "Append"

Alternatively... if you are just "adding" another item to a list... "Push" works too

scunliffe
but those cases are not an issue, cause you actually have the verbs Add, Append and Push that you can use ;)
Svish
my apologies I guess I wasn't clear on the question. :-(
scunliffe
+2  A: 

I think it is perfectly ok to use "and" as a verb in this case. You and'd A and B. It just seems bad due to the words AND and OR themselves. If you talk about it with XOR though, it doesn't sound so bad to say you XOR'd something yet you're effectively saying the same thing.

Robin Day
+9  A: 

In logic AND is the conjunction operator, so you are conjoining A and B. OR is disjoining.

RossFabricant
what about OR ?
Svish
disjuntion operator?
ZeD
disjoining maybe?
Svish
Disjunction is where two sets contain no elements in common, so only exclusive OR (XOR) would lead to a disjunction. Regular OR is a union operation.
Rob
doesn't say anything about that here http://en.wikipedia.org/wiki/Logical_disjunction ? Or did I miss something?
Svish
Sounds like something that you hope doesn't happen to your twins.
Even Mien
@Rob Wikipedia says OR is inclusive disjunction and XOR is exclusive disjunction. Union and intersection are OR and AND for sets. Since he's not operating on sets, I don't think it's quite right to use those names.
RossFabricant
+10  A: 
  • If I was speaking to a mathematician, I would probably use terms like "perform a logical conjunction" (or disjunction).
  • If I was speaking to a fellow programmer, I would use "and" and "or" as verbs directly.
  • If I was speaking with my mom, I would probably just find pen and paper and start drawing Venn diagrams.
Tormod Fjeldskår
A: 

Does the output of A feed into the input of B?

If so I'd use 'chain', or 'compose' in the sense of functional composition

Otherwise, if they're independant functions which are being combined, then maybe 'cat' as shorthand for concatenate.

Mark Pim
A: 

In general, this is composition of functions. Since these functions are all predicates, you're putting them together with the various logical operations, so the specific composition would be conjunction, disjunction, etc. All the basic set theory terms I forgot since college!

John Saunders
A: 

How about logically connect?

-- http://en.wikipedia.org/wiki/Logical_connective

Remou
A: 

I'd go with Set Notation (Venn Diagrams) when explaining it.

  • AND: A intersected with B
  • OR: A unioned with B

http://www.purplemath.com/modules/venndiag2.htm

Even Mien