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 - "fucking js links"
-
I’m surrounded by idiots.
I’m continually reminded of that fact, but today I found something that really drives that point home.
Gather ‘round, everybody, it’s story time!
While working on a slow query ticket, I perused the code, finding several causes, and decided to run git blame on the files to see what dummy authored the mental diarrhea currently befouling my screen. As it turns out, the entire feature was written by mister legendary Apple golden boy “Finder’s Keeper” dev himself.
To give you the full scope of this mess, let me start at the frontend and work my way backward.
He wrote a javascript method that tracks whatever row was/is under the mouse in a table and dynamically removes/adds a “.row_selected” class on it. At least the js uses events (jQuery…) instead of a `setTimeout()` so it could be worse. But still, has he never heard of :hover? The function literally does nothing else, and the `selectedRow` var he stores the element reference in isn’t used elsewhere.
This function allows the user to better see the rows in the API Calls table, for which there is a also search feature — the very thing I’m tasked with fixing.
It’s worth noting that above the search feature are two inputs for a date range, with some helpful links like “last week” and “last month” … and “All”. It’s also worth noting that this table is for displaying search results of all the API requests and their responses for a given merchant… this table is enormous.
This search field for this table queries the backend on every character the user types. There’s no debouncing, no submit event, etc., so it triggers on every keystroke. The actual request runs through a layer of abstraction to parse out and log the user-entered date range, figure out where the request came from, and to map out some column names or add additional ones. It also does some hard to follow (and amazingly not injectable) orm condition building. It’s a mess of functional ugly.
The important columns in the table this query ultimately searches are not indexed, despite it only looking for “create_order” records — the largest of twenty-some types in the table. It also uses partial text matching (again: on. every. single. keystroke.) across two varchar(255)s that only ever hold <16 chars — and of which users only ever care about one at a time. After all of this, it filters the results based on some uncommented regexes, and worst of all: instead of fetching only one page’s worth of results like you’d expect, it fetches all of them at once and then discards what isn’t included by the paginator. So not only is this a guaranteed full table scan with partial text matching for every query (over millions to hundreds of millions of records), it’s that same full table scan for every single keystroke while the user types, and all but 25 records (user-selectable) get discarded — and then requeried when the user looks at the next page of results.
What the bloody fucking hell? I’d swear this idiot is an intern, but his code does (amazingly) actually work.
No wonder this search field nearly crashed one of the servers when someone actually tried using it.
Asdfajsdfk.rant fucking moron even when taking down the server hey bob pass me all the paperclips mysql murder terrible code slow query idiot can do no wrong but he’s the golden boy idiots repeatedly murdered mysql in the face21 -
So, after weeks of reading spicy rants from all of you, I finally decided to join your community ; even if I'm only a student, I've encountered some solid crap in my internships.
Let's go back in time bois. Two years ago, I started my first intership at a Fortune 500 company (this doesn't exists in France, but whatever, this is nearly the same category). I was supposed to build some file sharing system for the office. Before getting into it, I briefly thought aboyt what technos I could use to build it and make a sweet interface for my co-workers, in 10 weeks, and not a single another day.
Expectations
> Nice team with devs that I could ask things about and learn solid tricks that would even amaze David Copperfield
> Having a nice dev environment
Reality
> Alone on this project
> No fucking dev environment, I had to build everything on Notepad
> No CI
> No SCM
> And, the worst, Ladies and Gentlemans,
I FUCKING HAD TO WORK IN A SINGLE FILE IN A CLOSED ENVIRONMENT.
NO WEBSERVER, NO DEDICATED SPACE.
I HAD TO REQUEST A SPECIFIC ENVIRONMENT IN A CLOSED CUSTOM CMS THAT WAS SERVING FILES, SO THIS FORMAT COULD BE READ ON FOLDER OPENING IN IE9 (FIREFOX FORBIDDEN).
YOU HAD TO MIX HTML, CSS AND JS IN A SINGLE FILE. NO SERVER-SIDE LANGUAGES, ONLY STATIC LINKS, NO FRAMEWORKS (if we can call jQuery, Bootstrap, Semantic UI and all these thinks "Frameworks").
> mfw at the end of the intership13 -
Alright, I've already ranted about this but I feel like that was rather incomplete.. there's some other things that make me want to kill myself every time I enter <!DOCT- WHERE IS THAT FUCKING KNIFE?!!!
First one I've mentioned earlier is its <repetitiveness></repetitiveness>. What was wrong with {brackets}? If only HTML was more like CSS.
But there's some other ones as well.
- Frameworks! Ain't there nothing like a good dozen resources that every single one of your web pages wants to get JS from.
- Quantity over quality. Let's just publish early with tonnes of bugs, move fast and break things, amirite 🤪
- General noobness of apprentice web devs. Now I'm not talking about the real front-end devs here - AlexDeLarge was one of them.. forever holding a special place in my heart - that know how to properly use their tools. But there's a metric shitton of people who think that being able to write <html><body>Hello world!</body></html> makes them a dev.
- The general thought of "it's slow? Slap in more hardware." Now this is a general issue with software development, optimization costs valuable resources while leaving it in a shitty state but released quickly costs pretty much nothing. A friend of mine whose post I'll attach in the image section illustrates this pretty well. You can find it at https://facebook.com/10000171480431....
I'm not sure if this is an exhaustive list, but those are the most important things that irritate me about web development in general.
On a side note, apparently 113 people visited my hiddenbio.html page.. I'm genuinely impressed! I had no idea that so many people on devRant would click through. On Facebook pages this has been an ongoing significant issue of getting people to leave the platform - it's huge but engagement on off-Facebook links is terrible. I guess that I'm dealing with an entirely different community here. And I'm pleasantly surprised actually!11 -
Those fucking cunts that put href="javascript:..." links, where a simple URL would suffice, deserve a horrible death3
-
I've gotten started with web dev in the past and learned HTML and CSS and started learning JS but I never could understand what I could use for a code editor to practice and pretty much forgot all of that stuff. Now I'm trying to learn Python, but what's pissing me off is paying for a phone app that doesn't teach you to write code in these lessons, rather interactive multiple choice questions and "put this in the right order". sequences. This is not learning for me, this is informing. Which is info I don't retain. And If i'm paying for it why is there so little to these lessons? Barely covering anything. I've done every lesson Mimo had for python but it didn't really explain the practicality of what it was teaching me and they skipped a lot of shit. Changing the pace of the lesson from Print this and that and heavily explain the most basic stuff 3x over to only explaining the more advanced stuff one fucking time.
I would really like learning python while being walked through a project as a lesson. Teach the terminology, structure, application, process, rinse and repeat, and outcome all in one. With a project target to look forward to. I need a goal to keep my interest.
So far all I know about python is its a programming language used to create Youtube. And I'm trying to learn it because I keep reading that its the recommended starting line. But I need to be able to visualize what this code can be used for. Explanations in terminology I haven't been taught yet just frustrates me. And I read everyone's posts and see many people mention being frustrated, but I haven't even started coding yet. Feel free to comment and redirect me to page that can help. Links are appreciated. Nay, encouraged!7