16
8lall0
2y

Problem: ugly-ass php spaghetti code that has a technical debt of 16(!!!) years. I mean, it's so spaghetti that has two legacy frameworks that talk to each other inside the same monolith.

Observation: after two months my colleagues, trying to refactoring stuff, they were able to touch so little stuff that it almost made no difference.

How much is worth a rewrite? Because i don't think i can make a difference on a codebase so messy.
I know that rewrite is not the answer 99.9999% of the time, but i have tons of doubts here.

Comments
  • 3
    If you rethink it, maybe it doesn't have to be as complex as the original. Nevertheless, the amount of PITA needed to just plan everything out and pitch it to them is all-consuming. It must start from the head, and if head has to be convinced for like yet another year, it's rotten.

    Don't spare numbers.
  • 4
    I think a rewrite will be much faster (and thus cheaper) to pull off in those situations

    Unless you have the people who originally made the thing around the company, you're gonna end up reverse engineering your own product...
  • 1
    @LotsOfCaffeine that's my idea too.

    Pretty much only one of the original developers is still active, the mess is made by literally one hundred devs that went away after one year.

    Probably rewrite all of this into microservices (or even a sane php framework like symfony) would be the quickest path.
  • 0
    @vintprox programmers are jealous, so i don't know how to even pitch something like that :/
  • 1
    Been there, tried to do that across several apps. Left the company after battling the windmills for 2 years!

    No matter how much I tried, there was always someone who just slapped hacky code all over the place and in the end it ended up with me refactoring the shit out of it, breaking half the other functionalities because spaghetti and then also refactoring those things also.

    It is always easier to slap the hack than to do the refactoring, so I was only fool that was refactoring the core functionalities. Others were refactoring insignificant shit like buttons!

    Try to fix it but don't be persistent fool like me. If you see that nothing changes in let's say half year, polish up your CV and find a better place.
  • 0
    @Ikaroz how do you solved that, if you even did?
  • 1
    I worked (Long ago, around 15 years ago) on a project :

    Database : AS/400 files
    Front end : Part 1 : COBOL, Part 2 : WEB with Java 1.3 (yes before generics)
    Middleware : JWAALK : rewamps AS/400 cobols screens into web interface

    I poped a qestion : let's to redo in pur Java ! And use AS/400 as SQL server !

    We needed to estimate the time needed to estimate the big rewrite.

    From time to time I check the solution (I still have logs after 15 years) and it's still in JWALK and cobol and uknown version of Java with uknown version of spring.

    Still using jquerry.

    fun times !

    So fun that I decided to purge 'COBOL" from my resume.
  • 0
    Drop the framework names. Do it!
  • 0
    @nitnip ETool and Zend1
  • 0
    @8lall0 Oof. That's rough. My condolences.
  • 2
    Most of the time rewrite is the right solution.

    Refactoring breaks a lot of things without any form of validation.

    The troublesome part is that you really need to be "Nicer dicer TM" in organizing the project management.

    You have to operate with a scalpel minimal invasive - which most people absolutely spectacularly fail to do.

    You cannot anticipate on a theoretical level what would break.

    You really need to follow Dr House logic, test out all kinds of poison, make a cross diagnosis which is the path of less destruction and most effectiveness and then try to follow that path in as tiny steps as possible - best in a separate, isolated environment, not changing productive / development code.

    Migrate and then restart the process if you're done.

    It's tiresome. But the only option.

    Most people start at picking an easy task, then loosing it or simply trying to solve too much at a time. Or even worse, don't have any form of planning and just fucking the hornet hive for the fun of it.
  • 0
    @Ikaroz OMFG what a shitshow.

    I also remembered horrors from my story above! Especially inline SQL on the fucking clientside!

    I repressed so much stuff that bothered me on a daily basis!
  • 1
    Your colleagues already tried refactoring, so the sooner you can start rewriting the better. Otherwise the stakes will just keep getting higher.

    Tbh I would be looking for a different job, unless the team and management are good.
Add Comment