-1

This question could be viewed as an ELL question. However, I am posting it here as I am looking for a two-fold confirmation: semantic/grammatical and programming language usage for purposes of confirming to skeptical French participants in the FLI forum what I have already said.

Python code snippet from Ben Stephenson's Python Manual

I was informed in the French forum that: "It's not clear to me whether the keep is very meaningful in English in such a context or just structural, but that's off topic. Consider continuer à boucler might create an ambiguity or some weirdness in this context that keep looping wouldn't introduce. This is no general context here, like keep applying pressure to the wound when someone is already doing so, surely you can see that. The 1:1 won't cut it imho"

So, my question really is in English: Semantically (but not in the form used in an instruction), doesn't Keep looping while in English mean: Continue looping while? And would just using the idea of looping work? Isn't "keep" in "keep looping" meaningful? The text cited above is from an online Python course manual.

I was also informed by one poster that in English, when translating Keep verb+ing into French that: "maybe in English, you can say to someone who is thirsty, keep drinking until you are no longer thirsty but in French, we'd say until you are no longer thirsty, but not continue to drink until..." ["Peut être qu'en anglais on peut dire à quelqu'un qui à soif keep drinking until you are no longer thirsty mais en français on dira bois jusqu'à ce que tu n'aie plus soif, pas continue à boire jusqu'à..."]

I find that rather gobsmacking. The basic idea of keep + verb+ing is simply continue to [do something]. Now, obviously, the thirst idea is really quite odd as a way to "prove" what is said in another language. However, let's play along. If someone is told me to drink water (a medical professional, for example), "Drink water until [whatever].", that is not the same thing as "Keep drinking until [whatever]".

It's rather hilarious in information theory terms that the imperative form in computer programming really means the programmer (sender) is sending a message to a language function that a machine (the recipient) will execute.

The code snippet from Python exhibits typical a instruction statement structure AKA imperative programming. Yep, instructions are written using the imperative form of verbs. Is "Loop while the user enters a non-zero number", the same as "Keep looping while the user enters a non-zero number"? If not (which I assume is correct), please state formal reasons why this is so. I assume some answers will mention iterations (repetitions) of an instruction until some "state" is reached.

3
  • 2
    I'm struggling to see what the point of this question is, but "while" when referring to time has two related but distinct meanings: it can mean either at some point within a period of time (1a) or for the entire period of time, i.e. as long as (1b). Which meaning applies depends on the context.
    – Stuart F
    Oct 18, 2021 at 19:28
  • @StuartF It is a called a WHILE loop.
    – Lambie
    Oct 18, 2021 at 19:52
  • Comments are not for extended discussion; this conversation has been moved to chat. Oct 21, 2021 at 8:21

3 Answers 3

1

For me, "keep looping while" in an English (not programming) usage implies that one is completing an action that one should continue to complete as long as another (at this point unspecified) thing is occurring. Keep juggling the balls while the the lights are still on. It just feels a little too open and unclear. How long and I going to do this? Are the lights going to go off?

I think programmatically while "while" may be used, in English the sense may be more of "until". Keep juggling the balls until the lights go off. Aha! A definite future event is going to happen and we are just waiting for that change of state. We can mentally track that.

"While" is like we are just killing time. "Until", to me and especially in this context, is more like we are waiting for a specific event to happen. I would write comment as "#Keep looping until user enters a non zero number." I couldn't begin to discuss the subtleties of translating that vague sense into French.

2
  • There's a thing called a While loop in Python. But, your first para confirms what I think, too.
    – Lambie
    Oct 18, 2021 at 19:06
  • Note, switching to "until" would reverse the logic, and it would be "Keep looping until the user enters zero." Oct 18, 2021 at 19:14
1

Disclaimer: My French is not good enough to verify the veracity of their claim that a simple verb carries the implication of continued action... so let's assume that it's true. It remains to recognize: Are you writing instructions in French or English? If your French Connection is to be trusted, then you should simply say Boucle, but that's no reason not to use "keep __ing" in English.

Yes, in English, "keep [X]ing" carries a different meaning than the imperative [X]. Consider: "Go"/"keep going," "look"/"keep looking." The context of talking about a loop is particularly important, since it is by definition an ongoing operation, and the question of exactly when to stop is an important one. MikeY's answer points out that a change in language can reverse the meaning ("Keep looping while X is true," vs until it is false). Since your comment is in English (rather than Python), there's nothing wrong with "keep looping" to express repeated iteration.

Disclaimer: My Python is worse than my French, but there may be other troubles. I find, like mikeY, that the only odd bit of the sentence is "while." It hints at parallel action rather than causative ("keep looping while the user whistles a tune"). You could take the suggestion of "Keep looping until the user enters 0," or, if you want to preserve the positive rather than negative syntax, perhaps "Keep looping as long as the user enters a non-zero number."

5
  • Thank you very much! Repeated iteration it is. :) The problem is that bouclez [imperative], it is not Continuer à boucler.
    – Lambie
    Oct 18, 2021 at 19:55
  • I guess my point is: When writing pseudocode in English, follow English convention, in French follow French. But if writing in English for a Francophone audience, I guess you could consider potential language barriers and reword. Perhaps "Iterate as long as [X]," since "iterate" carries in itself the implication of repetition. Oct 18, 2021 at 20:35
  • Generally, one doesn't translate into English for a non-English speaking audience....
    – Lambie
    Oct 18, 2021 at 21:02
  • @Lambie Wait, now I'm very confused. Are you asking about how you should write French comments? Oct 18, 2021 at 21:21
  • Not at all. My question was about the English and the fact that French speakers were remarking on it. Telling me that in "Keep + verb+ing" , the keep is maybe not meaningful....Please reread my question. Thanks.
    – Lambie
    Oct 18, 2021 at 21:26
1

This answer addresses only the English part as I don't know much French.

The communicative issue that "keep" addresses in conversational English is repetition. In your Python example, this is so obvious by having the code as part of the context that "keep" doesn't add much to the statement. But consider the following:

  • Read the menu while I park the car.
  • Keep reading the menu while I park the car.

After the menu has been read once, does the driver intend for it to be read again and again until the car is parked?

In the first case, no. The driver only intends the menu to be read once.

But in the second case, the driver asks the listener to continue the menu-reading process even after it has been fully read. Perhaps it's a stakeout, and going through the motions of reading the menu is an important signal.

So "keep" has a role in shaping the how a statement is understood.

Now, let's return to your Python comment. The reason "keep" doesn't seem to add information is that the two actions of looping and entering a number can't be separated. Unlike the menu example, it's not possible to go around the loop only once while multiple numbers are entered. So entering multiple numbers entails multiple loop traversals.

If I may venture a little deeper - the reason "Keep looping while the user enters a non-zero number" sounds a little off may be due to the second half of the sentence. Entering a number is part of the loop, so the loop cannot continue (and certainly not for multiple iterations) while the user is in the process of entering "a" (single) number. The English can be improved by tying "keep" to the conditional - either "Keep looping while the number entered is non-zero" or "Keep looping until the number entered is zero".

Having said that, there are some situations where the term keep can be superfluous, such as where the instruction is to do something that doesn't have a definite end. For example, if someone is told to "stay here while I park the car", it would be frustrating if the person tried to say they followed the instruction by leaving after staying for awhile. Here, "Keep staying ..." would act as an intensifier without changing the overall intent of the instruction.

3
  • stay is not an action verb. looping is. The bare verb form is an imperative in English and in programming, the program "talks" to the machine using that form, right? As in "Read the first value from the user". The text is taken from a Python manual. I agree with you: [...]act as an intensifier without changing the overall intent of the instruction.
    – Lambie
    Apr 3, 2022 at 16:35
  • @Lambie Yes, "stay" has a more passive quality that doesn't need 'refreshing'. I also agree with your point about the imperative. Incidentally, that is consistent with programmers calling the statements "instructions".
    – Lawrence
    Apr 4, 2022 at 18:24
  • 1
    Yes, Lawrence, instructions. :)
    – Lambie
    Apr 4, 2022 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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