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 - "eye cancer"
-
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 -
Hi guys. This is my first ever post so just wanted to introduce myself and say hi. It's really nice to be a part of your community and I will look forward to laughing my @ss of at all your posts.
Here is a pic of my coding/ gaming set up for your viewing pleasure.
See you in the comments 😊
Rich20 -
My worst dev experience in 2021 has been a PHP-based CMS developped by lobotomized, single-celled organisms incapable of coherent thoughts.
A CMS even worse than WorstPress.
200k lines of "code", no use of packages, multiple entrypoints, no namespacing, all dependencies loaded by "include" at random places and everything is dependent of every thing else... a complete mess.
One could call it the butterfly effect CMS. Adding a space could completely crash the application.
At this point I've almost developped terminal eye cancer...5 -
teacher - gives a lecture about Java Naming Conventions...
Opens Notepad, ( he doesn't use an IDE, when I asked him he told he haven't worked on a IDE before )
and does this
public int user_account_number;
me - *wtf*
thanks God he didn't mess up with the braces and indentation otherwise I would have got eye cancer( already the white theme of notepad was causing nausea)5 -
WHY???
WHY THE FUCK ARE YOU SO FUCKING SURPRISED SHIT HITS THE FAN EVERY GOD DAMN TIME A CHANGE IS MADE IN YOUR LIMPING SYSTEM?
YOU GAVE NO FUCKING SPECIFICATIONS NOR ANY CARE TO DECIDE ABOUT WHAT THE FUCK YOU WANT IN IT.
EVERY TIME I SEE THE CODE I GET EYE CANCER, DEBUGGING THIS SHIT IS AS HARD AS FINDING THE FATHER IN A HOBO STREET ORGY
AND YOU FUCKING THINK ADDING FEATURES INTO THE SYSTEM UNDER THESE CIRCUMSTANCES IS SO GOD DAMN EASY.
I hope life's god damn dandy for you, get fucked with a pipe bomb.
Oh, hello DevRant, sorry for sitting on the fence for the past months.4 -
Help. I'm drowning in spaghetti code
I've been working at a working student (15 hours/ week) at a local software company for about a month now... and with everything I learned at college I'm kind of getting eye cancer here.
We still use SVN
We don't have any coding guidelines. No checkstyle, no overview over the program. When I started there I was just giving a ticket and they said good luck.
We just have some basic RCPTT Tests inside Eclipse and most of Themen don't work in the trunk because the gui got changed...
At least we have a ticket system but it doesn't get used by most of the working students.
I found 10 other bugs while reproducing and trying to fix 1 bug.
And I've never seen Java raped so badly. Today I saw a line that started with 6 brackets because whoever wrote it wanted to cast like there was no tomorrow. I see more instanceof in one day than in my whole devlife before.
The only thing we have is two normal employees that review our code before we are allowed to commit it into the trunk.
So yeah... I'm drowning in spaghetti-code.2 -
I was going crazy for not understanding it.
I went to binary to decimal converters.
I tried applying my own messed up logic.
I was about to post a rage rant.
Now i realized how it works.. fml
And yes, i took a picture of my monitor, enjoy eye cancer :)12 -
"White" Background is killing my eyes..
Please make "Black" as default website background color.
(Common google, atleast make dark theme for all of your apps)
(Who think is a good idea that your google launcher background default color is fucking White, Drop your default bright colorscheme bullshit. Hey you fraeking huge company, stop this trend please.)
(For every designer with dark colorscheme, Thank you for making my life easier.)2 -
1) Had to fix severe bugs in a dynamic UI (configuration-driven forms) component.
Recognized undocumented Copy/Paste/Modify/FuckUp driven variations of the same component all over the project. Unsurprisingly, the implementations covered 99% of the antipattern catalog on wiki.c2.com and could compete with brainfuck in regard to human-readable code.
Escalated the issue, proposed a redesign using a new approach, got it approved.
Designed, Implemented, tested and verified the new shared and generic component. Integrated into the main product in the experimental branch. Presented to tech lead/management. Everyone was happy and my solution opened even more possibilities.
Now the WTF moment: the product with the updated dynamic UI solution never has been completely tested by a QA engineer despite my multiple requests and reminders.
It never got merged into baseline.
New initiatives to fix the dynamic UI issues have been made by other developers. Basically looking up my implementation. Removing parts they do not understand and wondering why the data validation does not work. And of course taking the credit.
2) back in 2013, boss wanted me to optimize batch processing performance in the product I developed. Profiling proved that the bottleneck ist not my code, but the "core" I had to use and which I must never ever touch. Reported back to him. He said he does not care and the processing has to get faster. And I must not touch the "core".
(FYI: the "core" was auto-generated from VB6 to VB.Net. Stored in SourceSafe. Unmaintainable, distributed about a bunch of 5000+ LoC files, eye-cancer inducing singlethreaded something, which had naive raw database queries causing the low performance.)