Is it safe to use __secret_internals_do_not_use_or_you_will_be_fired?
github.com
github.com
1. What should the API for PutMetricData look like?
2. Where should we store that data?
(you know, minor issues)
At the time, we decided that #1 was more critical than #2 (and of course #2 depends deeply on the answer to #1), and that the best way to solve it would be to do some learning-by-prototyping - stand up an internal version of CloudWatch to dogfood with some other Amazon services and be able to go to prospective internal customers with a "working" service that they could kick the tires on, not just some API docs and paper prototypes. So I quickly hacked up an implementation of "GraniteDataStore" called "InMemoryDataStore", which would store every PutMetricData request in a HashMap and nowhere else.
When I sent the code out for peer review, my reviewer was aghast at the idea that we would stand up a service that would knowingly store different copies of the data on every server, and lose it all on process restart. I responded by renaming InMemoryDataStore to FakeInMemoryDataStore, but that wasn't enough. Finally, we settled on a name of (if memory serves) FakeFakeFakeDataStoreThatLosesAllYourData and that was enough to get my merge approved.
I went off to do something else for a few months, came back, and found that script being run in a Cron job, with that flag hard-coded set. Sometimes even your clearest "watch out, do this thing!" naming won't do any good.
(I guess the takeaway from this is that the manual oncall diary wasn't all that important. Which was something I questioned at the initial requirements gathering, but ¯\_(ツ)_/¯ )
---
btw, _thank you_ (and your team) for CloudWatch. It's great, and I am continually frustrated by teams that ingest events, process them, and emit calculated metrics to PMET, rather than just logging and letting Log Insights figure it out. The extra overhead to change PMET-emission code every time we want to investigate some new measure is such a waste.
> InMemoryDataStore
This...is just how in-memory data stores work, right? That's what "in-memory* means? Or am I missing something obvious?
Obviously, there's no replication/transaction processing occurring when you're just storing stuff in an ordinary hashmap. Hence the Fake* naming.
So it is fake, so that means that it does Not lose all your data. Did I got that right?
I will just use it as a temporal solution and remember to change it later.
(FakeDataStoreThatLosesAllYourData) = A datastore that loses everything
[Fake(FakeDataStoreThatLosesAllYourData)] = A fake (FakeDataStoreThatLosesAllYourData) that does not lose all your data
Fake[Fake(FakeDataStoreThatLosesAllYourData)] = A fake [Fake(FakeDataStoreThatLosesAllYourData)] that loses all data.
Perfect name!
int __THIS_IS_NOT_A_PLACE_OF_HONOR()
# no highly esteemed deed is commemorated here.
# nothing valued is here.
# What is here was dangerous and repulsive to us.
# This message is a warning about danger.
# The danger is still present, in your time, as it was in ours.[1]: https://en.wikipedia.org/wiki/Long-time_nuclear_waste_warnin...
Nuclear waste that stays radioactive for ten thousand years has an interesting design problem: how do you create a warning that people will understand after that much time has passed? A committee was created to study this problem, and one of the outcomes was formulating what message should be communicated. The above is that message.
The next step is figuring how to communicate that message in a language-agnostic and culture-agonistic medium.
1. We have one group of people looking to how to protect the people of the far distant future from a localized, deadly problem
2. Society, as a whole, seems against even caring if people 50 years from now have a habitable plant.
I believe that future will come long before warnings in today's languages become unintelligible.
If there's some kind of apocalypse where science gets a hard reset, then sealed up nuclear waste is probably very low on the list of realistic and dangerous threats.
Optimistic. My turn: The future will bring technology to make spiders talk to cats. Prove me wrong!
> If there's some kind of apocalypse where science gets a hard reset, then sealed up nuclear waste is probably very low on the list of realistic and dangerous threats.
Nuclear waste might be relatively low in the immediate time frame after a science-resetting apocalypse, but the societies emerging afterwards will probably appreciate having a warning before they build their new settlements and water wells on a nuclear waste site. Especially if that nominally sealed site seeps out radioactive sludge due to critical containment failure only long after the settlement was established.
97% of the energy in nuclear fuel is currently wasted.
Robbers, raiders, and treasure hunters would still go in.
It implies danger of another human, who is likely now dead.
It's iconic enough that Facebook HQ has a conference room by that name.
Getting OT, but I worked somewhere where the conference rooms were named after birds of prey (Eagle, kestrel, etc etc). The smokers' room was informally known as 'Puffin'
I decided to stop smoking the day Jerry Yang held the door open for me and my band of misfits on our way to the outside smoking area. David Filo once asked me if he could share the panini station I was presently occupying in the cafeteria, URL's. I answered affirmatively but subsequently wished I had uttered "it would be an honor."
Do you remember the brief period around 2010 where people were vaping at their desks all day in normal office buildings?
It was approx 30 years ago in the UK. There’s no way such a room would exist now.
It was way before my time, but I found it hilarious so I did some digging.
https://hackage.haskell.org/package/bytestring-0.11.2.0/docs...
> The carcass of many a seasoned Haskell programmer lie strewn at its feet.
the docs are genuinely entertaining.
-----
-- STOP. YES, YOU.
--
-- THIS CODE IS A PROOF OF CONCEPT THAT DOES HORRIBLE THINGS TO THE PLATFORM.
-- THE FACT THAT IT WORKS AT ALL IS VERY VERY BAD.
--
-- DO NOT RUN THIS IN PRODUCTION. IF YOU DO, I WILL KNOW, AND I WILL FIND YOU.
----- +-----------------------------------------------------------------------------+
| You are entering the operating system shell. By confirming this action in |
| the appliance shell you have agreed that THIS ACTION MAY VOID ANY SUPPORT |
| AGREEMENT. If you do not agree to this -- or do not otherwise understand |
| what you are doing -- you should type "exit" at the shell prompt. EVERY |
| COMMAND THAT YOU EXECUTE HERE IS AUDITED, and support personnel may use |
| this audit trail to substantiate invalidating your support contract. The |
| operating system shell is NOT a supported mechanism for managing this |
| appliance, and COMMANDS EXECUTED HERE MAY DO IRREPARABLE HARM. |
| |
| NOTHING SHOULD BE ATTEMPTED HERE BY UNTRAINED SUPPORT PERSONNEL UNDER ANY |
| CIRCUMSTANCES. This appliance is a non-traditional operating system |
| environment, and expertise in a traditional operating system environment |
| in NO WAY constitutes training for supporting this appliance. THOSE WITH |
| EXPERTISE IN OTHER SYSTEMS -- HOWEVER SUPERFICIALLY SIMILAR -- ARE MORE |
| LIKELY TO MISTAKENLY EXECUTE OPERATIONS HERE THAT WILL DO IRREPARABLE |
| HARM. Unless you have been explicitly trained on supporting this |
| appliance via the operating system shell, you should immediately return |
| to the appliance shell. |
| |
| Type "exit" now to return to the appliance shell. |
+-----------------------------------------------------------------------------+
I like how it explicitly says "no, seriously, Mister Unix Wizard, we mean YOU."Sending this message was important to us. We considered ourselves to be a powerful culture.
This place is not a place of honor... no highly esteemed deed is commemorated here... nothing valued is here.
What is here was dangerous and repulsive to us. This message is a warning about danger.
The danger is in a particular location... it increases towards a center... the center of danger is here... of a particular size and shape, and below us.
The danger is still present, in your time, as it was in ours.
The danger is to the body, and it can kill.
The form of the danger is an emanation of energy.
The danger is unleashed only if you substantially disturb this place physically. This place is best shunned and left uninhabited.
For reference, the message parent quoted is a Long-time nuclear waste warning message:
https://en.wikipedia.org/wiki/Long-time_nuclear_waste_warnin...
Otherwise, "curse of the mummy? LOL, yeah, I'm sure that's a real thing. Must be something great buried here. Watch out for actual traps, but we're about to get rich, boys!"
This is pretty well guaranteed if they can read your message at all.
Though maybe there's only a brief window of development in which a culture is both not superstitious enough to be scared by this, and also lacks the technology & knowledge to figure out what you actually mean and verify it themselves.
- A descendant language had been preserved in the Coptic Bible.
- The Rosetta Stone provided a parallel text between Egyptian and Greek, and Greek was well understood.
But the ability to read Greek gave us more than just an understanding of what the Rosetta Stone said. The Greeks wrote a lot about Egypt, too.
I’m not saying the experts did a bad job at all. This is probably about the best you could do to communicate with a culture of unknown technological complexity, far off into the future. I’m just saying, as good as it might be, this communication is likely still pretty imperfect :)
In a way that is true. You could in principle use the radiation from nuclear waste to do useful work (like generate electricity), but our sages haven't figured out a way to do so in a way that makes economic sense to us. The waste could be useful to a different civilization with better technology or worse natural resources.
"A terrible sickness is contained underground. It kills all who come close. We have done our best to contain it so it does not kill you, our children. We have hidden it. It is very deep. You are safe if you do not dig."
I really really want an Oxide. Sadly it doesn't solve any problem we have, but ... man, so cool. Great work.
"DO NOT ATTEMPT TO OPTIMIZE OR REFACTOR THIS CODE.
When you ignore this warning and fail, increment this tally mark: IIII" //
// Dear maintainer:
//
// Once you are done trying to 'optimize' this routine,
// and have realized what a terrible mistake that was,
// please increment the following counter as a warning
// to the next guy:
//
// total_hours_wasted_here = 25
//Is the code still in use?
If there are lessons written in blood for the development of safety-critical software, they haven't propagated to the wider field of software development.
(Disclaimer: I don't work on safety-critical software.)
1: https://www.csoonline.com/article/3404528/8-famous-software-...
I can think of at least three NASA missions that resulted in deaths: Apollo 1[1], and the Challenger[2] and Columbia[3] space shuttles.
[1] https://en.wikipedia.org/wiki/Apollo_1
[2] https://en.wikipedia.org/wiki/Space_Shuttle_Challenger_disas...
[3] https://en.wikipedia.org/wiki/Space_Shuttle_Columbia_disaste...
Seems like half the time it's the blood of the lobbyist or spook who didn't realize how heavy that suitcase full of benjamins was and the other half of the time it's the blood of whoever got trampeled when the moral panic turned into a moral stampede.
Cheap quips like "regulations are written in blood" are just high brow ways of saying "because I said so".
As the top level commenter points out, these sorts of messages coming from untrustworthy entities who's best interest only aligns with yours in passing are not held in high regard unless they come with some sort of justification since the entities in question (be they oracle or the EPA) do not have the reputation for honesty that they can rely on. If there's really a hazard, communicate the hazard and don't lie about it. The vast majority of the regulation of which you speak is far closer to the "no user serviceable parts inside" end of the spectrum than the "warning, landmines" end and that is why it's not taken seriously.
That makes sense as they're the folks who will get in trouble.
Rando person probably turns back at this point "nope this isn't what I wanted".
Guy who thinks he knows better is the one who keeps going and freaks out when it hits the fan.
After 10+ years of doing qa on the ZFS appliance I completely ignored the warning and you could have slipped anything past me in the text.
No need for a “security” team to lock away access from you, a very stern warning will do.
Dell Compellent has a similar thing. Theirs is hidden behind the super seekrit password "SuPpOrt"...
When I worked support for networking equipment every device had potentially multiple shells or APIs hidden that allowed you to do stuff that really only the engineers who made the thing should do / direct someone to do it.
I often walked trustworthy customers through using them as they knew if they did it then it was on them.
That is, is there any chance that they can remove it from the hand of users without damaging the usability of that piece of software. The other commenters mentioned that support engineers may use it, so that answered my question.
+-----------------------------------------------------------------------------+
| You are entering the operating system shell. By confirming this action in |
| the appliance shell you have agreed that THIS ACTION MAY VOID ANY SUPPORT |
| AGREEMENT. If you do not agree to this -- or do not otherwise understand |
| what you are doing -- you should type "exit" at the shell prompt. EVERY |
| COMMAND THAT YOU EXECUTE HERE IS AUDITED, and support personnel may use |
| this audit trail to substantiate invalidating your support contract. The |
| operating system shell is NOT a supported mechanism for managing this |
| appliance, and COMMANDS EXECUTED HERE MAY DO IRREPARABLE HARM. |
| |
| NOTHING SHOULD BE ATTEMPTED HERE BY UNTRAINED SUPPORT PERSONNEL UNDER ANY |
| CIRCUMSTANCES. This appliance is a non-traditional operating system |
| environment, and expertise in a traditional operating system environment |
| in NO WAY constitutes training for supporting this appliance. THOSE WITH |
| EXPERTISE IN OTHER SYSTEMS -- HOWEVER SUPERFICIALLY SIMILAR -- ARE MORE |
| LIKELY TO MISTAKENLY EXECUTE OPERATIONS HERE THAT WILL DO IRREPARABLE |
| HARM. Unless you have been explicitly trained on supporting this |
| appliance via the operating system shell, you should immediately return |
| to the appliance shell. |
| |
| Type "exit" now to return to the appliance shell. |
+-----------------------------------------------------------------------------+
Cleaned up formattingEDIT: Ah, I see you claimed authorship in a comment below.
For a larger, widely used project, the question isn't "why" make something internal, but "why not". The safe default is to not semi-permanently commit every half baked bit of code to the public stable semvered API boundary to support for who knows how many years, but to only do so after careful consideration and justification.
To add this disclaimer to every single bit of internal code is to drown your codebase in a sea of redundant comments - none of which are specific to the code, or even the codebase, but are instead rehashing "why encapsulation?" 101. This will only train readers of your code to ignore the low-value low-signal comments, and they will then end up asking the same question anyways, and "read the comment that's right there!!!111oneoneone" will be a fustrating experience for everyone, although they might not be able to articulate why.
The real question I'm curious about here isn't "why are internal things internal" - but why this internal thing must technically be public. Does this predate ES6 symbols? Is there a plan to switch to those at some point in the future? Is there a tracking issue? Or does this need to be accessed from elsewhere in a manner that makes Symbols awkward to use? Where?
var React = (function(){
var React = {};
var __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {};
...code extending/using React etc...
return React;
})();
// accessible: React.whatever
// inaccessible: __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
However, there's always caveats where language level access controls don't let you quite express the access restriction you want. Perhaps you want to expose something to other official modules from the same constillation of libraries, for example (meaning you wouldn't be able to use Go's "internal"), without comitting to supporting the semver contract for any other arbitrary user of your API (meaning you might resort to similarly scary names.)And whoever says something about instability or APIs being subject to change without notice - they're wrong because those are Go git repos and one can always pin to an old tag or even a commit SHA.
If something is unusable (too specific, too fragile, too flaky), no one would use that anyway. A warning is fine and even welcomed, but a block is a slap in the face.
Fortunately they're free to rename it in their next release.
Perhaps something snappy like __secret_internals_do_not_use_or_version_specific_retribution_will_follow_possibly_including_firing
> at one point one of my teammates who is usually very calm and composed deleted some of the internals to “send a message”, which was reverted the next day because it broke a bunch of things for different teams. we didn’t do this again but this started a conversation
Oof. I worked with some people who would declare things deprecated, not discuss the deprecation with anyone, and then remove the deprecated code a short while later even if it was still working just fine.
Same logic: They wanted to "send a message". And it sucked for everyone. Many meetings were had and we usually had to get management to force them to put the (still working) code back and coordinate with other teams on a deprecation schedule.
Please don't force-deprecate things within a company to "send a message" like this. (Note: It wasn't Dan Abramov who did this)
We had a deprecated server that we wanted to decommission. We announced this to the entire company. We pointed everyone to the new server, and asked for feedback if it couldn't fulfill any needs that the previous one did not &c. &c. We announced the date the server was going down. We inspected logs and guessed who might still be using it from IP addresses (one of the many reasons for wanting to deprecate the server was there was a single shared login for everyone using it :/)
Finally, on the announced date, we just unplugged the Ethernet cable and got contacted by several different people freaking out, wanting to know what happened to the server. We (as planned) plugged the cable back in and then asked them the same questions that had gone out globally. A month later the server was finally offline for good.
One way of interpreting this is that we unplugged the cable to "send a message" but we obviously did discuss the deprecation with lots of people ahead of time.
In contrast, this is about internals, stuff that was never part of a contract but that people use anyway. It comes up a lot in JS because the language doesn't enforce privacy. And it's super painful to not be able to change stuff you never made part of a contract--it freezes your whole codebase.
Is changing internals other people have come to depend on a good idea? Depends on a ton of context, but you should strive for a technical culture that allows this.
When we're deprecating things, we normally keep them for years. In this case, this was not about a deprecation. It's about a case where internal properties were used with a clear agreement with our team that they are not supported, we will remove them without warning, and that the consuming code should always be ready for them to be removed.
When my coworker removed them, he didn’t “just” delete them but he shimmed it so that the consuming code would not crash (but also would not get the functionality). That’s the agreement we had with the teams when these dependencies were added.
The “sending a message” part was that despite our initial agreement, the features were nevertheless being depended on more seriously, and it wasn’t until after this incident that the severity was understood.
Similarly here, if you need to make sure nobody's depending on this thing, change its name regularly. Append a random number to the end of it and change it with each minor release or something.
Now, what you do NOT want to do is randomly pull the plug on your service or change the internals exactly once, with no notice, after a long time of stability. That's not helping people know not to rely on it; that's just hurting people who didn't read the sign. Quietly putting up a "deprecated" sign without ensuring people have time or opportunity to read it, waiting an unreasonably short time, and then breaking things is basically a Douglas Adams storyline more than a development practice.
I would love to know what problem they are solving. Whenever you start fighting the framework, you should back up and look for a different approach.
https://www.oracle.com/java/technologies/faq-sun-packages.ht...
> As if it were a swarm of bees, you should stay away from the SyncServices folder. Removing or modifying anything in the SyncServices folder - or in any subfolders within it - may cause unexpected issues.
https://web.archive.org/web/20140228032449/http://support.ap...
I really don't want to put the question-asker on blast, because software is hard, and sometimes you're trapped in a quagmire and just need to fire out a question, but I'm not sure how many ways there are to respond to 'is it safe to push the button labeled "don't push this button, it's unsafe to push it, it's bad to push it, please don't push it, dear God just don't"?' Time is finite and some questions just aren't very good questions.
When I feel the need to contact developers about their code, I tend to think long and hard about whether them responding to my question is a good use of their time. I feel very uncomfortable making requests of others' time frivolously, and asking "is it safe to use this field in production?" would have made me feel as if I was making a fairly brazen demand to address what is ultimately a self-answering question. I probably would have spent some time thinking "is there something different and more useful that I can ask instead?"
In this regard, Dan Ambramov did a good job, as far as I can tell, of iterating and eliciting a useful, actionable feature request from the question-asker. He converted what could have been a negative interaction for both parties into something that potentially improves the project, and it's hard to ask for too much more.
I don't use React and I've never come across your name before today, so I think I'm a fairly objective observer. I would prefer that more people wrote like you do - clear, concise and to the point.
I much prefer the Russian approach. We are professionals doing professional work, our feelings are not part of it and if your ego matters to you that's your own problem. It is objectively stupid to use something named __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED because, even if it works, you're not meant to use it! And they made it very, very, unmistakably clear. Dan did the right thing by not budging.
I didn’t get the impression from the reader that they were a beginner, or someone struggling, or someone who doesn’t “know they’re on the wrong path”. My impression was that a professional came to get an authoritative answer on a level of support of an API, and I tried to provide it.
I'm not sure it's wrong in this case specifically, because an answer to a question like "can I stick my fingers into a power socket" shouldn't be "I'm not sure it's a good idea and we don't support it, but you be you", it should be more like "hey, don't do it, you'll die".
This never crashed the program because Windows 3.x was more like a graphical shell on top of DOS. It wasn't a true multi-user or multi-tasking operating system. If you released memory, there wasn't anything else waiting to grab it from you. So the fact that you shouldn't read memory that's been freed, it went unnoticed.
Until they tried to run it on Windows 95. Then it would crash. A lot. The game was unplayable. Because Windows 95 was a multi-tasking operating system and it would reallocate freed memory to other programs that may ask for it.
So they put a specific check in Windows 95 to see if Sim City is running. And if it was, they essentially sandboxed its memory so nothing else could grab any memory it used.
While in this case, this isn't an example of a bug that was intentionally left in, it is an example of code written into an operating system to handle the bug of a single program.
But that's how they'd handle it. If PROGRAM X required certain behavior, they'd check to see if that program was running and alter behavior so the program would run. If feels like that's like half of what the registry is for.
http://ptgmedia.pearsoncmg.com/images/9780321440303/samplech...
https://genius.com/Weird-al-yankovic-dare-to-be-stupid-lyric...
I wouldn't do that, there isn't enough space in there for your hand, a lemon seed is really small, and you will probably lose one or more of your fingers.
> Okay, but I have pretty small hands, and I take ninjitsu classes at the Y, I'm pretty sure I can do it.
Do you like the nickname "Lefty"?
About one person per month has a reportable injury due to an unfortunate encounter with a garbage disposal. Most years no one gets their fingers mangled. Also, they don't grind your hand to a bloody stump like you'd imagine from horror novels and movies.
The overwhelming majority of these injuries involve fishing broken glass out by hand. A significant minority of them involve dropping the disposal on oneself while installing or removing one.
So no, they're not "perfectly safe" with the power turned off.
You can figure out the analogy here for yourself.
Doubly so if you are reaching for broken glass somewhere where you can't see, that's basically negligence, but still independent of what else that place could do. I just wonder if it would really be different if it was glass in just a pipe without a garbage disposal.
You are not right (see the detailed sibling comment to your claim to rightness), and either you didn't understand what the original poster actually wrote or you decided to reply to them but say something that's at best tangentially related to their comment and at worst is a pedantic assault on a strawman.
Hence, peak HN.
... actually, "but I'm right!" with no evidence supplied for the assertion might be peak HN.
It is safe to put your hand in a garbage disposal when the power is off! This comment clearly is talking about the safety of your hand from the dangers of a powered-on garbage disposal. The other comment about dropping a garbage dispoal on your foot? no, that does not apply...
> The overwhelming majority of these injuries involve fishing broken glass out by hand.
That is injuring the hand by sticking it in a powered-off garbage disposal.
The comment which was being replied to talked about the garbage disposal eating the hand. It is possible in any situation to invent other branching scenarios based upon word play off the original intent.
Just look at what started it:
> I'd like to put my hand in the disposal and turn it on
so I can catch the lemon seed that's stuck down there
and pull it out.
I wouldn't do that, there isn't enough space in there for
your hand, a lemon seed is really small, and you will
probably lose one or more of your fingers.
That has nothing to do with glass being in the sink, dropping things on your foot, or any other made up scenario.The sibling comment refuted the idea that it's perfectly safe to stick your in a powered-off disposal, which was the made-up idea in response to the original post introducing the disposal metaphor.