4 ms·
Big fan of these “sarcastically named” functions, there are a lot of good reasons to use them (mainly, every time you go to use it you’ll think about whether it
by fwlr 3y ago
Big fan of these “sarcastically named” functions, there are a lot of good reasons to use them (mainly, every time you go to use it you’ll think about whether it’s really needed) and not many reasons to not use it (naming it “fastConvert” doesn’t make it any faster than naming it “slowConvert”).
- kstrauser 3y agoSome of our internal tools have command line options along the lines of: --yolo Yes, I really want to overwrite the production database and get us all fired. where "--yolo" is our standard flag for such things. When I find myself about to type that, I go back and double, triple, quadruple check that I really intend to do the thing that I'm asking it to do.
- adhesive_wombat 3y agoShades of hdparm's --please-destroy-my-drive
- kstrauser 3y agoI applaud that one, too.
- nurple 3y agoLove it! Ceph has --yes-i-really-mean-it for dangerous fs changes, and --yes-i-really-really-mean-it for pool rm. The annoying-to-type property is pretty effective.
- snet0 3y agoThis kind of thing is not so unpopular in some kinds of user interfaces. I think GitHub has a repo deletion confirmation that asks you to type the name of the repo. It's not quite the same as flag naming, but it's a big flashing light signalling to you that you're doing something important.
- nurple 3y agoI really like that UX! Even Google dropped the ball there, I accidentally deleted our production gke cluster a handful of years back, through the bloodshot eyes of a forced all-nighter, because their deletion UX was two button clicks (may be different now).
- lamontcg 3y agothe_private_method_that_has_to_be_public_that_nobody_should_use()
- scarface_74 3y agoAt my company I have repositories that are meant to be open source and repositories that are proprietary. We have an internal tool that ask you to type a sentence the first time you push to open source for confirmation. But to make sure you actually type it in instead. The sentence you’re instructed to type in is lowercase. But the instructions tell you to type it in as uppercase.
- throwing_away 3y agoHyprland has: --i-am-really-stupid - Omits root user privileges check (why would you do that?)
- ianlevesque 3y agoSeen a few “_do_not_use_or_you_will_be_fired()” functions before too.
- vidarh 3y agoMySQL of course has (had? Not used it for an eternity) the --i-am-a-dummy flag, which felt like it should be reversed (it prevents update/delete without an explicit where clause, but would be more appropriate if you had to use it to allow them).
- 8n4vidtmkvmk 3y agoI'd assume fastConvert is less accurate. If it was both fast and perfect it'd just be 'convert'
- forty 3y agoFast doesn't always mean good. For example in cryptography a fonction named fastCompare could be a non constant time comparison which is faster but not safe for cryptography :D (though you'd probably want to name it unsafeButFastCompare I guess ^^)
- BoppreH 3y agoOr it only accepts certain inputs, or has an expensive first invocation but amortized cost, or is not bug-compatible with the old `convert`, or it requires a large cache, or it's optimized for parallelism, or uses instructions only available in newer CPUs, or it was a prototype that stuck around, or...