IgorPartola
11 hours 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.
mattnewton
8 hours ago
The 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)
smitelli
3 hours ago
> "DO NOT SUBMIT"
Kinda verbose, ain't it? Just speaking from my own personal experience, usually when I resort to print-debugging I'm already pretty punchy and more likely to use a quick "ASDFASD" or similar.
twic
15 minutes ago
I use the strings "XXX" and "999" for this (the latter because you sometimes need a dummy value in a numeric context), and have a global git hook which stops me committing a changeset which includes them.
I occasionally need to override the hook, for example when using mktemp -t, or when some floating-point data actually contains a run of 9s. But mostly, it is quite specific at catching stuff that shouldn't be checked in.
rlpb
28 minutes ago
XXX is already highlighted by most editors by default (or at least mine) and seems suitable. Any comment to be committed to a shared branch should probably contain more specifics and not contain that, if you wanted to institute a policy.
EvanAnderson
2 hours ago
> > "DO NOT SUBMIT"
> Kinda verbose, ain't it?
I always used the word "doberman" for this purpose. I've never written code for a project that legitimately included the name of a dog variety. A simple grep for "doberman" in the production release CI pipeline catches it. If one ever did slip thru I figured it wouldn't be too offensive to anybody.
durumu
an hour ago
I've used NOCOMMIT. Less verbose, equally clear.
hotspot_one
42 minutes ago
depends. If you are paranoid and afraid of dogs, ...
bipson
2 hours ago
Yes, but you can check for "DO NOT SUBMIT" with automation.
You can't automate checking for random strings, right?
neutronicus
2 hours ago
Perhaps an abbreviation would be the best of both worlds, and debug strings should be prefixed with "DNS"
You won't need to submit that particular string working at Google, right?
Tyr42
2 hours ago
The automation which can check for do not submit itself is hard to submit. Or at least updates to it are hard to submit.
corobo
an hour ago
I use xyzzy
- Nothing happens
- Easy to find string in code, output, wherever
veunes
3 hours ago
It's amazing how many processes evolve because of incidents like these.
riffraff
7 hours ago
Was 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
6 hours ago
Yea, I have seen a very inappropriate debug statement being left in the led to the dev being promptly fired.
arethuza
3 hours ago
I 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
17 minutes 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
36 minutes ago
Likewise; 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.
raverbashing
5 hours ago
Pro tip: never add a "funny comment" especially an error message that's "never supposed to happen" unless you're happy with that message showing up in a board meeting, in front of your boss or worse (and it being traced back to you)
Suzuran
2 hours ago
I did this once with the deliberate intention that be traceable. Holding down a few keys while clicking on a specific small set of pixels in an application we were developing for a customer would produce a specific message that was attributable to me personally. I did this sort of thing in most things I worked on back then, partially as a "calling card" and partially as a means of being able to prove my involvement in a given product if the need ever arose. This saved our bacon when a sales rep sent an "evaluation" copy of the nearly completed product to the customer, without authorization, that consisted of our entire source tree. (This was the 1990s and we were running MS-DOS, no file security)
Suddenly the customer tells us they have "repurposed" an "internally developed program" and they cancel our contract. The sales rep was upset that he would not be getting a commission on the sale and mentioned that he had "even sent them a demo", which led to the discovery of what had happened. My boss and I went to the customer's site to "finalize the paperwork", and when we were shown the application (which had extremely minor UI changes) I checked if the hidden click spot still worked, and it did! The customer was horrified. My boss was outraged.
We ended up getting paid the full contract amount plus a large bonus in exchange for agreeing not to sue. The sales rep decided to leave voluntarily rather than be fired.
MonkeyClub
13 minutes ago
> Holding down a few keys while clicking on a specific small set of pixels
Did you draw inspiration for it from Bullock's The Net (1995) by any chance?
mackman
5 hours ago
Listen. If it’s never supposed to happen then you definitely want a customer to tell you if it happens. Best way to make sure that happens is to insult their mum. It’s just good engineering discipline.
bartread
3 hours ago
In my younger and more foolish years I worked for a company called Redgate and, whilst there, I had to do some licensing jiggery pokery that stopped people using our tools if the licensing code had been tampered with or removed.
I didn't want to make it too easy for people trying to crack our tools so, if such a problem were detected, the error message spat out to the console bore no relation to what had gone wrong.
By "bore no relation" I mean the error message would be one of a number of lines of dialogue from a scene in a House episode where House is trying to figure out who Wilson's girlfriend is... which led to this:
https://gist.github.com/gregoryyoung/871736
Yes, Greg Young (the event sourcing guy) ran into an error that said "Because I wanna ask you about your girlfriend. I must know who she is, or you would've told me her name," because he'd moved Smartassembly minus the licensing DLLs. Of course, he didn't realise what he'd done "wrong" so he tweeted it to his considerable following and it went viral.
Because I'm exactly the sort of walking cliche you'd expect I was blissfully unaware of the unfolding drama, being away on sabbatical snowboarding at the time. I hadn't taken my laptop with me, I'd disabled data roaming on my phone to avoid a whopper of a bill after a couple of months away, and had only a gen 1 iPad to access email and internet. So of course I came back in the evening to discover that it had all kicked off, with this ludicrous chain of emails where people were trying to figure out what was going on, until somebody had the sense to go and look in our source control system (which at the time was still svn for most things), and figure out that it was my fault.
People saw the funny side and it wasn't that big a deal but the reason I bring this up is that the last line of dialogue in that scene is, "Your mama," delivered by Wilson to House, and it was also the error message for the final failure scenario I was looking for. I'm glad that one didn't get printed.
nicce
3 hours ago
I write alot of #![no_std] code in Rust and forgetting debug messages is luckily impossible because compiler won’t compile in the end if you forget something.
mattnewton
39 minutes ago
The nice thing about DO NOT SUBMIT is that it worked in comments, text protos and other configuration files, and every language.
mstade
8 hours ago
I 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
7 hours 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
3 hours ago
I feel like given the industry, they should have a higher tolerance for slightly spicy placeholder images?
tomphoolery
8 hours ago
I 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/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
qingcharles
a few seconds ago
Username checks out.
roydivision
8 hours ago
I 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
6 hours ago
I 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.
yellowapple
13 minutes ago
If I was a goat I, too, would scream if I was breaded :)
worstspotgain
8 hours ago
She's not my bride. She's my fare.
Terr_
10 hours 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.
adastra22
9 hours ago
I like this, but use the initials of annoying Steve down the hall.
daurnimator
9 hours ago
And if he isn't "annoying Steve" now he will be known as that soon enough :)
dctoedt
9 minutes ago
> And if he isn't "annoying Steve" now he will be known as that soon enough :)
I once heard a guy — named Ed — who responded to a query about something with, "Well, I'm special." You can guess how he was referred to from then on ....
ajross
an hour ago
FIXME is also popular.
jxramos
8 hours ago
same, "DEBUG 1", "DEBUG 2", "DEBUG 3 with description xyz", etc.
Terr_
7 hours 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.
DigiEggz
3 minutes ago
This is pure gold.
lexicality
6 hours ago
Personally 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)
mananaysiempre
3 hours ago
Hope you aren’t inspecting COM or DCOM data then. Those MEOW all over the place.
> The header of the marshaled object reference begins with a distinguished signature (‘MEOW’)⁶ [...].
> ⁶ A Microsoft Program Manager who shall remain anonymous claims that MEOW stands for Microsoft Extended Object Wire representation. The author, while somewhat gullible, is skeptical of this story but is willing to give the aforementioned source the benefit of the doubt.
— Don Box, Essential COM
Tijdreiziger
5 hours ago
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
5 hours ago
Our 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
5 hours ago
Not a good choice if you refer to "homeowners" in the app though.
stuartjohnson12
3 hours ago
Wanted to make this comment, scrolled in anxious anticipation hoping no one else had made it yet, sadness washes over me.
Damogran6
12 minutes ago
Have an upvote, just the same. (From someone else who's thoughts aren't as original as he'd once thought.)
herodoturtle
2 hours ago
Hacker news poetry right here.
veunes
3 hours ago
It has a kind of charm to it. Like leaving your own harmless, personal mark on the code without risking another "I SEE YOU!" moment.
SpaceNoodled
6 hours ago
BRB grepping our codebase for MEOW
bendigedig
6 hours ago
I use "meow", "woof", and "cheeseburger".
coldpie
4 hours ago
I use "QWERT", for the same reasons.
sensanaty
2 hours ago
Lol 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
mooktakim
9 hours ago
It doesn't matter how advanced debugging gets. At the end we always use print. Only reliable thing to do.
serf
2 hours ago
I sort of laugh when using chatgpt/claude to code anything, if you ever mention to it that something isn't quite working right it'll pepper the entire code with printed debug statements rather than assisting you with any more advanced debugging methods.
even the bots do it (joke)
brunoarueira
6 hours ago
IshKebab
8 hours ago
Sometimes you can't even print and have to resort to toggling a GPIO pin...
bloak
4 hours ago
I'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
2 hours ago
When 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
19 minutes ago
Some people just don't believe in tooling full stop. Kind of mind-blowing. They're essentially coding with a fancy notepad.exe.
mwkaufma
8 hours ago
CVS 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.
Daviey
7 hours ago
Back in 2009, I saw something similar was when a user reported a bug to Ubuntu regarding Pulseaudio[0]. Basically the error messages was:
$ pulseaudio
W: main.c: D-Bus name org.pulseaudio.Server already taken. Weird shit!
I thought a user facing error message like this is inappropriate, so politely took the issue upstream [1].Lennart, who I had spent some time with in real life a few months previous, didn't yet have the reputation for being the person he is today. I thought he'd be pretty reasonable about it. Instead he closed the bug as "won't fix" and left the comment, "Sorry, but please don't waste my time, will you?".
I was pretty shocked by his response, I lost a lot of respect for him at this moment and then wrote a long ass blog post about professionalism of developers and appropriate language for user facing error messages.. but still, Lennart tainted himself and showed the person we now know him as. (Also, if you are reading this Lennart, fuck you).
Ubuntu ended up carrying a patch simply to remove this inappropriate language, I never checked if it was eventually cleaned upstream or if other distros also removed it.
EDIT: I just checked, and it was eventually removed in 2011 [2]
[0] https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/44...
[1] https://lists.freedesktop.org/archives/pulseaudio-bugs/2009-...
[2] https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commi...
pbhjpbhj
4 hours ago
Based only on your post I'm confused. You better a person for including "weird shit" in an error message. But the on a pubic forum tell them "fuck you".
On the basis of profanity alone, your action seems far worse than their's?
Daviey
4 hours ago
This is a community, not an end user facing error message for a product for the public used by millions of people.
I can use profanity in my communication, but I would never put foul language in an error.. same as I wouldn't in documentation or a formal letter.
Just imagine a pop-up dialogue box on Windows or OSX showing an error with "Weird Shit!" in it. Could you?
beeboobaa3
3 hours ago
I can, and it'd be pretty funny. Better than "Something went wrong!".
Why does it upset you so?
Daviey
3 hours ago
It wasn't me that raised the original bug, but a user. I didn't say it upsets me, but I do consider it unprofessional for a product.
So tell me, why would it be "funny"? Are you, or have you ever been responsible for content end users might see?
serf
2 hours ago
I don't think it's funny , but I do feel it's entirely more palatable than "WOOPS SOMETHING WENT WRONG <cute_dog_picture.jpg>" scheme that Amazon and other dotcoms use.
Regardless, the Lennart tirade added into the anecdote really just convinces me that the anecdote is there purely for axe-grinding.
homebrewer
5 hours ago
What "reputation"? He's disliked by a very loud minority, the rest of us don't care. I will take someone like Poettering who's actively solving decades-long problems over a useless "professional" any day of the week. He's effective because of his bullish personality.
toyg
an hour ago
> Poettering who's actively solving decades-long problems
He's doing that only because it's his job: his employer has an agenda (i.e. steering Linux fast enough and disruptively enough at a low level, so that serious competitors cannot arise), and he's implementing that agenda without a care in the world.
Would I personally take such a ruthless mercenary over more community-minded folks? No.
Daviey
5 hours ago
Either you know about his "reputation" or you don't.
Those that have never interacted with him don't care, I agree (I mean, why would they?). But those that have, i'd suggest is a minority that can tolerate him.. but ho-hum, neither of have statistics on this so we'll never know.
When I met and had discussions with him in 2007 he was mild and seemed to be constructive, i'd suggest his "bullish personality" became more prevalent with time.
majewsky
28 minutes ago
I met him once in 2012 and ate dinner with him and Kay Sievers. I agree to your observation about "mild" and "constructive", and will extend by saying that he appeared to me as someone fiercely focused on technical challenges. Therefore the "please don't waste my time" bit further up the thread appears to me totally in character for him. Lennart is really similar to Linus pre-2018 in that regard.
speed_spread
4 hours ago
There's no correlation between effectiveness and rudeness. Some people are effective _despite_ being assholes.
consteval
an hour ago
No, there's a strong correlation between leadership and being bullish. Because in order to get what YOU want done YOU have to advocate for yourself - other people won't advocate for you. Being stubborn is a type of advocacy.
People will claim it's unprofessional, and it is. The problem is that when other's are also unprofessional you can't convince them by being professional.
If you look at who moves up the social ladder fastest and retains their power the longest, they are typically hard-headed people. The have an almost unreasonable amount of confidence in themselves, and in many ways they are delusional.
However, I would argue such a personality is better than being timid. Ultimately, past the computers and the programs we are humans, and human effects come into play. Success is not just measured by correctness; it's measured by perception.
mistrial9
14 minutes ago
there is no simple way to dissect these inter-related statements, but from my point of view, no. Plenty of people here have dealt with serial abusers, which is being defended as "ends justify the means" above
consteval
4 minutes ago
To be clear there's a far, far gap between being abusive and being bullish. It's quite immature of you to make that leap and use that to paint me as pro-abuse to discredit my argument.
You could instead provide a real argument, not "well what you say is used to defend abusers!"
Yes, and famously Hitler wanted economic strength for his country. I guess wanting economic strength makes you Hitler? ... wait no, definitely not.
I don't have patience for these weak types of arguments. Saying nothing at all is free and easy, I would look into that more if I were you. Seems more your pace.
sgarland
2 hours ago
The larger WTF here is a developer thinking that Linux having audio problems is weird.
snapcaster
an hour ago
This seems so fragile and prudish. I can't imagine having any other reaction beyond chuckling and moving on
PhilipRoman
7 hours ago
Lol, 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...
int_19h
10 minutes ago
In some places, those lists are even more extensive as they include transliterations of profanities in all the various languages the product is ever localized in.
Sometimes this leads to embarrassing issues. I remember one case where a Chinese guy named Hui was unable to make a blog post on his team's official public blog. Turned out that his name was on the list of banned words because of https://en.wiktionary.org/wiki/%D1%85%D1%83%D0%B9#Russian
johnisgood
7 hours ago
Why 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.
HanClinto
3 hours ago
My guess is it's about client perception (and perhaps even admission of guilt).
My first encounter with this was as a young developer at an electronics manufacturing company. When discussing a request from a customer to change a particular undesirable behavior of the device, I referred to this as a "bug" in an e-mail to them.
I was quickly reprimanded / corrected, with the explanation that -- while "bug" is a somewhat innocuous term to engineers, to non-engineer types it brings to mind a whole host of bad images, fears, and can lead to canceled contracts under the premise that we've delivered bad-faith product. I was initially very resistant to this idea, but I've seen the wisdom in this as I've matured as an engineer over the past 20 years since this run-in.
For a related example, it reminds me of this issue that was opened on llama.cpp by a user who was concerned that the software had been "hacked":
https://github.com/ggerganov/llama.cpp/issues/33#issuecommen...
> Hey, I was reading your Readme.md and I saw that your repo was hacked. I want to ask what this means and wanted to check if the users like me also get the impact of hacking. Or, this is not the thing I should worry about?
Of course, the repo was not hacked -- but the founder of the project mentioned that it had been "hacked together" (as a term of humility / self-deprecation) and some users got the wrong idea of what he meant by that.
So I don't think this is about censorship, so much as good public relations. "Don't spook the horses" -- not all words mean the same things to engineers as people whose perceptions of technology are shaped more by movies and headlines.
Anthony-G
6 hours ago
Dystopian 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.
dotnet00
5 hours ago
You mean to work around the ungoodlist :)
geoduck14
3 hours ago
You joke, but the phrase "black list" isn't allowed where I work. It contains "black," which has racial connotations. We use "block list" instead. I didn't realize the connection to Newspeak until now
dotnet00
an hour ago
Yes, a lot of dumb little "American political brainrot" like that has been getting pushed in places.
Another example is GitHub changing the default branch name from master to main due to their perception that the existence of a master implies the existence of slaves.
nuancebydefault
4 hours ago
I don't like the 'bad gateway' Http response. I'd rather it'd find the good way and show me the freakin' website /i
arethuza
3 hours ago
I remember reading a great story about someone doing embedded development who was doing something like download firmware onto a device and being told "Checksum is bad"...
After much checking it was realised that this was because the checksum literally was 0xBAD....
pcl
9 hours ago
I 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.
projektfu
5 hours ago
Also prevents getting too deep in your markdown outline structure.
throwawayk7h
8 hours ago
I use DONOTCOMMIT the same way.
varjag
7 hours ago
I 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
3 hours ago
It’s one of those mistakes that’s hilarious in hindsight for everyone except the person responsible
evilc00kie
9 hours ago
Well, maybe I shouldn't use "Hello" by Adele either for the same reason ^^*
VBprogrammer
an hour ago
Yeah, 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.
systems_glitch
4 hours ago
Ugh, we had a FNG that did debug things like that at a previous job. His "humor" got exposed to the client several times.
veunes
3 hours ago
This sounds like one of those lessons you never forget - the hard way!
laurent_du
10 hours ago
This reminds me of the classical episode of the Onion "Is The Government Spying On Schizophrenics Enough?".
xnorswap
8 hours ago
This 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.
dotnet00
5 hours ago
There are endless numbers of cases where you can still end up having to just resort to print debugging, even in C#. Race conditions are a great example.
chris_pie
4 hours ago
you can configure the breakpoint to log stuff to the console, instead of breaking
throwaway2037
4 hours ago
Real question: Does Java have equivalent methods? I have never seen them.
ploynog
8 hours ago
Cool story bro. Let me tell the guys at work that we should just run .NET on our multi-core digital signal processors.
And we should also teach them not to get their delicate timing out of whack because they'll immediately stop dropping incoming samples if any of them gets interrupted by a debugger.
I'm sure everyone will be delighted.
rglullis
8 hours ago
Get off your .NET high horse. Every reasonably mature language has powerful debuggers.
xnorswap
7 hours ago
Well 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
7 hours ago
Unfortunately it is not always possible to debug for a myriad of reasons
appendix-rock
7 hours ago
Yawn. 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
7 hours ago
I'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
6 hours ago
It'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".
ziml77
2 hours ago
FWIW I didn't get the feeling at all that you were trying to come off as superior because you use .NET and its debugger.
high_na_euv
6 hours ago
I wish it was true
My experience in cpp is 5 times worse than in .net
neonsunset
3 hours ago
Does the GP comment claim that other languages cannot have similar quality of tooling? Why reply with a swipe?
alfiedotwtf
6 hours ago
I still haven’t found a good way of debugging async code that also has timing restrictions…
.., the world runs off print statements sprinkled throughout by a very frustrated and angry developer