5 ms·
> "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 an
by smitelli 2y 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.
- bipson 2y agoYes, but you can check for "DO NOT SUBMIT" with automation. You can't automate checking for random strings, right?
- neutronicus 2y agoPerhaps 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 2y agoThe automation which can check for do not submit itself is hard to submit. Or at least updates to it are hard to submit.
- Dylan16807 2y agoforbidden_string = "DO NOT " + "SUBMIT" Seems easy enough?
- organsnyder 2y agoJust disable that particular linting rule (or however it's implemented) in that repo.
- pjerem 2y agoWell in the LLM era, you could. I’m not sure you should :)
- trelane 2y ago> You can't automate checking for random strings, right? No, but you can make the string configurable.
- anyonecancode 2y agoRelated in terms of being easy to search for, I use the abbreviation "TK" as a placeholder for text or incomplete code. Took this from the publishing industry (my partner worked in magazines) -- it's a combination that does not appear in regular English and so is easy to both see and to use search tools for.
- EvanAnderson 2y 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 2y agoI've used NOCOMMIT. Less verbose, equally clear.
- hotspot_one 2y agodepends. If you are paranoid and afraid of dogs, ...
- corobo 2y agoI use xyzzy - Nothing happens - Easy to find string in code, output, wherever
- medstrom 2y agoAnd in GNU info manuals. https://www.gnu.org/software/emacs/manual/html_node/elisp/Sequence-Functions.html https://www.gnu.org/software/emacs/manual/html_node/elisp/Se... Just so happened to be reading that in the next tab.
- rlpb 2y agoXXX 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.
- twic 2y agoI 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.
- metrognome 2y agoIt's about writing code that your peers can read. "DO NOT SUBMIT" is clear as day. "ASDFASD" probably does not mean "this is a debugging string" to most people.
- mattnewton 2y agoNot really? it’s close to the minimum string you’d be okay with never actually wanting to commit. Never had a problem with it in logs, but it could be in a comment next to the log if you did. Easy enough to add a shortcut for if you really have a problem typing it out, but at my typing speed my brain has always been the bottleneck, not the number of characters.
- names_are_hard 2y agoI worked on a codebase that had a special logging function with a name like NoPushLog that was just a direct wrapper of the base log function. A githook checked that this string was not in pushed code. This solves many of the concerns raised in this thread about readability, automation, avoiding typos in the magic string. The tricky thing you have to solve is how to push the code that defines the custom logging function, but there are solutions.
- deleted 2y ago[deleted]
- mattnewton 2y agoIt doesn’t allow you to put that in comments, config files or other languages though like a plain text string.
- sneak 2y agoWhy wouldn’t it? Sounds like the git hook is probably just grep…
- mattnewton 2y agoThen why have a function?
- default-kramer 2y agoI use "NOMERGE" plus the habit of grepping for it before I merge a branch.
- secondcoming 2y ago"GOT_HERE_1"
- refulgentis 2y agoThey pay you enough that you'll respect the need to be professional and write "DO NOT SUBMIT" over "ASDFASD" or similar.