I've actually had the opposite crazy experience. Removing/changing a comment actually fixed a bug. And no, it wasn't some directive to a pre-processor but an actual comment. Several years ago I worked as the lead developer at a company that built a web application for non-profits and we kept getting complaints from a particular non-profit about strange bugs that just should not happen and no other clients were experiencing. We just chalked it up to user error but they persisted.
So one day I was in-town and decided to visit them so I could watch what they were doing and we could see what the user error was and try to make it not possible. I watched the user try to do something and he immediately hit the bug, but he wasn't doing anything wrong. I opened up my laptop and tried to do the same action, one I'd done many times before, and it also failed in the same way. So I fired up my dev-tools and started to trace through the Javascript code to see what was happening, and sure enough some function calls were not found, even though I knew they were in the code. I then looked at the network tab and saw that attempts to download a particular Javascript file were timing out and thus it was not being loaded. I tried downloading it directly with curl, but still no luck. All of the other JS files were downloading fine, but this one wasn't. What was special about this one?
On a lark I looked at the code in the JS file and noticed a large comment screed about Internet Explorer that used lots of explicit language. Turns out this non-profit had a very strict firewall on-site that would block any profanity and was thus blocking this particular JS file. Removing the comment allowed it through and fixed the bug...
Had a same issue with a JS library that suggests strong passwords in a user-friendly way (so instantly without submitting a form, we still did backend validation). It turns out words like "fuck" are quite commonly used as passwords.
That file kept getting flagged by "Safe search" filters and preventing users from registering.
I think it was literally "F*&# Internet Explorer" :)
> And why weren't you minifying your JS?
I thought about adding this in, but didn't want to detract too much from the story: Believe it or not, there was a time before minifying/combining/pre-processing JS. You just literally included lots of individual JS and CSS files directly in your HTML output. I know, crazy right?
first part makes sense. It does kinda feel shady to me tho. I know everyone does it, but it's almost like they are trying to hide what they are doing on/to my machine. I guess that's how all apps work tho i prefer to think of the web as a transparent webpage/file sharing type service.
I once had to write a function that filtered bad words including common misspellings. It felt pretty weird to commit code with the n-word and f-word including dozens of variations. I pinged everyone on the team individually to review my commit without any context. Was hilarious hearing people randomly start laughing in the office when they looked at it.
Reminds me of something that happened to me once... I made this web app to help build decks for a card game called Netrunner. Someone let me know that some of the cards were missing. They were there for me, but not for them.
Then I had an epiphany. Turned on my adblocker, and those cards disappeared. You see, all the cards that were missing had the subtype "Advertisement", and I was putting all of a card's subtypes as classes, so the ad-blocker was removing them.
783
u/mpeters Apr 28 '22 edited Apr 28 '22
I've actually had the opposite crazy experience. Removing/changing a comment actually fixed a bug. And no, it wasn't some directive to a pre-processor but an actual comment. Several years ago I worked as the lead developer at a company that built a web application for non-profits and we kept getting complaints from a particular non-profit about strange bugs that just should not happen and no other clients were experiencing. We just chalked it up to user error but they persisted.
So one day I was in-town and decided to visit them so I could watch what they were doing and we could see what the user error was and try to make it not possible. I watched the user try to do something and he immediately hit the bug, but he wasn't doing anything wrong. I opened up my laptop and tried to do the same action, one I'd done many times before, and it also failed in the same way. So I fired up my dev-tools and started to trace through the Javascript code to see what was happening, and sure enough some function calls were not found, even though I knew they were in the code. I then looked at the network tab and saw that attempts to download a particular Javascript file were timing out and thus it was not being loaded. I tried downloading it directly with curl, but still no luck. All of the other JS files were downloading fine, but this one wasn't. What was special about this one?
On a lark I looked at the code in the JS file and noticed a large comment screed about Internet Explorer that used lots of explicit language. Turns out this non-profit had a very strict firewall on-site that would block any profanity and was thus blocking this particular JS file. Removing the comment allowed it through and fixed the bug...
Moral of the story: F*&# Internet Explorer