Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "bleach"
-
This code review gave me eye cancer.
So, first of all, let me apologize to anyone impacted by eye cancer, if that really is a thing... because that sounds absolutely horrible. But, believe me, this code was absolutely horrible, too.
I was asked to code review another team's script. I don't like reviewing code from other teams, as I'm pretty "intense" and a nit-picker -- my own team knows and expects this, but I tend to really piss off other people who don't expect my level of input on "what I really think" about their code...
So, I get this script to review. It's over 200 lines of bash (so right away, it's fair game for a boilerplate "this should be re-written in python" or similar reply)... but I dive in to see what they sent.
My eyes.
My eyes.
MY EYES.
So, I certainly cannot violate IP rules and post any of the actual code here (be thankful - be very thankful), but let me just say, I think it may be the worst code I've ever seen. And I've been coding and code-reviewing for upwards of 30 years now. And I've seen a LOT of bad code...
I imagine the author of this script was a rebellious teenager who found the google shell scripting style guide and screamed "YOU'RE NOT MY REAL DAD!" at it and then set out to flagrantly violate every single rule and suggestion in the most dramatic ways possible.
Then they found every other style guide they could, and violated all THOSE rules, too. Just because they were there.
Within the same script... within the SAME CODE BLOCK... 2-space indentation... 4-space indentation... 8-space indentation... TAB indentation... and (just to be complete) NO indentation (entire blocks of code within another function of conditional block, all left-justified, no indentation at all).
lowercase variable/function names, UPPERCASE names, underscore_separated_names, CamelCase names, and every permutation of those as well.
Comments? Not a single one to be found, aside from a 4-line stanza at the top, containing a brief description of that the script did and (to their shame), the name of the author. There were, however, ENTIRE BLOCKS of code commented out.
[ In the examples below, I've replaced indentation spacing with '-', as I couldn't get devrant to format the indentation in a way to suitably share my pain otherwise... ]
Within just a few lines of one another, functions defined as...
function somefunction {
----stuff
}
Another_Function() {
------------stuff
}
There were conditionals blocks in various forms, indentation be damned...
if [ ... ]; then
--stuff
fi
if [ ... ]
--then
----some_stuff
fi
if [ ... ]
then
----something
something_else
--another_thing
fi
And brilliantly un-reachable code blocks, like:
if [ -z "$SOME_VAR" ]; then
--SOME_VAR="blah"
fi
if [ -z "$SOME_VAR" ]
----then
----SOME_VAR="foo"
fi
if [ -z "$SOME_VAR" ]
--then
--echo "SOME_VAR must be set"
fi
Do you remember the classic "demo" programs people used to distribute (like back in the 90s) -- where the program had no real purpose other than to demonstrate various graphics, just for the sake of demonstrating graphics techniques? Or some of those really bad photo slideshows, were the person making the slideshow used EVERY transition possible (slide, wipe, cross-fade, shapes, spins, on and on)? All just for the sake of "showing off" what they could do with the software? I honestly felt like I was looking at some kind of perverse shell-script demo, where the author was trying to use every possible style or obscure syntax possible, just to do it.
But this was PRODUCTION CODE.
There was absolutely no consistency, even within 1-2 adjacent lines. There is no way to maintain this. It's nearly impossible even understand what it's trying to do. It was just pure insanity. Lines and lines of insanity.
I picture the author of this code as some sort of hybrid hipster-artist-goth-mental-patient, chain-smoking clove cigarettes in their office, flinging their own poo at their monitor, frothing at the mouth and screaming "I CODE MY TRUTH! THIS CODE IS MY ART! IT WILL NOT CONFORM TO YOUR WORLDLY STANDARDS!"
I gave up after the first 100 lines.
Gave up.
I washed my eyes out with bleach.
Then I contacted my HR hotline to see if our medical insurance covers eye cancer.32 -
My first post on devRant. Hope you like it (is a true story)
User : Hey, can you help me with this thumbdrive? Cannot open it
Me: Sure, let me see...
At this time I noticed that the drive was leaking something and smells funny also...
Me: Did you dropped it into water or something liquid?
User: Ehmm. Yes! Washed it with bleach!
Me: But why?
User : Oh! because of viruses.8 -
API Guy.
He has a serious regex problem.
Regexes are never easy to read, but the ones he uses just take the cake. They're either blatantly wrong, or totally over-engineered garbage that somehow still lacks basic functionality. I think "garbage" here is a little too nice, since you can tell what garbage actually is/was without studying it for five minutes.
In lieu of an actual rant (mostly because I'm overworked), I'll just leave a few samples here. I recommend readying some bleach before you continue reading.
Not a valid url name regex:
VALID_URL_NAME_REGEX = /\A[\w\-]+\Z/
Semi-decent email regex: (by far the best of the four)
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
Over-engineered mess that only works for (most) US numbers:
VALID_PHONE_REGEX = /1?\s*\W?\s*([2-9][0-8][0-9])\s*\W?\s*([2-9][0-9]{2})\s*\W?\s*([0-9]{4})(\se?x?t?(\d*))?/
and for the grand finale:
ZIP_CODE_REGEX = /(^\d{5}(-\d{4})?$)|(^[ABCEGHJKLMNPRSTVXY]{1}\d{1}[A-Z]{1} *\d{1}[A-Z]{1}\d{1}$)|GIR[ ]?0AA|((AB|AL|B|BA|BB|BD|BH|BL|BN|BR|BS|BT|CA|CB|CF|CH|CM|CO|CR|CT|CV|CW|DA|DD|DE|DG|DH|DL|DN|DT|DY|E|EC|EH|EN|EX|FK|FY|G|GL|GY|GU|HA|HD|HG|HP|HR|HS|HU|HX|IG|IM|IP|IV|JE|KA|KT|KW|KY|L|LA|LD|LE|LL|LN|LS|LU|M|ME|MK|ML|N|NE|NG|NN|NP|NR|NW|OL|OX|PA|PE|PH|PL|PO|PR|RG|RH|RM|S|SA|SE|SG|SK|SL|SM|SN|SO|SP|SR|SS|ST|SW|SY|TA|TD|TF|TN|TQ|TR|TS|TW|UB|W|WA|WC|WD|WF|WN|WR|WS|WV|YO|ZE)(\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}))|BFPO[ ]?\d{1,4}/
^ which, by the way, doesn't match e.g. Australian zip codes. That cost us quite a few sales. And yes, that is 512 characters long.47 -
Today I visited a partnered company, best summarized as "our people are the best at what they do, although we haven't figured out what it is that we do".
It was fucking awful.
Halfway a presentation about "capitalization on the internet of things" which featured nothing about hardware or protocols at all, a guy stood up and started talking about improvements on ecdsa and schnorr encryption or something... for no apparent reason. Then followed a bunch of pretty slides about the sharing economy... after which the CEO concluded with some vague speech about decentralized management of assets in a globalist world or whatever...
It was like a bunch of pretty smart people all had been locked up in some kind of closet with mirrors on the inside for six months, discussed their best ideas with their own reflections, then immediately grouped up and convinced an investor to fund their startup.
Ugh, I have to wash my ears and eyes with bleach. My brain is flooded with pretentious bullshit buzz and over the top startup decadence.
Actually, I think this sums it up best: There was a framed oil painting of the CEO with his dogs in the conference room, and the bathroom had a large marble Charizard statue watching me pee.8 -
Tomorrow Halloween is being celebrated in many nations as you might know. So we do in germany. Given that in Germany tomorrow is a national Holiday, the company skipped work today, with me being on call.
My On-Call time almost was over so I got ready to party (getting into my costume), not expecting any further calls.
I finished dressing up, still had some time, so I dug into coding a bit, as a costumer called. A customer from china. As I got told later on China does not celebrate Halloween in October and they do in another way.
So I set there, accepting the call, with my Camera set to autostart (Company policy).
Camera. On.
In. Costume.
As a monk.
With a bleach white face.
I was greeted by a man starring me "into the eyes". Took a good 1-3 secs til we bursted out in laugher. One of the funniest calls I had so far 😂 (and a short one, thanks China-Man)2 -
I need bleach...
Lot of bleach.
When you think that not using a JS framework is bad...
Ever saw a Frankenstein of a HTML, PHP and JQuery? Full rewrite of an old project with more than enough time allowed....
Just... That was not awful enough.
*sobs* so the dev added bootstrap onto this pile of garbage... Instead of rewrite....
Think I missed CSS or included it in HTML? Lol. No.
No CSS. Inline. HTML 4 Tags.
?>
<table width=40 class="table table-striped">
<?php
foreach( $table as $row ) {
....
<input onkeyup="..." onkeydown="..." class="form-control"
...
To give you a basic example of how worse it is...
But the best. The lead developer does not understand why I was speechless.
i need more beer. And bleach. Filth and disgust must get out of my system2 -
I just gave robocopy another try, in order to get my WanBLowS D: drive and my file server synchronized again, in preparation to move that file server VM to a LXC container instead.. bad choice. I should've used rsync in WSL.
Hey you Not so Robust File Copier for WanBLowS, how many attempts of you fucking up my file server's dotfiles does it take before I configure you right with every fucking option you have specified? How about you actually behave somewhat decently like rsync where -avz works 99% of the time, in local, remote, any scenarios that you can think of that aren't super obscure?! HOW DIFFICULT CAN IT BE, REDMOND CERTIFIED ENGANEERS?!!
Drown in a pond of bleach, Microshit certified MOTHERFUCKERS!!!!
Well, at least this time it didn't fuck up my .ssh directory so I can still authenticate to the VM.. so I guess that at least that's a win. Even that you can't take for granted anymore with this piece of garbage!!!4 -
If you ever get an idea for an OpenCV project: shoot yourself in the foot, drink some bleach, do whatever it takes to get it out of your head, because it will all be less painful than the python docs for cv2.3
-
A 27" monitor with a 1080p resolution is a match made in hell. Oh the eye bleach. (At home I got 30" with 2k or 1440p resolution. Much better viewing experience.)
I'm having my first day in the office in the new job after two week of remote work. I think I will prefer working from home office definitly (even though the office coffee machine is nice).
It doesn't help that the internet connection in the office is 100 Mbit and at home I have 1 Gbit.12 -
*posts some answers on Quora*
*gets flagged by moderator cunt for using my nickname, one that I've been using on that account for 3 years*
WELL THANK YOU QUORA FOR THE APPRECIATION!! I'll TOTALLY contribute some fucking more next time!!! You know what, whoever flagged my account? Exchange your lube for bleach, and go fuck yourself with a cactus. Don't forget to use the new lube! Pour it in that glory hole like there's no tomorrow! Fucking piece of shit.4 -
Not a dev related rant but more of a workplace rant.
I work in a business center with around 30 small offices. We share the common areas like kitchen, meeting rooms and bathroom.
Today, the cleaning lady told me to use the bathroom on the other side of the workplace because she spread bleach all over the men's restrooms floor.
The reason? Someone peed completely outside the toilet. I understand men can miss a couple of drops but a complete load? It's not the first time it has happened but I can only think he enjoys doing it.
I wish I had my own bathroom... -
Forgive me for I have sinned.
I feel like I need a bleach shower after having had to write these methods in my Dart codebase11 -
My boss just added a video about a product in a whatsapp group that has all employees asking everyone to spread it to your personal groups 'to promote it as much as possible'.
Well, fuck this shit their cringy-ass music video makes me want to bleach my eyes. And how does this fucker expects us to spread his cancer in our groups for his profit?
Also half of the people in the group are sucking his dick already with replies like "Sure ✌" and "OK sir!!! ".
Fuck you morons grow a spine and stop bending over so easily to make others happy. 😐1 -
Web security checklist:
https://troyhunt.com/reckon-youve-s...
Don't forget to bleach your eyes after reading...4 -
So I just saw a post on Facebook about a "Serverless Function as a Service on Kubernetes". Could someone give me eye bleach please?
I really can't wait after Scoped Storage and how goddamn slow it is, to have a "glorified microservice" take 5 minutes to spin up a container, just to do something silly like printing a hello world. In the post it was apparently showing a QR code.. that's it. A fucking QR code, because remember it's just a function.
A whole fucking operating system that goes up and back down, just to run a goddamn fucking function!!!8 -
Django devs, prepare your eye bleach:
(I love that this is possible, but I really don't trust myself to wield the power of making things mutable at will...)7 -
Me: Ok it looks like Gamemaker will never come to linux and I can't get it running under wine... Suppose it wont hurt to learn monogame while I have Linux, Mac and windows to hand...
*Googles tutorials*
Me: Oh god there is fuck all, it just points to XNA stuff... Oh look a tutorial for monogame itself!
*Notices its an official Microsoft tutorial*
Me: Swallow your pride Alex... Go to the dark side and use a Microsoft product willingly...
... I feel dirty... As if i should have a bleach bath...2 -
I started using Keepass like 2 months ago, and recently i started going through all my email accounts to compile a list of all the services i've ever signed up to; delete the accounts you don't need and move everything else to keepass with a strong passwd, that was the plan.
I'm still going, but out of the 60 i have so far, 10 sites just had the password, *in plain text*, in the confirmation email!! I don't even konw anymore, just end me now plz 😢7 -
😤
When you make a simple call to customer service but you end up rambling to the poor rep on the other end for nearly an hour...
By the end couldn't tell if she wanted to laugh, cry, or just drink a pint of bleach. -
That moment when js is like: bro wtf are doing? You don't declare variables types here.
then you're like: wtf this is right, it works. until you look at the js console and you grab a cup of bleach. -
I am put to the task of creating a Chat Robot in ChatFuel.
Cool, I thought at first.
Cool is not what I would call it at this point..one week later.
The size is a factor at play, for sure, it needs to point to 27 cities and give individual information, handle e-mails, phone, automate e-mails.. a bunch of stuff.
Now, I am located in Sweden.
{{city}} as a set user attribute acknowledges Gothenburg and geolocation thusly worked fine for my boss. But not for me, and won't work for any other city.
So..Global AI calling for static blocks it is... 27 blocks...
For two languages.. 54 blocks...
Static pointing to the first answer for every individual block multiplies this by a factor of two. 108 static blocks. Fine.
I have since realized that my ChatFuel-Luddite ways were limiting the expected performance of the end result and learned that most other set attributes in ChatFuel work fine. Yay.
So we set up everything the last 54 blocks need to do with user attributes and to my surprise it works, really well at that. The answer from a user that is a correct city puts you into a block that is a series of questions using user attributes, both {{first_name}} and {{last_name}}, asks for e-mail and phone, displays an image and stuff like that.
Now.. as I attempt to copy these blocks..
THEY JUST POOP OUT CHUNKS OF THE ORIGINAL BLOCK. IT'S INCONSISTENCY IS STAGGERING. IT NEVER REALLY COMPLETES THE DUPLICATION, NO ERROR MESSAGE OR ANYTHING.
Which then reminded me of when my boss asked why everything was botched earlier in the project, at that point I copied the entire bot as a fallback and worked with my change in the copy first for safety reasons, didn't work, copy wasn't entire.
Wasted fucking hours on this.
I'm glad my boss is cool, and the job is easily worth it. I actually think that the design aspect of ChatFuel is nice, and the people behind it are kind in the facebook group and all. I don't think they're trying to be mean. But holy shit.
This has been a mental anguish that levels pissing bleach filled with fire ants.
" You could've easily solved this with APIs and third-party geofencing services ", yeah, but their services won't stack for the customer, nice attempt though.
Deep breaths.1 -
When dogecoin went out, I was a little curious kid. I knew small to nothing about cryptocurrencies, so I started mining some for the lulz on my shitty laptop. Holy fuck no one was using and mining this shit, so I was earning 500-600 DC by night. I did it for a few weeks, let the miner running when I was at highschool.
I stopped after one month since its value was inferior to the used electricity cost.
From time to time, I remember about this story about a 70000+ dogecoins, and I instantly want to chop my balls off and put some super strength bleach on the wounds while slapping myself with spiky plants.
I lost the wallet.1 -
i feel like drinking bleach, i cant program because i have exams!!, but i get side tracked from revision and start messing around with linux😢😂1
-
If this codebase were a small child, it'd be the dim one that can't stop licking the windows and starts chugging bleach should you be so foolish as to turn a blind eye
-
!rant
wow... so just finished watching the last episode of Naruto...
I haven't watched though since they beat that final boss thing, thought it was all filler/side stories like Bleach... But yea, did I miss anything good? Was there a build up to the final ep?1 -
so we are having a campus recruitment at college. So there's a company that came in campus . The first step was to register on their website however their website is so shitty that they have specified that their Website is working just on Chrome and IE and not on Firefox . I was like what kind of developer support IE over Firefox really on top my friends who were applying at this company spend over 5 hrs just to register and the worst part @ 9 their server crashed . I would rather drink bleach than joining such a company1
-
Update on this;
https://devrant.com/rants/5967284/...
Since Saturday morning my throat has been feeling like I’ve chugged bleach. My eardrums feel like they’re gonna pop at any moment. I just got home from a doctors appointment. I have fucking covid. I have so little covid specific symptoms that I almost didn’t get tested, doc only tested on a hunch. The only time I’m around people without a mask is at the office so someone at work must have given me the big-sick. If it wasn’t for the vaxx it probably would have been in my lungs by now.
Imagine being such a loser that you get covid this late in the damn game. Goddamnit6 -
I’m done with people who claim they don’t have time to do something.
Constantly hearing people complain they don’t have time to do things, oh fuck off you cunt. You work a nine to five, you get home at half five and you sit at home doing fuck all while you complain that things aren’t going your way.
Doesn’t even have to be about developing, lost count with the amount of people who claim they don’t have time to go the gym. Dickhead, you have a 24 hour gym three minutes away from your house. You could go after work, instead you’ll sit on your ass, eat a load shit and then complain you’ve put on weight.
If you’re doing fuck all to make things happen then you lose the right to complain about your circumstances. Stop blaming other people for your fuck ups because you ‘don’t have time’ to get shit done you absolutely holocaust of a human being.
While I’m at, fuck people who think it’s my soul mission in life to fix their shit, believe it or not I don’t give two flying fucks about your circumstances if you’re doing fuck all to help yourself.
Do me a favour and kindly drink some bleach.13 -
Microsoft understands we're pissed about low QA performance on updates. They're gonna bleach the Start menu and add a couple more buttons to the UI. https://theverge.com/2020/7/...10