7
xxzer0
4y

Once I maintained one of the most used and fucked up codebases on the market with almost 1M+ daily users. (cannot say more, sorry).

It's written in PHP and is absolutely terrifying,
the first time I saw some lines of code I was about to scream and cry.

- spaghetti code
- no indentation
- random SQL query unoptimized
- unused vars
- Code is split among several files with no logical reasoning
- Mixed procedural and oop programming
- Unsanitised user input (yes, you got it right)

No test environment, no backup database, every commit goes straight to production.

It's a real disaster but the company prefers to keep it as it is without refactoring or anything else.

Just to make it clear:
It's not hatred against PHP, it's against the code's current status and the older programmers which used to work on it.

Comments
  • 2
    Pornhub.
    Ok.
  • 0
    @magicMirror Pornhub runs well doe, plus, I was in an pornhub dev interview once 😅
  • 2
    Would you blame me if that sounded a lot like WordStress for a moment? :^)

    But yea, I see it so often as well...

    I once was tasked with assisting a colleague in building a project for work...

    - Indentation was all over the place.

    - Opening and closing a MySQL connection for *each* query.

    - all functions in a 3k lines long file "functions.php".

    - all database shit in a 1k lines long file "database.php".

    - Didn't sanitize user input (both when creating a query or displaying it's results, so both SQLInjection and XSS attacks were possible and trivial).

    - "I don't want to waste 10 seconds writing a comment".

    - Directory traversals! (should maybe still thank him for his waifu collection... someday...).

    - Editing bootstrap4 colours n shit... in the minified bootstrap.css...

    - "Just make sure to *manually* change your database to make it work".

    - Spending more time fixing a single bug than I took to rewrite with CakePHP (the entire bug was him missing a value in his SQL query)
  • 1
    @petergriffin do those interviews take place on a black sofa?
  • 1
    It was vkontakte
Add Comment