I've just received some samples of a codebase to see if I'm up to the job. It's all procedural spaghetti code - how do I tell this to the client?

You need to first take a deep breath, slap yourself in the face, and appreciate the fact that you are debating the pros and cons of how exactly to type the keys on your keyboard while sitting down indoors probably with A/C, while some poor bastard has to replace a roof in the middle of summer, cut grass, or actually do hard work for a living.

Don't get so stressed out about code being perfect. You get points in programming for solving problems, not for polishing shit. That is of course unless this is military/medical/banking/avionics, but since PHP, im gonna assume it's probably some kind of complex form, or batch processing code or some shit like that. Something that if it breaks, nobody will die or lose millions.

Take this opportunity to learn about the rationale of people who write bad code, this is a learning experience. Start off by documenting the existing codebase as it stands. If you don't do this, I would challenge your understanding of what it even does. Show me on paper how it's shit, don't just bitch cause it's hard to understand at first glance. Create a data flow of how the information moves through the system. Identify bottlenecks or areas that the client might want corrected or improved upon. Lay out some options for the client to upgrade, bypass, go new, or re-write, and the pros and cons of each.

Being a programming and taking a shit on people's code is like being a hairdresser and making fun of ugly people who come to get their hair cut. Not only is it arrogant and obnoxious, but it's a great way to turn people off to dealing with you. Also you might meet like a shrek type scenario or some dude with bad code with a shitload of money.

Look at it from the client's perspective. Do you want a $50 hamburger made the right way with free range bullshit and gluten free hooves and all that shit, or do you want like a $10 burger that will get you through lunch?

/r/PHP Thread