The Glade 4.0
https://gladerebooted.net/

When I do it wrong, it doesn't turn out right
https://gladerebooted.net/viewtopic.php?f=5&t=8760
Page 1 of 1

Author:  Shelgeyr [ Tue Jun 26, 2012 3:20 pm ]
Post subject:  When I do it wrong, it doesn't turn out right

Backtracing through code with my boss today:

Me: See how this subroutine doesn't write to the database? It calls this function to do that - and here's the local variable whose value is copied to the field where the users are reporting erroneous data.
Boss: Ok, where's that variable getting its value?
Me: There's this line here that would use the value passed to the function.
Boss: Did the subroutine pass a value to the function?
Me: No, so this line here is where the variable gets its value - in another function call.
Boss: OK, so let's look at *THAT* function.
Me: Here it is - and the function will assign a value in one of two ways, depending on the result of this condition check.
Boss: Well, in this case the condition would be "x", so the function ... OMG, this function is getting the value from the very table to which the other function is writing! It's recursive!
Me: So the reason the users are seeing incorrect data in their table is ... they put it there in the first place?
Boss: Yup, that's what's happening.

Page 1 of 1 All times are UTC - 6 hours [ DST ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/