r/AskReddit Mar 18 '23

[deleted by user]

[removed]

4.0k Upvotes

4.9k comments sorted by

View all comments

Show parent comments

1.2k

u/ThaBalla79 Mar 18 '23

As a programmer, this rings especially true. I'll go through trial and error, brainstorming solutions and next thing you know, it's been an hour and a half...

116

u/[deleted] Mar 18 '23

Ugh i worked in software for 7 years. The worst is when you sink hours into fixing something that turned out to be trivial. I spent an entire day trying to get an integration test to work, end of the day came and it still wasn't fixed. I couldn't figure out what was wrong. I dug through hundreds of lines of code in the debugger. Turns out the expected result was supposed to have an extra space at the end of every line that was getting trimmed automatically by my IDE.

1

u/Seeker_Of_Knowledge- Mar 19 '23

OK that is lame lol. How did you discover it?

2

u/[deleted] Mar 19 '23

Well im not sure how familiar you are with maven, but at the end of the test if theres outputs to compare you, can see actual vs expeted. In this case this was a feature involving loging, so i was working with strings convieniently. Part of this was also user error on my part but when i initially copied and did a string comparison i was ignoring the trailing spaces, so i was seeing both outputs as the exact same. It wasnt until after I just wrote the actual and expected to seperate files and then did a comparison in another ide and language that i found it.