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 - "rancid code"
-
I'm editing the sidebar on one of our websites, and shuffling some entries. It involves moving some entries in/out of a dropdown and contextual sidebars, in/out of submenus, etc. It sounds a little tedious but overall pretty trivial, right?
This is day three.
I learned React+Redux from scratch (and rebuilt the latter for fun) in twice that long.
In my defense, I've been working on other tasks (see: Alerts), but mostly because I'd rather gouge my freaking eyes out than continue on this one.
Everything that could be wrong about this is. Everything that could be over-engineered is. Everything that could be written worse... can't, actually; it's awful.
Major grievances:
1) The sidebars (yes, there are several) are spread across a ridiculous number of folders. I stopped counting at 20.
2) Instead of icon fonts, this uses multiple images for entry states.
3) The image filenames don't match the menu entry names. at all. ("sb_gifts.png" -> orders); active filenames are e.g. "sb_giftsactive.png"
4) The actions don't match the menu entry names.
5) Menu state is handled within the root application controller, and doesn't use bools, but strings. (and these state flags never seem to get reset anywhere...)
6) These strings are used to construct the image filenames within the sidebar views/partials.
7) Sometimes access restrictions (employee, manager, etc.) are around the individual menu entries, sometimes they're around a partial include, meaning it's extremely difficult to determine which menu entries/sections/subsections are permission-locked without digging through everything.
8) Within different conditionals there are duplicate blocks markup, with duplicate includes, that end up render different partials/markup due to different state.
9) There are parent tags outside of includes, such as `<ul>#{render 'horrific-eye-stabbing'}</ul>`
10) The markup differs per location: sometimes it's a huge blob of non-semantic filthiness, sometimes it's a simple div+span. Example filth: section->p->a->(img,span) ... per menu entry.
11) In some places, the markup is broken, e.g. `<li><u>...</li></u>`
12) In other places, markup is used for layout adjustments, such as an single nested within several divs adorned with lots of styles/classes.
13) Per-device layouts are handled, not within separate views, but by conditionally enabling/disabling swaths of markup, e.g. (if is_cordova_session?).
14) `is_cordova_session` in particular is stored within a cookie that does not expire, and within your user session. disabling it is annoying and very non-obvious. It can get set whether or not you're using cordova.
15) There are virtually no stylesheets; almost everything is inline (but of course not actually everything), which makes for fun layout debugging.
16) Some of the markup (with inline styling, no less) is generated within a goddamn controller.
17) The markup does use css classes, but it's predominately not for actual styling: they're used to pick out elements within unit tests. An example class name: "hide-for-medium-down"; and no, I can't figure out what it means, even when looking at the tests that use it. There are no styles attached to that particular class.
18) The tests have not been updated for three years, and that last update was an rspec version bump.
19) Mixed tabs and spaces, with mixed indentation level (given spaces, it's sometimes 2, 4, 4, 5, or 6, and sometimes one of those levels consistently, plus an extra space thereafter.)
20) Intentional assignment within conditionals (`if var=possibly_nil_return_value()`)
21) hardcoded (and occasionally incorrect) values/urls.
... and last but not least:
22) Adding a new "menu sections unit" (I still haven't determined what the crap that means) requires changing two constants and writing a goddamn database migration.
I'm not even including minor annoyances like non-enclosed ternaries, poor naming conventions, commented out code, highly inefficient code, a 512-character regex (at least it's even, right?), etc.
just.
what the _fuck_
Who knew a sidebar could be so utterly convoluted?6 -
This goddamned sewer-tier, rancid-as-fuck code may as well have been shat, eaten, and re-shat by a slug-fucking muck demon.
So fucking vile.1 -
I just tried to sign up to Instagram. I made a big mistake.
First up with Facebook related stuff is data. Data, data and more data. Initially when you sign up (with a new account, not login with Facebook) you're asked your real name, email address and phone number. And finally the username you'd like to have on the service. I gave them a phone number that I actually own, that is in my iPhone, my daily driver right now (and yes I have 3 Androids which all run custom ROMs, hold your keyboards). The email address is a usual for me, instagram at my domain. I am a postmaster after all, and my mail server is a catch-all one. For a setup like that, this is perfectly reasonable. And here it's no different, devrant at my domain. On Facebook even, I use fb at my domain. I'm sure you're starting to see a pattern here. And on Facebook the username, real name and email domain are actually the same.
So I signed up, with - as far as I'm aware - perfectly valid data. I submitted the data and was told that someone at Instagram will review the data within 24 hours. That's already pretty dystopian to me. It is now how you block bots. It is not how Facebook does it either, at least since last time I checked. But whatever. You'd imagine that regardless of the result, they'd let you know. Cool, you're in, or sorry, you're rejected and here's why. Nope.
Fast-forward to today when I recalled that I wanted to sign up to Instagram to see my girlfriend's pictures. So I opened Chromium again that I already use only for the rancid Facebook shit.. and it was rejected. Apparently the mere act of signing up is a Terms of Service violation. I have read them. I do not know which section I have violated with the heinous act of signing up. But I do have a hunch.
Many times now have I been told by ignorant organizations that I would be "stealing" their intellectual property, or business assets or whatever, just because I sent them an email from their name on my domain. It is fucking retarded. That is MY domain, not yours. Learn how email works before you go educate a postmaster. Always funny to tell them how that works. But I think that in this case, that is what happened.
So I appealed it, using a random link to something on Instagram's help section from a third-party blog. You know it's good when the third-party random blog is better. But I found the form and filled it in. Same shit all over again for info, prefilling be damned I guess. Minor convenience though, whatever.
I get sent an email in German, because apparently browsing through a VPS in Germany acting as a VPN means you're German. Whatever... After translating it, I found that it asks me to upload a picture of myself, holding a paper in my hands, on which I would have a confirmation code, my username, and my email address.. all hand-written. It must not be too dark, it must be clear, it must be in JPEG.. look, I just wanted to fucking sign up.
I sent them an email back asking them to fix all of this. While I was writing it and this rant, I thought to myself that they can shove that piece of paper up their ass. In fact I would gladly do it for them.
Long story short, do not use Instagram. And one final thing I have gripes with every time. You are not being told all the data you'll have to present from the get-go. You're not being told the process. Initially I thought it'd just be email, phone, username, and real name. Once signed up (instantly, not within 24 hours!) I would start setting up my account and adding a profile picture. The right way to ask for a picture of me! And just do it at my own pace, as I please.
And for God's sake, tackle abuse when it actually happens. You'll find out who's a bot and who isn't by their usage patterns soon enough. Do not do any of this at sign-up. Or hell, use a CAPTCHA or whatever, I don't fucking care. There's so many millions of ways to skin this cat.
Facebook and especially Instagram. Both of them are fucking retarded.6 -
I AM TIRED
warning: this rant is going to be full of negativity , CAPS, and cursing.
People always think and they always write that programming is an analytical profession. IF YOU CANNOT THINK IN AN ANALYTICAL WAY THIS JOB IS NOT FOR YOU! But the reality could not be farther from the truth.
A LOT of people in this field whether they're technical people or otherwise, just lack any kind of reasoning or "ANALYTICAL" thinking skills. If anything, a lot of of them are delusional and/or they just care about looking COOL. "Because programming is like getting paid to solve puzzles" *insert stupid retarded laugh here*.
A lot of devs out there just read a book or two and read a Medium article by another wannabe, now think they're hot shit. They know what they're doing. They're the gods of "clean" and "modular" design and all companies should be in AWE of their skills paralleled only by those of deities!
Everyone out there and their Neanderthal ancestor from start-up founders to developers think they're the next Google/Amazon/Facebook/*insert fancy shitty tech company*.
Founder? THEY WANT TO MOVE FAST AND GET TO MARKET FAST WITH STUPID DEADLINES! even if it's not necessary. Why? BECAUSE YOU INFERIOR DEVELOPER HAVE NOT READ THE STUPID HOT PILE OF GARBAGE I READ ONLINE BY THE POEPLE I BLINDLY COPY! "IF YOU'RE NOT EMBARRASSED BY THE FIRST VERSION OF YOU APP, YOU DID SOMETHING WRONG" - someone at Amazon.
Well you delusional brainless piece of stupidity, YOU ARE NOT AMAZON. THE FIRST VERSION THAT THIS AMAZON FOUNDER IS EMBARRASSED ABOUT IS WHAT YOU JERK OFF TO AT NIGHT! IT IS WHAT YOU DREAM ABOUT HAVING!
And oh let's not forget the tech stacks that make absolutely no fucking sense and are just a pile of glue and abstraction levels on top of abstraction levels that are being used everywhere. Why? BECAUSE GOOGLE DOES IT THAT WAY DUH!! And when Google (or any other fancy shit company) changes it, the old shitty tech stack that by some miracle you got to work and everyone is writing in, is now all of a sudden OBSOLETE! IT IS OLD. NO ONE IS WRITING SHIT IN THAT ANYMORE!
And oh my god do I get a PTSD every time I hear a stupid fucker saying shit like "clean architecture" "clean shit" "best practice". Because I have yet to see someone whose sentences HAVE TO HAVE one of these words in them, that actually writes anything decent. They say this shit because of some garbage article they read online and in reality when you look at their code it is hot heap of horseshit after eating something rancid. NOTHING IS CLEAN ABOUT IT. NOTHING IS DONE RIGHT. AND OH GOD IF THAT PERSON WAS YOUR TECH MANAGER AND YOU HAVE TO LISTEN TO THEM RUNNING THEIR SHITHOLE ABOUT HOW YOUR SIMPLE CODE IS "NOT CLEAN". And when you think that there might be a valid reason to why they're doing things that way, you get an answer of someone in an interview who's been asked about something they don't know, but they're trying to BS their way to sounding smart and knowledgable. 0 logic 0 reason 0 brain.
Let me give you a couple of examples from my unfortunate encounters in the land of the delusional.
I was working at this start up which is fairly successful and there was this guy responsible for developing the front-end of their website using ReactJS and they're using Redux (WHOSE SOLE PURPOSE IS TO ELIMINATE PASSING ATTRIBUTES FOR THE PURPOSE OF PASSING THEM DOWN THE COMPONENT HIERARCHY AGIAN). This guy kept ranting about their quality and their shit every single time we had a conversation about the code while I was getting to know everything. Also keep in mind he was the one who decided to use Redux. Low and behold there was this component which has THIRTY MOTHERFUCKING SEVEN PROPERTIES WHOSE SOLE PURPOSE IS BE PASSED DOWN AGAIN LIKE 3 TO 4 TIMES!.
This stupid shit kept telling me to write code in a "functional" style. AND ALL HE KNOWS ABOUT FUNCTIONAL PROGRAMMING IS USING MAP, FILTER, REDUCE! And says shit like "WE DONT NEED UNIT TESTS BECAUSE FUNCTIONAL PROGRAMMING HAS NO ERRORS!" Later on I found that he read a book about functional programming in JS and now he fucking thinks he knows what functional programming is! Oh I forgot to mention that the body of his "maps" is like 70 fucking lines of code!
Another fin-tech company I worked at had a quote from Machiavelli's The Prince on EACH FUCKING DESK:
"There is nothing more difficult to take in hand, more perilous to conduct, or more uncertain in its success, than to take the lead in the introduction of a new order of things."
MOTHERFUCKER! NEW ORDER OF THINGS? THERE 10 OTHER COMPANIES DOING THE SAME SHIT ALREADY!
And the one that got on my nerves as a space lover. Is a quote from Kennedy's speech about going to the moon in the 60s "We choose to go to the moon and do the hard things ..."
YOU FUCKING DELUSIONAL CUNT! YOU THINK BUILDING YOUR SHITTY COPY PASTED START UP IS COMPARABLE TO GOING TO THE MOON IN THE 60S?
I am just tired of all those fuckers.13 -
Fuck pep8 in general. Fuck harder anything to do with line limits. Fuck with a rusty spatula those who tie it into their git precommits or CI tests.
What's that, it's 2018 and even the shittiest walmart-tier computers have 1080p OR BETTER at a 16:9 aspect ratio?
"lol, 80 character line limit."
Eat a bucket of rancid dicks.
Oh, and since we're forcing you to be so economical with your characters, we're going to force four space tabs. Yknow, rather than simple single tab characters, which could mean everyone can set their preferred level of spacing without bloating the code with whitespace.
Because, yknow, it's entirely reasonable to chew up 1/8 of a line because you're editing a function inside a class definition. God Almighty forbid you try to do a for loop inside that function! Fuck you!
"Oh but you can't have two editors or terminals open side by side without that limit!"
BULL FUCKING SHIT. Here's my shitty 1280x1024 display on my shitty computer with two Sublime editors open side by side. You'll notice the break is at 100 characters. You'll notice I don't have to scroll horizontally to do two things at once. You'll notice I even have room for COMMENTS!
If your code standards require you to make your code *less* readable and *less* clear and take up *more* space to accomplish the same tasks, YOUR CODE STANDARDS SUCK!
Enough with this stupid meme. We're not in the 80s anymore and it's high time to start fucking acting like it.7