- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
My verbosity setting works and it's turned off, so i didn't post a comment.
Oh wait...
Admin
Ah, the classic confusion of what developer AND non-developers here when latter talk about OR :-)
Admin
"The biggest WTF is when I find out that I'm the one that did it, though." I feel you
Admin
Can we have the old Remy back? This one reminds me too much of sunlight and happiness, while I'm stowed away here in this rathole cubicle.
Admin
Ever since he struck it rich with this website he just can't wipe the smile off his face. And the happy shirt is right at home on his private tropical island. ;)
Admin
Fixed?
Admin
You can print him out, frame him and put a LED on him, so you end up with a bright corner in your private box ;-)
Admin
TRWTF is that they let devs push code changes without any code review.
Admin
You must be new here.
Admin
I once worked for a big financial organisation where someone enabled verbose logging during the day on the PROD SQL server. The whole environment immediately came to a grinding halt. Now that was a fun day.
Admin
That should be fine for testing if
process.env.DEBUG_LOG
is defined (notnull
) and usingtrue
as a default.Though what everyone seems to have missed is that the environment variable is being set to the string
false
outside of the program so that will need to be checked for (unless I'm missing something about how C# or .Net treatstrue
/false
strings in env vars.)Admin
I admit to having an || false test in my "whether to show errors" code that I sometimes set to true and then set back. Hard to imagine forgetting to reset it or committing it to production, though.
Admin
When I do something like this, I add a comment immediately above it, like // DO NOT CHECK THIS IN
hopefully, when I'm getting my PR ready, I catch this; or the code reviewer catches it.
Another option would be to add a test that specifically checks for the code change you don't want to have committed; which fails as long as the code is broken. That way, when you run the tests, the failed test lets you know that you need to revert your change.
Oh, wait -- those require pull requests; and code reviews; and unit tests. Never mind.
Admin
surely that should be
const DEBUG_LOG = process.env.DEBUG_LOG ? true : false
Admin
Or have such flags set in a local config file that's listed in
.gitignore
or equivalent, so each individual user can have their own conf/prefs that won't get committed.Admin
I am guilty of something like this as well. Too lazy to always to a whole upload file to SFTP to be able to download it when debugging I added shortcuts directly loading a local file. More than once it made it to QA, and they asked why it would like to open a local file on a drive they didn't even have. Sprinkled a #IF DEBUG around and things are nice again :)
Admin
Or set the variable using conditional compilation. true when you're developing, false in release builds so it'll never be enabled in a production release.
Admin
Fixed it
Admin
Personally, I've taken to using a pre-push script for that. Any debug statement I write contains the substring "DBG:", so my pre-push script checks the code for that string (excluding comments).
Doesn't mean other code doesn't end up getting pushed accidentally.
Also, since this is Fortran, I am sometimes fighting with language limitations with unexpected results. We have a "TO_STRING" macro, that is used in debug statements, like our "ASSERT" macro, but due to a strange warning message I noticed, that
expands to something that contains
and you can probably see where that one goes wrong.
I still don't understand why the warning was about a Hollerith constant though. And now upon reading up what that actually means (without just googling for the whole warning), it turns out to be a throw-back to Fortran 66 not having a character type. Oi...