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.
30+ years of tech, retired from an identity intelligence company, now part-time with an insurance broker.
Dev community mod - mostly light gardening & weeding out spam :)
Auto save if your tools have it.. otherwise train that Ctrl-S reflex!
On the boolean logic front - I always try to use positive logic everywhere, I get uncomfortable when the nots start appearing, especially review others code.
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.
30+ years of tech, retired from an identity intelligence company, now part-time with an insurance broker.
Dev community mod - mostly light gardening & weeding out spam :)
Ah ok, I get the normal workflow thing - similar here when tinkering in SSMS or similar, and I've been bitten by a crash doing that too.
I don't think you mistook my meaning on positive logic, although I used the phrase "always try" as sometimes it can be impossible (thanks random APIs!)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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.
Auto save if your tools have it.. otherwise train that Ctrl-S reflex!
On the boolean logic front - I always try to use positive logic everywhere, I get uncomfortable when the nots start appearing, especially review others code.
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.
IsNullOrWhitespace
is a positive check.hasToken
is a positive check. But I need anot
to turn one into the other.Ah ok, I get the normal workflow thing - similar here when tinkering in SSMS or similar, and I've been bitten by a crash doing that too.
I don't think you mistook my meaning on positive logic, although I used the phrase "always try" as sometimes it can be impossible (thanks random APIs!)