- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Haha. That was a good one. Haha. That was a good one.
Admin
You can say that again.
Admin
Wonder if it was originally different code and they changed it without looking at the old code (either because they feared it or were in a hurry).
Admin
Looks like classic cut'n'paste development.
Admin
Y'know, if they'd use a loop, they would be able to easily enhance the certainty of that by running the code at least 3 times.
Admin
Your supposed to change the pasted bit !!! ha ha ha
Admin
I wonder how many other times they do this... I bet this is lightning fast!!
Admin
Spec: "Ensure all values are set by setting all values. Twice."
Admin
If this were cut-and-paste code, then why is the order of assignments swapped? Maybe because this block was written in two different places and copied twice here.
This reminds me a lot of DNA as we understand it. There are lots of places with similar or identical sequences, i.e., a whole lot of redundancy with occaisional variations. And, with DNA there are a lot of cut-and-paste operations too, and they seem to work very well. That's the premise behind evolutionary algorithms. Is this code snippet just the result of genetic programming?
Admin
TheF0o1, these statements were side-by-side.
Admin
N-Tier variable assignment
Admin
Personally, when setting a value, I'd use the following (in C-style code for simplicity):
do { value = newValue; } while(value != newValue);
This will ensure that the loop runs as many times as needed to set the actual value.
Admin
I don't get it...
Admin
That shit's like Nas, yo.
Admin
Notice that this isn't VB code.
Admin
If there were more than just @NonPropLev and @BOMLevel to check, then yes it may have a third and fourth block.
Admin
Copy paste with a twist :-)
Admin
Look how many lines of code there are in our solution. It must be complicated and very good.
Admin
Greetings from the Department of Redundancy Department. And "hello to you" as well.