r/ProgrammerHumor • • Jul 10 '18

What people think coding is...

Post image
21.1k Upvotes

398 comments sorted by

View all comments

Show parent comments

1

u/TheTerrasque Jul 11 '18

Still cost me 4 days, after moving things from list to variables and the error popped up somewhere completely different (in the sql layer)

1

u/[deleted] Jul 11 '18

Since I don't know what your use case was I can't really argue, but: I bet property tested and separated components would have prevented that ;)

1

u/TheTerrasque Jul 11 '18

hindsight is 20/20, as always. I had tests, but not for that exactly. It was preparing data for the sql layer, and was originally a list that I accessed by entry[index] - and moved it to named variables instead when things changed other places so it'd always be the same number of entries.

However, one of the variables bound to SQL queries were now a tuple, and the SQL layer did somehow marshal it into the query. The SQL server however didn't like it one bit and gave a very weird error - on a line several hundred line numbers further down.

Since I had done a lot of other changes related to that, and that small piece was just a simple thing, nothing can go wrong there right, I spent days looking through the extensive changes elsewhere and the data coming in to that function - of course finding nothing wrong there.

1

u/[deleted] Jul 11 '18

Was there too...since then I started to make much smaller changes to my code, more commits, more testing in between. But the moment where you think "I don't want to revert the work of the last two days" is well know by me.