4 ms·
good ethics, bad data handling practices. <?php if (! $isProd) { showMixedFruit(); } Also, the code should not be allowed to run on a prod instance,
by avg_dev 4y ago
good ethics, bad data handling practices.
<?php
if (! $isProd) {
showMixedFruit();
}
Also, the code should not be allowed to run on a prod instance, even if it is triggered there.
But, I'm sure you've figured this all out by now.
- a4isms 4y agoIf you want to point out that I could have been even smarter thirty-plus years ago, the line forms to the left... Stretches down the block... Goes around the corner... &c. But while my memory is imperfect, I believe that I hardcoded that feature to only work when running on my personal Mac SE/30, and also changed the feature/name to have a tossed salad metaphor.
- btilly 4y agoSorry, that code is strictly worse. Because while the website on the laptop looks fine, there is a database on the laptop which has all the sensitive information. Anyone with access to the laptop just makes a backup of that database and the damage is done.
- avg_dev 4y agoIt's hard for me to say whether you are correct or not; I was under the impression that the data was updated on the DB instance, and in that case I stand by what I said (the prod data would end up on the laptop, but then as soon as the command was run, it would get permanently obfuscated). If the data was just obfuscated on screen, then yes, perhaps you are correct. Something I have seen done before that I thought was good was that every so often a production database was synced, but during the sync process, things that could identify a customer were redacted or obfuscated. Then almost anyone who had need to work with production data would use the munged version.
- a4isms 4y agoNot that it matters greatly, but FYI this app ran on a product called 4th Dimension, a 4GL app-building environment running a proprietary database on Macintosh desktop systems. They also had a client-server version that ran on local networks. There was a runtime engine, or for big money you could buy a compiler that would build standalone executables. They eventually pivoted to supporting the web (and PHP!), but this story predates all of that. 4th Dimension was orginally called "Silver Surfer," and it is the centerpiece of a story Guy Kawasaki used to tell about how big companies work. Apple was trying to get everyone to write software for the new Macintosh, they gave free hardware and engineering support to Ashton-Tate to port its popular PC database to Mac, &c. Meanwhile, indie companies like Aldus (who would go on to literally rescue Apple when they released PageMaker) and ACIUS (A company Guy formed in partnership with the original developer to distribute 4th Dimension) shipped software that people actually bought and actually used. https://en.wikipedia.org/wiki/4th_Dimension_(software) https://en.wikipedia.org/wiki/4th_Dimension_(software) Apple would have done better if they'd told people like Ashton-Tate to "Ship or GTFO," but the history of technology companies is one of people skating to where the puck has been...
- btilly 4y agoLet's go back to https://news.ycombinator.com/item?id=35473227 https://news.ycombinator.com/item?id=35473227 and see what was said. > ...I would copy their db onto my Mac, run the mongler on it, and then I would take the database home with me, without worrying whether the theft of my Mac could lead to lives being ruined. From that, it was definitely run against a copy of the database. The code that you showed looks like PHP display code. So it will change what is shown to the user, but unless showMixedFruit is horribly misnamed, will not change what is in the database. And therefore does not address the problem that the mongler was trying to solve.
- avg_dev 4y agoThat was implicitly intended to be part of menu template code, so it would show the “Mixed Fruit” option only if it wasn’t prod, and as I tried to suggest in my comment, such code would not execute on prod (the endpoint/backend code would abort if it found itself running in prod). (And the mixed fruit code would, in fact, affect data in the DB). Tbh I think this discussion is less than pointless.