18
cprn
3y

It's 5 AM and I don't want to shit on anybody's party but trust me when I say most of you here complaining about legacy code don't know the meaning of the word.

As someone who maintained a PHP4 codebase with an average file length of 3000+ lines for almost 4 years, I feel you, I feel your pain and your helplessness. But I've seen it all and I've done it all and unless you've witnessed your IDE struggle to highlight the syntax, unless you had to make regular changes in a test-less SVN's working copy that **is** the production and unless you are the reason that working copy exists because you've had enough of `new_2_old_final_newest.php` naming scheme, you do not know legacy. If you still don't believe me bare in mind I said "is" as in: "this system is still in production".

But also bare hope. Because as much grief as it cost me and countless before me, today of all days, without a warning, it got green lit for userbase migration to a newer platform. And if this 20 years of generous custom features and per client implemented services can be shut down even though it brings more profit than all the other products combined, so can happen to any of your projects. πŸ™

Unfortunately, I do mean *any*.

Comments
  • 5
    I’ve seen a sql that fires SOAP request with formatting the request to xml
  • 4
    Yes... Afore mentioned system integrates over 20 SOAP web services with shell scripts that call `curl`. While it's a step closer towards "sane", I could argue it's a *very* small step. I'm not sure remaining 30+ REST APIs being implemented with PHP that still calls `curl` in a subshell help much.
  • 6
    - Php4
    - still in production
    - insecure as all hell
    - company refuses to rebuild it or let it die
    - 3000+ lines per file, add a zero for a couple of them😏
    - echoing massive concatenated html strings based on injected params, we call those functions 🀭
    - countless branches of logic + a single array somehow determines output
    - not 1 test givern!

    Yep, I know and live this bullshit πŸ˜ͺ
  • 4
    Here's my experience with legacy:

    - having to provide opcodes and read stoneage-old documentation to provide interop calls between old languages and new languages.

    - every time a change is made to a file, zip the whole project and send it through some online sharing service. That wasn't my idea but they did it that way. rofl

    - having to program a stoneage old VOIP system arbitrarily by listening to its internal 8 KHz voice instructions and press a number on the keypad for the next instruction and if you messed up a key then you had to restart the whole process

    - configure a Pentium II PC clone to work with today's sites

    - make an autoexec.bat and manually copy keyb.sys and mouse.sys onto a floppy so I can use keyboard and mouse in DOS (16-bit) upon boot-up.

    - sift through a local intranet to fetch pages that weren't properly linked in the first place.

    - Oh yes and I also had to work in VCS-less codebases. : ) Very annoying, I know. No tests means no certainty..
  • 1
    @molaram Sounds legit, I see no reason why it can't. I've recently posted a screenshot that presents a different hypothesis but yours is better.
  • 2
    @C0D4 This strikes **so** close to home! But I can't say that system is not secure because we have a team of determined admins who retroactively ported all the patches before each security audit (twice a year we get pen tested and more... because fintech and banking). That's one of the reasons we couldn't update to PHP5 when it came out - same code just wouldn't work, we'd have to rewrite like 60% of it. We've ported **parts** of it to PHP5 at some point but only about 30% of what's in PHP5 is legit code and the rest calls a subshell that runs old PHP4 scripts under the hood. Having to maintain another version really made our life easier. πŸ˜†

    We both probably could recall even more atrocious examples of how fucked an app can get after 20 years in prod but it's unhealthy in bigger doses.
  • 3
    @CaptainRant Oh yeah, the famous `tar.gz` over ftp version controlling, happened many times. I don't remember much about `autoexec.bat` or `command.com` and such because the last time I used them I was in a primary school. Haven't touched Windows since 1998, I think.

    Actually, that's not true. I briefly had to use Widnows XP when I worked as 2nd line tech-support, probably in 2004. Can't talk about it because it triggers my PTSD.
Add Comment