Quote:
Originally Posted by Larry Legend
One of my best friends inherited a codebase mostly written by a phd in data science with contributions from an intern who was copy pasting giant swaths of stuff. He didn't even understand how some of the syntax managed to work.
Your perspective on average code quality at the average company is evolving.
I don't understand a lot of it either. The coupe de grace is that the syntax doesn't work correctly, so why bother figuring it out when I can just code it correctly and ignore it?
I'm not going to spill the beans on everything, but I'll give an example:
One of the libs is abandonware and documented as "not really working." Actually, most of the libs are like this, but I'll just say this one does some meta-code HTML generation.
Instead of generating something like:
Code:
<input type="email">
it generates a load of JavaScript with a hidden type and a text type input, like this:
Code:
<input type="text">
<input type="hidden">
// bunch of JS boilerplate to bind this all together,
// so that hidden does
// something... I think?
The problem (if you haven't guessed) is that the JavaScript doesn't actually validate it as email when the user submits, so the end-user can make a mistake and enter, idk, a name.
Well, the JavaScript *does* validate when the response comes in and displays the entered text as
Code:
<input type="text" value="Joe">
And the page throws an error.
It's just nuts. Doing it correct would take zero libs and one LOC. Instead, install a lib, use 30 functions, pass values around, and generate a bunch of awkward race conditions.
This bad, right? At least it's "typed."
Quote:
Originally Posted by Larry Legend
It is very gross and I came to my breaking point with it this week.
It hasn't even caused me any issues I just hate it.
I think it's gross as well.