11 ms·
Sorry time: years ago I worked on a telemedicine web app before telemedicine was nearly as popular as it is today. Part of the application had patients filling
by IgorPartola 2y ago
Sorry time: years ago I worked on a telemedicine web app before telemedicine was nearly as popular as it is today. Part of the application had patients filling out questionnaires online to show answers to the doctors. We were onboarding different parts of a large healthcare system throughout all this (cardio, GI, etc.) and each had questionnaires that required different logic for when and how to display the questions, so the application had a fairly powerful system for driving the conditional logic of when questions do and do not show up.
Well one day I am working on a new set of features to help support the new clinic that’s coming online and for whatever reason the question that should by all rights show up, does not. As I am getting deeper into debugging why, I pepper the code with nonsensical and slightly angry debug statements that show up alongside the questions. After solving the problem I happily clean up and commit the fixed code and move onto the next thing.
Well, it turns out I didn’t clean up all the debug statements. The statement I left in said I SEE YOU!!! in big red letters if you answered a particular set of questions in a particular way. This was discovered by a patient. Of the psychiatric clinic that just came online. On the questionnaire meant to evaluate paranoia.
Since then I have started using things like aaa and 111 as my debug markers.
- veunes 2y agoThis sounds like one of those lessons you never forget - the hard way!
- xnorswap 2y agoThis is why I enjoy writing C#/.Net, I don't need to deal with nonsense like print debugging. I don't think I'd be anywhere near as productive without: - Conditional breakpoints - Debugger.Launch - Debugger.Break - Debugger.Write Conditional breakpoints are essential, just run as normal and it'll only break when your bizarre edge case is hit. Debugger.Break and Debugger.Launch are like a breakpoint that gets hit even when you're not debugging, and prompts you to attach a debugger. ( Launch won't pause if you already have one attached, but especially useful when you want to attach to a start-up routine in an IIS hosted web-app. ) Debugger.Write writes to a different output stream, and like all Diagnostic.Debug statements, isn't even compiled into release builds, so there's zero chance of it ending up in prod. These are essential tools for rapid debugging. Printing nonsense and hoping to spot it feels 20+ years out of date.
- throwaway2037 2y agoReal question: Does Java have equivalent methods? I have never seen them.
- rglullis 2y agoGet off your .NET high horse. Every reasonably mature language has powerful debuggers.
- xnorswap 2y agoWell indeed, I could have said, "this is why I enjoy working in a mature environment". .NET just happens to be my experience. The point I was trying to make is that you shouldn't be print debugging in 2024.
- rezonant 2y agoUnfortunately it is not always possible to debug for a myriad of reasons
- appendix-rock 2y agoYawn. I’m all but certain that all the environments in these “print debugging fail” stories have debuggers. The fact that generation after generation of programmers fall into print debugging, despite there being “no reason” to do it in many contexts for…decades at this point, should tell you that you’re missing something, not that everyone is dumb except for you.
- xnorswap 2y agoI'm not saying people are dumb, I'm saying we've failed to provide good dev UX for debugging, so that people find it easier to reach for print debugging than leverage their debugger.
- xnorswap 2y agoIt's also clear I got the tone of my original post wrong, I was always trying to make this point, not some point scoring "I'm better because I use X".
- mwkaufma 2y agoCVS at my first job was configured to reject commits containing f-bombs after a spicy debug message sneaked into production and showed up in a children's game.
- PhilipRoman 2y agoLol, at $work there is a big list of forbidden words, I was not aware of it until I created a pull request containing the phrase "bad packet". Turns out "bad" is in the list, along with stuff like "workaround", "hard-coded", and also a huge list of every slur and vaguely sexual term known to man, some of them oddly specific like "son of a motherless goat". Learned a few new words myself that day...
- johnisgood 2y agoWhy is "bad", "workaround" and "hard-coded" are on the list of blacklisted words? Sounds kind of dystopian; just because you forbid a word from the dictionary or remove it, it does not solve the underlying issue.
- Anthony-G 2y agoDystopian for sure: I’d wager that if the code-base lives long enough and the pool of developers is large enough, they will start using Newspeak words such as “ungood” or “doubleplusungood” – or other synonyms for “bad” – to work around the blacklist.
- mattnewton 2y agoThe strings used for debugging at Google were supposed to include “DO NOT SUBMIT” which, a bot to check for this was added after a debug strings made it to production (It was before my time but I believe it was after the legendary WD incident- “western digital” was remapped to “woodly doodly” in test code that accidentally shipped for those curious)
- riffraff 2y agoWas the debug string that made it to production embarrassing? I remember a swearword appearing in a very big national company login form once, and I'd have felt sorry for the dev if it wasn't so hilarious.
- PetahNZ 2y agoYea, I have seen a very inappropriate debug statement being left in the led to the dev being promptly fired.
- arethuza 2y agoI was leading a startup development team in the late 90's and one of our developers told me that some very inappropriate test data had been sent to IBM to be included in a product demo and burned onto tens of thousands of discs that they would distribute. Eventually it turned out that it was the single word "sheep" - which taken out of the relevant alt.* context was pretty harmless. Talk about a moment when I thought my career had crashed and burned...
- MonkeyClub 2y ago> Eventually it turned out that it was the single word "sheep" - which taken out of the relevant alt.* context was pretty harmless. Please, do contextualize it?
- HaZeust 2y agoLikewise; they tried to pin it on me, and I had to go to the Git commit history to show it was another employee. My administrative leave was promptly revoked.
- mstade 2y agoI did something similar years ago when working on a gambling site where people could upload bets in bulk using specially crafted files. During development this would sometimes break but only in very specific circumstances, and because they were so absurd and seemingly specific to our local development environment I just added an error message saying "watch and amaze while the application eats itself!" Or something to that effect. It was inspired by an error I saw with the Discworld game for the original PlayStation. Of course, once this hit production it turns out the det of circumstances necessary to trigger this error wasn't quite as specific as I'd thought, and support was overloaded by hundreds of people calling in to report the error, worried that their money was gone. Of course, people using these feature were high rollers placing very large bets, so management was not happy... Fortunately I wasn't fired and we fixed the issue very quickly, but man I felt the edge of that sword really close to my neck. It was at one of my first jobs as well nearby 20 years ago. I definitely learned some valuable lessons that week. :o)
- doublerabbit 2y ago> I wasn't fired and we fixed the issue very quickly, but man I felt the edge of that sword really close to my neck. The same experience. I was working for a pornography company and where I was configuring load balancers. I had a test page of semi-naked red deviless with the words "Hello Minion" above her head which I had forgotten to remove. So during peak times, when the misconfigured LB went active it threw that page to the public, advertisers and the other white labelled websites.
- eru 2y agoI feel like given the industry, they should have a higher tolerance for slightly spicy placeholder images?
- deleted 2y ago[deleted]
- varjag 2y agoI remember a colleague leaving a debug popup "fuck is wrong with the data" in a product outsourced to us. Naturally it popped during the customer demo, in presence of someone like Germany's minister of something. We had a good laugh; the dude was fired on the spot tho.
- veunes 2y agoIt’s one of those mistakes that’s hilarious in hindsight for everyone except the person responsible
- lexicality 2y agoPersonally I use the word "MEOW" because a) it's easy to search for and spot in logs b) it will (hopefully) never be a legitimate string in the kind of things I work on c) fairly unlikely to cause offence (unless the customer is a dog)
- SpaceNoodled 2y agoBRB grepping our codebase for MEOW
- bendigedig 2y agoI use "meow", "woof", and "cheeseburger".
- Tijdreiziger 2y agohttps://upload.wikimedia.org/wikipedia/en/f/f8/Internet_dog.jpg https://upload.wikimedia.org/wikipedia/en/f/f8/Internet_dog.... (alt text: vintage meme depicting two dogs using a computer, captioned ‘On the Internet, nobody knows you’re a dog.’)
- ithinkso 2y agoOur testers (China and India) know that when they see KURWA or DUPA in logs that to send it straight to the polish site, we are considering adding a hook to check for those
- ndsipa_pomu 2y agoNot a good choice if you refer to "homeowners" in the app though.
- stuartjohnson12 2y agoWanted to make this comment, scrolled in anxious anticipation hoping no one else had made it yet, sadness washes over me.
- herodoturtle 2y ago
- systems_glitch 2y agoUgh, we had a FNG that did debug things like that at a previous job. His "humor" got exposed to the client several times.
- sensanaty 2y agoLol I remember early in my career using "fuck" and "cock" a lot for debugging. Very quickly learned to not do that, I instead replaced it with "banana" for the most part
- wraptile 2y agobanana has been there with me from the beginning! There's something weirdly satisfying about this particular word - the spelling, the sound and just sheer siliness just has a calming effect.
- twic 2y agoAnd for fine and trace logging, you've got bananana, banananana, etc.
- hermitdev 2y ago"ba" + "na" * severity
- TRiG_Ireland 2y agoTo quote Sir Terry, Nanny Ogg knew how to start spelling 'banana', but didn't know how you stopped.
- johnisgood 2y agoGoing through one file: IMPORTAAAAAAAAAAAAAAAAAANT _F for functions. _H for headers. _V for fuck knows. There are funnier ones but I am lazy. :P
- VBprogrammer 2y agoYeah, someone did that at a place I once worked with the C-word in some JavaScript debug logs. Never put anything in the code, no matter how temporary, that you would be embarrassed to have appear to a customer.
- deleted 2y ago[deleted]
- goblox9999 2y agoI once did the same except my debug message, created in a punchy mood late at night, was "YOU ARE BEING ATTACKED BY MOTHS." Left that in there and forgot about it until I received a very puzzled debug request months later...
- wonnage 2y agoTwitter was working on streaming with chunked encoding, which resulted in this: https://x.com/ryankuder/status/474658110737371136 https://x.com/ryankuder/status/474658110737371136
- jdwithit 2y agoI've definitely committed debug messages before. Probably everyone who writes code has at some point. Thankfully it's never been anything TOO embarrassing. These days I try to always do a git diff and search for "print" (or whatever the language equivalent is) before I commit and push as a final sanity check. In high school, my friend had a habit of titling draft papers something inappropriate. Which was funny when we were peer editing each other. But inevitably, one time he forgot to change it back. We sat down in English class and as the teacher was walking around collecting papers, he glanced down at his and suddenly UH I GOTTA GO TO THE BATHROOM. He sprinted out the door straight to the computer lab and printed off a copy that didn't have a bunch of profanity in 24 point font at the top. I about died laughing.
- bornfreddy 2y agoInstead of git diff, you can also use git add -p, which asks you for each change.
- dbmikus 2y agoI used to debug with curse words until I accidentally pushed one of those into the company's open source repo and then we went and did some `git push --force` to scrub it from history. Now I just use my initials at the start of a debug line.
- matheusmoreira 2y agoI gotta ask... Is the patient alright?
- FuckButtons 2y agoI just have a snippet that prints “DEBUG”, easy to grep for.
- Philadelphia 2y agoI always use “elephant” as my debugging statement, since it’s unlikely to come up in the code and easy to search for when you need to remove it, and also pretty innocuous. If you’re writing software for zoos, you might want to try something else, though.
- deleted 2y ago[deleted]
- LorenPechtel 2y agoI always start them with "Woof".
- Terr_ 2y ago> Since then I have started using things like aaa and 111 as my debug markers. I often use my initials and "DEBUG", so that the string (A) is distinctly grep-able before committing code and (B) if it somehow ends up in production it's not totally mysterious.
- jxramos 2y agosame, "DEBUG 1", "DEBUG 2", "DEBUG 3 with description xyz", etc.
- Terr_ 2y ago> "DEBUG 1", "DEBUG 2" If you use language expressions that automatically become file/line info, that frees you from juggling unique labels. Then it can be saved into your IDE as a insertable code snippet. It goes without saying that a real interactive debugger session is even better, but it isn't always convenient or possible.
- TremendousJudge 2y agoSometimes an interactive debugger session will make the issue you are researching not happen -- I don't know of a way of tracking down race conditions that isn't logging everything that happens until I find out which thing happened before which other thing that wasn't supposed to
- eastbound 2y agoAnd the reverse: I change values using breakpoints. So the code runs (because the breakpoint condition is false) but the value is different. Example of breakpoint condition: (licenseActive = true) != true
- Terr_ 2y ago> Sometimes an interactive debugger session will make the issue you are researching not happen I still remember the first time that happened to me, I think it had to do with some (not yet diagnosed) race condition on a PHP server between the HTTP requests it served, and the debugger had a side-effect of blocking the next request while I was inspecting the first one. That reminds me of another thing: Some debuggers allow you to set breakpoints and set them to not suspend or pause execution, but to emits a log-message to the debugger or terminal instead. Those are an upgrade over print-statements in that: 1. You can't accidentally commit it and it doesn't show up to make your diffs weird 2. You may be able to dynamically change what things it prints out without restarting the program
- laurent_du 2y agoThis reminds me of the classical episode of the Onion "Is The Government Spying On Schizophrenics Enough?".
- evilc00kie 2y agoWell, maybe I shouldn't use "Hello" by Adele either for the same reason ^^*
- pcl 2y agoI use ##### along with a git commit hook that rejects commits adding such text. I like the 5 pounds because they are visually easy to find on the screen, too.
- throwawayk7h 2y agoI use DONOTCOMMIT the same way.
- projektfu 2y agoAlso prevents getting too deep in your markdown outline structure.
- searealist 2y ago[flagged]
- mooktakim 2y agoIt doesn't matter how advanced debugging gets. At the end we always use print. Only reliable thing to do.
- IshKebab 2y agoSometimes you can't even print and have to resort to toggling a GPIO pin...
- bloak 2y agoI've worked with systems that were so utterly and entirely broken that the only way I could confirm that a particular code path was followed was by inserting an infinite loop and observing that the system then hung instead of crashing. Combine that with a build system that is so utterly and entirely broken that the only way to be sure is to do a fresh checkout each time, and with a hardware set-up that involves writing the binary onto flash memory and plugging it into a device that is located under somebody else's desk in another room and then perhaps you have the Debugging Cycle From Hell.
- Moru 2y agoWhen I was programming at home om my Atari ST I thought debuggers was the greatest invention ever. It was wonderful to be able to step through assembler code line by line, instead of looking at BASIC print statement output and guessing what was going on and where. Made life so much easier. Don't people believe in debuggers any more?
- IshKebab 2y agoSome people just don't believe in tooling full stop. Kind of mind-blowing. They're essentially coding with a fancy notepad.exe.
- db48x 2y agoWhat’s weird is that debuggers are so advanced now. rr and Pernosco are to regular debuggers like regular debuggers are to inserting an infinite loop into your code.
- tomphoolery 2y agoI had a comment in this file for a very long time but the project lead was something of a Professional so he removed it. The comment was "# MULTIPASS!" https://github.com/workarea-commerce/workarea/blob/master/core/app/queries/workarea/search/storefront_search/product_multipass.rb https://github.com/workarea-commerce/workarea/blob/master/co... Some context: - The 5th Element is a cool movie - My sister's dog was named Leeloo Dallas Multipass and she was like my favorite dog of all time - I was the original developer of the `ProductMultipass` search query feature - Turns out, funny comments make other developers like your product more
- worstspotgain 2y agoShe's not my bride. She's my fare.
- qingcharles 2y agoUsername checks out.
- 0xfeba 2y agoI just made one last week that cracks me up still: // We are liiiiiving in a material world, and I am a ma-ma-material org. const materialOrgs = await db_read<Org>(organizations, { type: 'materials' });
- roydivision 2y agoI handed a project over to a new developer once before leaving the company. I returned about 18 months later, and he'd stripped out the one Easter egg I'd put in. No sense of humor that chap. Good coder though.
- PetahNZ 2y agoI made a website for a goat breading society. It played screaming goat sounds if you typed the Konami code. I was sad the day that site was replaced.
- 2y ago