# Programmers - how would you interpret this comma?

**URL:** <https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307>\
**Category:** In My Humble Opinion\
**Created:** [August 15, 2013, 1:51pm UTC](https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307 "2013-08-15T13:51:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wallenstein](https://avatars.discourse-cdn.com/v4/letter/w/b5a626/32.png) [@Wallenstein](https://boards.straightdope.com/u/Wallenstein)\
**Post date:** [August 15, 2013, 1:51pm UTC](https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307/1 "2013-08-15T13:51:55Z")

</div>

If you had the following customer requirement how would you interpret it for coding purposes?

_The field should display: “Initial Review Date” OR “Planned Review Date”, “Date of Last Review”_

Option 1: (“Initial Review Date” OR “Planned Review Date”) AND “Date of Last Review”

Option 2: “Initial Review Date” OR (“Planned Review Date” AND “Date of Last Review”)

We’ve coded for option 1, the customer wanted option 2.

I can see both sides and it’s a badly written requirement (which was signed-off before I got involved). I’m asking the customer to pay as an enhancement, customer wants it fixed as a defect.

Logically you cannot have a date of last review if you’ve not had an initial review, so a common-sense reading would favour option 2, but my team are arguing that option 1 is a reasonable interpretation too.

So… does Option 1 seem a valid or reasonable interpretation of the requirement?

---

<div class="post-metadata">

**Author:** ![Clothahump](https://avatars.discourse-cdn.com/v4/letter/c/51bf81/32.png) [@Clothahump](https://boards.straightdope.com/u/Clothahump)\
**Post date:** [August 15, 2013, 1:57pm UTC](https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307/2 "2013-08-15T13:57:07Z")

</div>

I read it as being option 2.

---

<div class="post-metadata">

**Author:** ![aNewLeaf](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@aNewLeaf](https://boards.straightdope.com/u/aNewLeaf)\
**Post date:** [August 15, 2013, 1:59pm UTC](https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307/3 "2013-08-15T13:59:12Z")

</div>

I can see how it’s option 1, though I wouldn’t have written it like that.

---

<div class="post-metadata">

**Author:** ![Machine\_Elf](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@Machine\_Elf](https://boards.straightdope.com/u/Machine_Elf)\
**Post date:** [August 15, 2013, 2:02pm UTC](https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307/4 "2013-08-15T14:02:55Z")

</div>

I agree that it’s an ambiguously written requirement. Both interpretations are reasonable, but it’s not a defect if you’ve fulfilled one reasonable interpretation. If the customer signed off on the requirements as written before you began coding, they can’t call it a defect the way you coded it. If they want it changed, they should pay, and they should absorb an important lesson: anyone who writes legally binding specifications/contracts should know to be very careful about writing things such that they are not easily misinterpreted.

---

<div class="post-metadata">

**Author:** ![VunderBob](https://avatars.discourse-cdn.com/v4/letter/v/839c29/32.png) [@VunderBob](https://boards.straightdope.com/u/VunderBob)\
**Post date:** [August 15, 2013, 2:09pm UTC](https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307/5 "2013-08-15T14:09:09Z")

</div>

Option 1.

---

<div class="post-metadata">

**Author:** ![Johnny\_L.A](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/johnny_l.a/32/1084_2.png) [@Johnny\_L.A](https://boards.straightdope.com/u/Johnny_L.A)\
**Post date:** [August 15, 2013, 2:14pm UTC](https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307/6 "2013-08-15T14:14:22Z")

</div>

> [@Wallenstein](#):
>
> _The field should display: “Initial Review Date” OR “Planned Review Date”, “Date of Last Review”_
> 
> Option 1: (“Initial Review Date” OR “Planned Review Date”) AND “Date of Last Review”
> 
> …
> 
> Logically you cannot have a date of last review if you’ve not had an initial review, so a common-sense reading would favour option 2, but my team are arguing that option 1 is a reasonable interpretation too.

Option 1. The customer wants either IRD or PRD, followed by DOLR.

If there is no IRD, then there should be a PRD and DOLR would be blank.

---

<div class="post-metadata">

**Author:** ![Mama\_Zappa](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@Mama\_Zappa](https://boards.straightdope.com/u/Mama_Zappa)\
**Post date:** [August 15, 2013, 2:18pm UTC](https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307/7 "2013-08-15T14:18:48Z")

</div>

> [@Clothahump](#):
>
> I read it as being option 2.

Seconded.

The interpretation “(initial or planned), last review” might make sense if you had a bunch of things ona list and they were all phrased that way, but by itself it doesn’t make entirely sense - why would you need an initial date AND a last review date?

And of course I think of a comma as being like “and”. When figuring out precedence, “and” takes precedence over “or”. So a or b and c should parse out to “a or (b and c)”.

---

<div class="post-metadata">

**Author:** ![Alley\_Dweller](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/alley_dweller/32/430_2.png) [@Alley\_Dweller](https://boards.straightdope.com/u/Alley_Dweller)\
**Post date:** [August 15, 2013, 2:19pm UTC](https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307/8 "2013-08-15T14:19:41Z")

</div>

On first glance, I wondered what the comma could possibly have meant.

If you held a gun to my head and said “Decide NOW!” I would have chosen option 1. But if it had been at all possible to contact the customer or the author of the requirements, I would have asked for clarification.

---

<div class="post-metadata">

**Author:** ![Blaster\_Master](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@Blaster\_Master](https://boards.straightdope.com/u/Blaster_Master)\
**Post date:** [August 15, 2013, 2:33pm UTC](https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307/9 "2013-08-15T14:33:02Z")

</div>

Given just those two options, option two seems to make the most sense to me from how I would interpret it as a programmer. Option one would provide some bad information. There’s basically two different scenarios, so it’s easy to consider.

If we have a item that is already on follow-up review, we’ll see the same information displayed in both cases, the date of the next review followed by the date of the previous one. So that scenario doesn’t matter. However, if we consider the case where we have a new item for review, that’s when the display will be different. In the first option, we’ll be showing the date of the previous review when there is none. For the second option, you wouldn’t show the previous review date since it’s the first one. I go with the second because it would be immediately obvious to the user that there shouldn’t be a previous date if it’s the initial review date. I suppose you could display NULL or N/A or some dummy date instead.

So, really, it just seems like it’s a bit of a design decision on your part on how you want to handle that case of displaying the information for initial reviews. My choice would be the second.

---

<div class="post-metadata">

**Author:** ![sandra\_nz](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@sandra\_nz](https://boards.straightdope.com/u/sandra_nz)\
**Post date:** [August 15, 2013, 2:36pm UTC](https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307/10 "2013-08-15T14:36:09Z")

</div>

It’s ambiguous, but I would have gone for option 2.

Seems a fairly pissy thing to charge the client for - surely someone could have made a quick enquiry before they coded when the ambiguity was first noticed.

---

<div class="post-metadata">

**Author:** ![Greg\_Charles](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@Greg\_Charles](https://boards.straightdope.com/u/Greg_Charles)\
**Post date:** [August 15, 2013, 2:53pm UTC](https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307/11 "2013-08-15T14:53:26Z")

</div>

I would have gone with option 2, unless I had spotted the ambiguity and asked for clarification. I’m always looking for things like that in reqs, but I don’t always find them.

Will it be hard to fix? If it’s just the principle you’re fighting for, I’d just let the customer win this one.

---

<div class="post-metadata">

**Author:** ![Shodan](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@Shodan](https://boards.straightdope.com/u/Shodan)\
**Post date:** [August 15, 2013, 2:57pm UTC](https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307/12 "2013-08-15T14:57:05Z")

</div>

Logically, it’s option 1. However, you should have coded with the RUM instruction.

Regards,  
Shodan

Read User’s Mind.

---

<div class="post-metadata">

**Author:** ![Wallenstein](https://avatars.discourse-cdn.com/v4/letter/w/b5a626/32.png) [@Wallenstein](https://boards.straightdope.com/u/Wallenstein)\
**Post date:** [August 15, 2013, 2:58pm UTC](https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307/13 "2013-08-15T14:58:02Z")

</div>

> [@sandra\_nz](#):
>
> It’s ambiguous, but I would have gone for option 2.
> 
> Seems a fairly pissy thing to charge the client for - surely someone could have made a quick enquiry before they coded when the ambiguity was first noticed.

I agree, but in this particular case there’s a wider context which makes the principle more important than the actual value of the change. 🙂

---

<div class="post-metadata">

**Author:** ![Wallenstein](https://avatars.discourse-cdn.com/v4/letter/w/b5a626/32.png) [@Wallenstein](https://boards.straightdope.com/u/Wallenstein)\
**Post date:** [August 15, 2013, 3:22pm UTC](https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307/14 "2013-08-15T15:22:41Z")

</div>

> [@Blaster\_Master](#):
>
> I suppose you could display NULL or N/A or some dummy date instead.

That’s what we went for - if there’s an initial review date we show a null value against the date of last review to indicate it’s a new item. So doesn’t add any confusion for users, just doesn’t quite match what the customer thought they wanted.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [August 15, 2013, 3:37pm UTC](https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307/15 "2013-08-15T15:37:07Z")

</div>

I would have inclined towards option 2, but I agree that the specification is ambiguous. Of course, the best thing to do with ambiguous specs is to ask for clarification, but the problem with them is that sometimes the person reading them won’t even notice the ambiguity.

---

<div class="post-metadata">

**Author:** ![Wallenstein](https://avatars.discourse-cdn.com/v4/letter/w/b5a626/32.png) [@Wallenstein](https://boards.straightdope.com/u/Wallenstein)\
**Post date:** [August 15, 2013, 3:49pm UTC](https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307/16 "2013-08-15T15:49:47Z")

</div>

> [@Chronos](#):
>
> I would have inclined towards option 2, but I agree that the specification is ambiguous. Of course, the best thing to do with ambiguous specs is to ask for clarification, but the problem with them is that sometimes the person reading them won’t even notice the ambiguity.

Part of the problem was that our developers didn’t see any ambiguity… they saw the requirement, interpreted it as Option 1 and coded what was in front of them, then moved on to the next issue (this was one of several thousand requirements).

It’s only when the business users on each side review the test results that the ambiguity becomes apparent, up to then each side thought they were a model of lucid clarity.

---

<div class="post-metadata">

**Author:** ![Bob\_Blaylock](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bob_blaylock/32/3235_2.png) [@Bob\_Blaylock](https://boards.straightdope.com/u/Bob_Blaylock)\
**Post date:** [August 15, 2013, 3:59pm UTC](https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307/17 "2013-08-15T15:59:29Z")

</div>

> [@Wallenstein](#):
>
> We’ve coded for option 1, the customer wanted option 2.
> 
> I can see both sides and it’s a badly written requirement (which was signed-off before I got involved). I’m asking the customer to pay as an enhancement, customer wants it fixed as a defect.

How big a deal is it to make the change?

My impression is that this is a good time to apply the _“customer is always right”_ principle. You didn’t produce exactly what the customer wanted, and from the customer’s point of view, this is a defect that ought to be corrected at no further expense to them. The specification is indeed ambiguous, and it seems to me that the fault can just as easily be argued to be on your side as on the customer’s side. You might be able to successfully stand on your side, and charge the customer for the “enhancement”, but I think this is a case where the customer rightfully will be much more satisfied if you accept responsibility for the error, and correct it at no charge.

What is more important to you—a satisfied customer, or that small additional fee that you could charge for treating this as an “enhancement” rather than a bug fix?

---

<div class="post-metadata">

**Author:** ![gigi](https://avatars.discourse-cdn.com/v4/letter/g/a587f6/32.png) [@gigi](https://boards.straightdope.com/u/gigi)\
**Post date:** [August 15, 2013, 4:08pm UTC](https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307/18 "2013-08-15T16:08:14Z")

</div>

User here, and just looking at the syntax, option 1 is what I would have meant if I wrote it that way, but I think I would have put

The field should display: [“Initial Review Date” OR “Planned Review Date”], “Date of Last Review”

Looking at the content, option 2 makes more sense. But I would put

The field should display: [“Initial Review Date”] OR [“Planned Review Date”, “Date of Last Review”]

Would this have been sufficient to make it clear? I don’t want our tech guys to have to do any mind-reading! Or would you be tempted to code in the brackets?

Help me…help you! 😉

---

<div class="post-metadata">

**Author:** ![Lanzy](https://avatars.discourse-cdn.com/v4/letter/l/74df32/32.png) [@Lanzy](https://boards.straightdope.com/u/Lanzy)\
**Post date:** [August 15, 2013, 4:09pm UTC](https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307/19 "2013-08-15T16:09:37Z")

</div>

This is what requirements review meetings are for.

---

<div class="post-metadata">

**Author:** ![TroutMan](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/troutman/32/6721_2.png) [@TroutMan](https://boards.straightdope.com/u/TroutMan)\
**Post date:** [August 15, 2013, 4:31pm UTC](https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307/20 "2013-08-15T16:31:32Z")

</div>

I read it as Option 1. I’m used to seeing requirements with comma-separated lists of fields, so I read “display A or B, and then display C”. But reading it in context with other requirements might have influenced how I read it.

[Next page](https://boards.straightdope.com/t/programmers-how-would-you-interpret-this-comma/666307.md?page=2)
