Today I tried to run some code. It timed out with no response. A little bit later, I figured out I had inverted a boolean condition. Which caused an infinite loop.
After all these years, I still make that same mistake with booleans -- forgetting to put a not (or !) in front of a condition.
Do you have a thing that always trips you up?
/∞

Latest comments (22)
My normal workflow with those tools doesn't need to save anything, and doing so is extra time spent for otherwise quick work. So in effect, needing to save something goes against my training. And unfortunately pgAdmin doesn't have auto-save. When actually developing a query I probably just need to open Notepad++, which does have autosave, and set the Language to SQL. Then copy paste it to pgAdmin to run it.
I think using only positive logic is not really achievable (unless I have mistaken your meaning). The code that tripped me up was this.
IsNullOrWhitespaceis a positive check.hasTokenis a positive check. But I need anotto turn one into the other.Make sure you pass your feedback along to the AWS SDK team. They are the ones who designed the workflow for the
ssm:GetParametersByPathAPI. It requires checking for the presence ofNextTokento know whether you got all the parameters or you need to send a request for more. Out of curiousity how would you design paging functionality to avoid the boolean check?Border: 0 vs. Border: none
:before vs. ::before
Same here, instead of
!, sometimes I usesomething !== something.i try to forget ; writing JS and coming from Java world 😂
Lol I've been at this for half a decade and managed to do an infinite loop during an interview
Similar to this, if I'm really distracted or tired. I sometimes mixup the combinatory logic.
Kasey do you mind pm'ing me? Id love to hear how you began folding f# into your professional environment, or whether it started out there? Thanks brother.
Sure thing! Although my particular path may not be interesting to you. I made a financially-lateral move to a smaller company in order to have more freedom to choose.
The thing that trips me up time and again is trusting software. Today I've spent about half an hour tailoring a series of queries in the query pane of Sequel Pro, without saving them to a text file. So when the app crashes, I lose everything. I learn from my mistakes for about a week and then gradually fall back into the lazy old me who expects things to work.
I do this too! We're using pgAdmin, and sometimes it crashes and I haven't bothered to save the query. Most of the time I'm using it, the queries are only needed for a short while, so not a big deal. But that one time I am using it to prototype developing real queries and don't save is when pgAdmin crashes and I have to start over.
I always stop running the local build to put a breakpoint. I then have to rerun the build and do everything all over again to reach the breakpoint...
I have no idea why I do thiiiis aaagh
I guess this happens from time to time. The question is how fast you can catch it. If you have a good unit test suite, probably quite fast.