Skip to main content
replaced http://programmers.stackexchange.com/ with https://softwareengineering.stackexchange.com/
Source Link

The former code seems more rational and readable to me and the whole loop also makes perfect sense. I'm not sure about the context of the program, but there is nothing wrong with the loop structure in essence.

The later example seems trying to write a Clever code, that is absolutely confusing to me in the first glance.

I also agree with Rob Y's answeranswer that in the very first glance you might think it should be an equation == rather than an assignment, however if you actually read the while statement to the end you will realize it's not a typo or mistake, however the problem is that you can't clearly understand Why there is an assignment within the while statement unless you keep the function name exactly same as doThingsThatCanAlterCurrentStrings or add an inline comment that explains the following function is likely to change the value of currentStrings.

The former code seems more rational and readable to me and the whole loop also makes perfect sense. I'm not sure about the context of the program, but there is nothing wrong with the loop structure in essence.

The later example seems trying to write a Clever code, that is absolutely confusing to me in the first glance.

I also agree with Rob Y's answer that in the very first glance you might think it should be an equation == rather than an assignment, however if you actually read the while statement to the end you will realize it's not a typo or mistake, however the problem is that you can't clearly understand Why there is an assignment within the while statement unless you keep the function name exactly same as doThingsThatCanAlterCurrentStrings or add an inline comment that explains the following function is likely to change the value of currentStrings.

The former code seems more rational and readable to me and the whole loop also makes perfect sense. I'm not sure about the context of the program, but there is nothing wrong with the loop structure in essence.

The later example seems trying to write a Clever code, that is absolutely confusing to me in the first glance.

I also agree with Rob Y's answer that in the very first glance you might think it should be an equation == rather than an assignment, however if you actually read the while statement to the end you will realize it's not a typo or mistake, however the problem is that you can't clearly understand Why there is an assignment within the while statement unless you keep the function name exactly same as doThingsThatCanAlterCurrentStrings or add an inline comment that explains the following function is likely to change the value of currentStrings.

added 20 characters in body
Source Link
Mahdi
  • 2k
  • 2
  • 17
  • 26

The former code seems more rational and readable to me and the whole loop also makes perfect sense. I'm not sure about the context of the program, but there is nothing wrong with the loop structure in essence.

The later example seems trying to write a Clever code, that is absolutely confusing to me in the first glance.

I also agree with Rob Y's answer that in the very first glance you might think it should be an equation == rather than an assignment, however if you actually read the ifwhile statement to the end you will realize it's not a typo or mistake, however the problem is that you can't clearly understand Why there is an assignment within the ifwhile statement unless you keep the function name exactly same as doThingsThatCanAlterCurrentStrings or add an inline comment that explains the following function is likely to change the value of currentStrings.

The former code seems more rational and readable to me and the whole loop also makes perfect sense. I'm not sure about the context of the program, but there is nothing wrong with the loop structure in essence.

The later example seems trying to write a Clever code, that is absolutely confusing to me in the first glance.

I also agree with Rob Y's answer that in the very first glance you might think it should be == rather than an assignment, however if you actually read the if statement to the end you will realize it's not a typo or mistake, however the problem is that you can't clearly understand Why there is an assignment within the if statement unless you keep the function name exactly same as doThingsThatCanAlterCurrentStrings or add an inline comment that explains the following function is likely to change the value of currentStrings.

The former code seems more rational and readable to me and the whole loop also makes perfect sense. I'm not sure about the context of the program, but there is nothing wrong with the loop structure in essence.

The later example seems trying to write a Clever code, that is absolutely confusing to me in the first glance.

I also agree with Rob Y's answer that in the very first glance you might think it should be an equation == rather than an assignment, however if you actually read the while statement to the end you will realize it's not a typo or mistake, however the problem is that you can't clearly understand Why there is an assignment within the while statement unless you keep the function name exactly same as doThingsThatCanAlterCurrentStrings or add an inline comment that explains the following function is likely to change the value of currentStrings.

added 630 characters in body
Source Link
Mahdi
  • 2k
  • 2
  • 17
  • 26

The former code seems more rational and readable to me and the whole loop also makes perfect sense. I'm not sure about the context of the program, but there is nothing wrong with the loop structure in essence.

The later example seems trying to write a Clever code, that is absolutely confusing to me in the first glance.

I also agree with Rob Y's answer that in the very first glance you might think it should be == rather than an assignment, however if you actually read the if statement to the end you will realize it's not a typo or mistake, however the problem is that you can't clearly understand Why there is an assignment within the if statement unless you keep the function name exactly same as doThingsThatCanAlterCurrentStrings or add an inline comment that explains the following function is likely to change the value of currentStrings.

The former code seems more rational and readable to me and the whole loop also makes perfect sense. I'm not sure about the context of the program, but there is nothing wrong with the loop structure in essence.

The later example seems trying to write a Clever code, that is absolutely confusing to me in the first glance.

The former code seems more rational and readable to me and the whole loop also makes perfect sense. I'm not sure about the context of the program, but there is nothing wrong with the loop structure in essence.

The later example seems trying to write a Clever code, that is absolutely confusing to me in the first glance.

I also agree with Rob Y's answer that in the very first glance you might think it should be == rather than an assignment, however if you actually read the if statement to the end you will realize it's not a typo or mistake, however the problem is that you can't clearly understand Why there is an assignment within the if statement unless you keep the function name exactly same as doThingsThatCanAlterCurrentStrings or add an inline comment that explains the following function is likely to change the value of currentStrings.

Source Link
Mahdi
  • 2k
  • 2
  • 17
  • 26
Loading