Every Which Way But Loose - Finding Your Own PHP Development Style

Every Which Way But Loose - Finding Your Own PHP Development Style

  1. PHP 🐘
  2. 2022-02-26 21:00
  3. 19 min read

Walk into any PHP discussion online and you will find the same argument playing out on repeat. Laravel vs Symfony. Framework vs no framework. MVC vs ADR. TDD vs test-after. Static analysis vs vibe coding. Every debate follows the same pattern: someone declares their preferred approach the One True Way, and anyone who disagrees is Doing It Wrong.

These framework wars, architecture debates, and methodology flamewars are counterproductive. They waste energy that could go toward building things, helping other developers, and improving the ecosystem. More importantly, they obscure a fundamental truth about PHP: there is no single correct way to build applications with this language, and that is not a weakness. It is the entire point.

PHP’s superpower has always been flexibility. You can use it to build a Laravel-powered SaaS platform serving millions of users, or you can write a single-file contact form and FTP it to a shared host. Both approaches are valid. Both produce working software. The only wrong way to write PHP is the way that does not work for your specific situation.

This article is not a tutorial. It is not a guide to choosing the perfect stack. It is an invitation to think about why we develop the way we do, how we can learn from developers who make different choices, and how the PHP community can be stronger when we stop treating methodology as a moral issue.

The Many Faces of PHP

PHP powers an astonishing range of applications. At one end of the spectrum, you have WordPress, which runs over 40 percent of the web. At the other end, you have Symfony and Laravel applications running enterprise-grade systems for Fortune 500 companies. In between, you have custom CMS platforms, e-commerce stores, API backends, internal tools, hobby projects, and millions of lines of legacy code that still process payments, send emails, and serve content every single day.

Each of these use cases imposes different constraints. A developer building a two-page brochure site for a local bakery has different priorities than a team building a multi-tenant CRM platform. The bakery site needs to be cheap, fast to deploy, and easy to hand off to someone else. The CRM needs to be maintainable, testable, and scalable over years of active development.

The developer building the bakery site would be wasting time setting up Docker containers and CI pipelines. The team building the CRM would be taking unnecessary risk by not using version control and automated testing. Both developers are making rational choices based on their context. Neither approach is universally correct.

This diversity is not an accident. PHP was designed to be accessible. It runs on virtually every web host, integrates with every database, and supports multiple programming paradigms. You can write it procedurally, object-oriented, or functionally. You can use a framework or not. You can use Composer or manage dependencies by hand. The language does not force you into a single model of development.

Why Flexibility Matters

When a language dictates how you must structure your code, it reduces cognitive overhead but at the cost of flexibility. Developers who fit that mold benefit. Developers who do not find themselves fighting the language at every turn.

PHP takes the opposite approach. It provides the tools and lets you decide how to use them. This philosophy has real advantages.

First, it lowers the barrier to entry. A beginner can write their first PHP script in minutes without understanding namespaces, autoloading, or dependency injection. They can build something that works, learn by doing, and gradually adopt more sophisticated patterns as their understanding grows. Contrast this with frameworks that require you to understand routing, middleware, service containers, and ORMs before you can render a single page.

Second, flexibility enables experimentation. When you are not locked into a single architectural pattern, you can try different approaches and discover what works for your specific problem. Maybe a flat structure works fine for a small internal tool. Maybe event sourcing makes sense for your financial application. The freedom to choose means you can optimize for your actual constraints rather than following a prescribed template.

Third, flexibility supports longevity. Code written in vanilla PHP twenty years ago can still run today with minimal changes. Code written in a framework from that era almost certainly requires a full rewrite. The less you commit to a specific paradigm, the more your code can evolve alongside the language.

This does not mean frameworks are bad. It means the flexibility to choose whether and how to use them is valuable in itself.

Framework Advocates vs Vanilla PHP

The loudest debate in the PHP community pits framework advocates against vanilla PHP proponents. Each side has legitimate arguments. Neither side is wrong.

The Case for Frameworks

Frameworks provide structure, conventions, and battle-tested solutions to common problems. When you start a Laravel or Symfony project, you get routing, ORM, templating, authentication, validation, queuing, and testing tools out of the box. You do not need to make hundreds of small decisions about how to structure your application. You follow the framework conventions, and the framework handles the rest.

This consistency has real benefits. Teams can move between projects without relearning the architecture. Best practices are baked into the framework defaults. Security vulnerabilities in common patterns are patched centrally. And the ecosystem of packages, tutorials, and community support means you are rarely solving a problem that someone else has not already solved.

For a team building a greenfield web application, a framework is almost always the right choice. The productivity gains are enormous, and the conventions reduce coordination overhead.

The Case for Vanilla PHP

Vanilla PHP gives you complete control. No framework conventions to learn. No magic methods to debug. No dependency graph to manage before you can render a simple page. You include a file, connect to a database, and output HTML. It is direct, transparent, and fast.

This approach shines in specific contexts. When you are maintaining a legacy application, rewriting it in a framework is rarely practical. When you are building a microservice or API endpoint, the overhead of a full-stack framework is unnecessary. When you are a freelancer shipping small sites for clients, the simplicity of vanilla PHP means fewer moving parts and easier handoffs.

There is also an educational argument. Developers who understand vanilla PHP deeply write better framework code. They understand what the framework is doing under the hood. They can debug issues without relying on Stack Overflow. They are not dependent on framework-specific knowledge that becomes obsolete when the next hot framework arrives.

The Middle Ground

The real answer, as unsatisfying as it sounds to partisans on both sides, is that frameworks and vanilla PHP are tools, not identities. The best PHP developers are comfortable working in multiple modes. They reach for a framework when the project demands structure and scale. They write vanilla PHP when simplicity and control matter more.

This is not indecision. It is judgment. And judgment comes from experience, not from allegiance to a particular methodology.

Small Shop vs Enterprise

Scale changes everything. A solo freelancer maintaining twenty small client sites operates under fundamentally different constraints than a team of ten engineers building a single product.

The Solo Developer or Small Agency

If you are a freelancer or small agency, your bottleneck is time. You have more projects than hours. Your clients care about results, not architecture. They want a working site delivered on time and on budget. They will never look at your code.

In this context, pragmatic choices win. Use whatever gets the job done fastest. If that means WordPress with a page builder, use WordPress. If that means a Laravel app with an admin panel generator, use Laravel. If that means plain PHP files uploaded via FTP, do that.

The goal is to deliver value, not to impress other developers. Architecture astronauts who mock simple solutions have never had to balance five client projects while keeping three family sites running and responding to support emails at midnight.

The Product Company

If you are building a product that will be maintained and extended over years, your priorities shift. Code quality, test coverage, and architectural consistency become investments that pay compounding returns. A messy codebase that took three weeks to build may take six months to untangle later.

Product companies benefit from frameworks precisely because frameworks enforce consistency. When every developer on the team follows the same patterns, onboarding is faster, code reviews are more productive, and the application is easier to reason about. Tests become practical because the framework standardizes how components interact.

The Enterprise

Enterprise development adds compliance, security, and process overhead. You may need to satisfy SOC 2, HIPAA, or PCI DSS requirements. You may need to integrate with legacy systems running COBOL or mainframe databases. Your deployment process may involve change review boards and scheduled release windows.

In this environment, stability and predictability matter more than developer convenience. You choose frameworks and tools based on their track record, community longevity, and support guarantees. You avoid bleeding-edge features. You write extensive documentation because the person maintaining your code in three years may not have your context.

Enterprise PHP developers often envy the freedom of small shops to try new tools and frameworks. Small shop developers often envy the resources and stability of enterprise teams. Both perspectives are valid.

Learning From Developers Who Work Differently Than You

The most valuable learning experiences often come from developers who approach problems differently than you do. When you only interact with developers who share your stack and methodology, you reinforce your assumptions without examining them.

A framework advocate can learn a lot from a vanilla PHP developer who has maintained the same application for fifteen years. That developer understands the real-world evolution of a codebase. They know which abstractions paid off and which ones became technical debt. They have debugged problems at every layer of the stack because they built everything themselves.

A vanilla PHP developer can learn equally from a framework expert. That expert understands how to structure applications for team collaboration. They know how dependency injection and service containers simplify testing. They have internalized patterns that reduce cognitive load across large codebases.

The goal is not to convert anyone. The goal is to expand your range. Every approach has blind spots. Every methodology optimizes for certain outcomes at the expense of others. The more perspectives you absorb, the better your judgment becomes about when to apply each technique.

Finding Your Path

If there is no single correct way to write PHP, how do you find the approach that works for you? The answer is frustratingly simple: try things and pay attention to how they feel.

Start by asking yourself honest questions about your constraints. What kind of projects do you build? Who maintains them after you? How important is long-term maintainability versus short-term speed? What does your hosting environment look like? What skills does your team have?

Your answers to these questions will point you toward the right tools for your situation. And those answers will change over time. The developer who starts with vanilla PHP, moves to Laravel for a product project, then returns to a lighter stack for microservices is not inconsistent. They are adapting to different contexts.

Resisting Dogma

The biggest obstacle to finding your path is dogma. Dogma tells you there is one right way and every other approach is inferior. Dogma comes from insecurity. Developers who are confident in their abilities do not need to tear down other approaches to validate their own.

When you encounter dogma, whether from a framework zealot or a vanilla purist, recognize it for what it is: a sign that the other person is prioritizing tribalism over effectiveness. Thank them for their perspective and make your own decisions based on your actual requirements.

Building Your Toolkit

A mature PHP developer maintains a toolkit of approaches rather than a single rigid methodology. They know how to set up a Laravel application and how to write a procedural script. They understand the value of tests and know when writing tests is not the best use of their time. They use static analysis when it prevents bugs and skip it when it gets in the way.

Building this toolkit takes years. It requires working on different kinds of projects, with different teams, under different constraints. There are no shortcuts. But every project you complete adds to your judgment about what works and what does not.

Real-World Context

Different scales of operation demand different approaches. Here is how the choice of tools and methodology plays out in practice.

The Solo Consultant

Sarah runs a solo web development consultancy. She maintains twenty WordPress sites, occasionally builds custom Laravel applications for clients, and handles emergency fixes for legacy PHP code that predates frameworks entirely.

Her toolkit is pragmatic. She uses WordPress for brochure sites because her clients can manage content themselves. She uses Laravel for custom applications because it provides the structure she needs without a team. She keeps a toolbox of vanilla PHP techniques for quick fixes and legacy maintenance.

Sarah does not care about the framework wars. She cares about delivering working solutions and getting paid. Her approach is invisible to the online debates because she is too busy building things to argue about them.

The Startup Team

A five-person startup is building a subscription-based analytics platform. They chose Laravel because it gave them authentication, queuing, scheduling, and an ORM out of the box. They did not want to build those components themselves when their focus was on their core product differentiator.

The team writes tests, uses CI/CD, and deploys multiple times per day. They contribute back to open source packages they depend on. They care about code quality because they know the product will need to evolve rapidly based on user feedback.

For this team, the framework is an accelerator. It removes the need to reinvent common patterns and lets them focus on what makes their product unique.

The Enterprise Product

A large organization runs a PHP application that processes financial transactions. The codebase is fifteen years old. It started as vanilla PHP, was partially ported to Zend Framework, and now coexists with newer Symfony components. The team has twelve developers, most of whom have been on the project for years.

The team’s primary concern is stability. They cannot afford downtime or data loss. They test exhaustively, deploy carefully, and upgrade dependencies conservatively. They are still running PHP 7.4 because their compliance review process for the PHP 8.0 upgrade took eighteen months.

This team looks nothing like the startup or the solo consultant. They are not writing blog posts about their stack choices. They are keeping critical infrastructure running. Their approach is correct for their context, even if it would be wrong for someone else’s.

Best Practices for Community Health

The PHP community is not a monolith. It is a collection of overlapping communities with different priorities, constraints, and cultures. Keeping that ecosystem healthy requires intentional effort.

Respect All Approaches

The most fundamental practice is simple respect. Do not mock other developers for their choices. The WordPress developer keeping a small business running is not less skilled than the Symfony developer building an enterprise application. The freelancer using FTP is not less professional than the engineer with a full CI/CD pipeline.

Everyone is optimizing for their circumstances. You do not know what constraints they are working under. Assume good faith and respect their choices even when you would make different ones.

Share Knowledge Without Condescension

When you share knowledge, do it without making the recipient feel inadequate. “You should switch to Laravel” is not helpful advice for someone maintaining a legacy codebase. “Here is how you could gradually introduce Composer into your existing project” is helpful.

The best knowledge sharing meets people where they are. It acknowledges their constraints and offers incremental improvements rather than wholesale conversions. It respects that not everyone can or should adopt the latest trends.

Mentor Across Approaches

If you are a framework expert, consider mentoring a developer who works with vanilla PHP. You will learn about their constraints, and they will learn about patterns that could improve their code. If you are a vanilla PHP veteran, mentor someone who has only ever used frameworks. Help them understand what the framework is abstracting.

Cross-pollination makes the community stronger. When developers understand multiple approaches, they make better decisions and produce better software.

Build Bridges, Not Walls

When you create a package, library, or tool, consider whether it can work for developers at different levels. Can it be used without a framework? Can it be installed with minimal dependencies? Can it work on older PHP versions with minimal pain?

Not every tool needs to support every configuration. But the more accessible your work is, the broader its impact. Building bridges between different parts of the PHP community benefits everyone.

Common Traps

Even well-intentioned developers fall into patterns that harm the community. Here are the most common traps and how to avoid them.

Dogmatism

Dogmatism is the belief that your preferred approach is objectively correct and all others are inferior. It manifests as framework zealotry, methodology absolutism, and dismissal of developers who make different choices.

The antidote to dogmatism is exposure to different contexts. Work on a legacy project. Build something without a framework. Contribute to a project that uses a different stack than you are used to. The more varied your experience, the harder it becomes to believe there is only one right way.

Gatekeeping

Gatekeeping is the practice of excluding people from the community based on arbitrary criteria. “You are not a real PHP developer if you do not use Composer.” “Real developers write tests.” “If you are still on PHP 7.4, you are not serious.”

Gatekeeping drives people away from the community. It discourages beginners from asking questions. It makes experienced developers feel unwelcome if their stack does not conform to current trends. It shrinks the community and reduces the diversity of perspectives that makes PHP strong.

The solution is to welcome everyone who uses PHP, regardless of their skill level, framework choice, or version. The beginner uploading their first script is as much a part of this community as the core contributor writing RFCs.

Ivory Tower Syndrome

Ivory tower syndrome affects developers who have been working with modern tools and practices for so long that they forget what it is like to work without them. They assume everyone has Docker, Composer, CI/CD, and PHP 8.2. They write documentation that assumes modern infrastructure. They dismiss real-world constraints as excuses.

If you have the luxury of a modern stack, recognize that not everyone shares that luxury. The developer on shared hosting is not lazy. They are working within constraints you may not understand. Your job is not to judge them. It is to build tools and share knowledge that genuinely helps them improve their situation.

Confirmation Bias

Confirmation bias leads you to seek out information that confirms your existing beliefs and ignore information that challenges them. If you believe frameworks are the only professional way to develop PHP, you will find plenty of evidence to support that view. If you believe frameworks are unnecessary overhead, the same applies.

Combat confirmation bias by actively seeking out perspectives that challenge your own. Read blog posts from developers who use different stacks. Attend conferences and talks that are outside your usual focus. Engage in respectful debate with developers who disagree with you.

Frequently Asked Questions

Q: Should I use a PHP framework for every project? A: No. Frameworks provide significant benefits for complex, team-based projects, but they add unnecessary overhead for simple sites, microservices, and prototypes. Choose based on your project’s actual requirements, not abstract principles.

Q: How do I choose between Laravel and Symfony? A: Consider your team’s experience, the project’s complexity, and your ecosystem needs. Laravel emphasizes rapid development and convention. Symfony emphasizes flexibility and enterprise patterns. Both are excellent choices. Pick the one that aligns with your constraints.

Q: Is vanilla PHP still relevant in 2022? A: Absolutely. Vanilla PHP is the foundation everything else is built on. Understanding it deeply makes you a better developer regardless of whether you use a framework. Many production applications still run vanilla PHP, and it remains a valid choice for the right project.

Q: I am a freelancer. Should I learn a framework? A: Yes, learning at least one framework expands the range of projects you can take on. But do not abandon vanilla PHP. Many freelance gigs involve maintaining existing code, and much of that code is not framework-based.

Q: How do I deal with developers who tell me my approach is wrong? A: Thank them for their input and evaluate their advice based on your actual constraints. If their recommendation genuinely improves your situation, adopt it. If it does not apply to your context, ignore it. Your job is to build working software, not to satisfy everyone else’s preferences.

Q: Can I mix frameworks and vanilla PHP in the same project? A: You can, but be intentional about the boundaries. Using a framework for routing and a custom implementation for business logic is common. Mixing multiple frameworks in the same codebase is usually a sign of architectural drift that will create maintenance problems.

Q: What if my hosting does not support the PHP version my framework requires? A: Consider switching hosts that support modern PHP. Many affordable options exist. If switching is not possible, you may need to use a compatible framework version or work without a framework. Trade-offs are part of development. Choose based on your constraints.

The Path Forward

The PHP community will always have debates about methodology, tools, and best practices. That is healthy. Discussion and disagreement are how we refine our understanding and improve our craft. The problem is not disagreement. The problem is the belief that disagreement means someone is wrong.

PHP has succeeded because it meets developers where they are. It does not demand a specific ideology. It does not require you to adopt a particular framework. It provides the tools and lets you build what makes sense for your situation. That flexibility is not a bug to be fixed. It is the feature that made PHP the language it is today.

The next time you encounter a developer who builds differently than you do, resist the urge to correct them. Ask them why they make the choices they make. You may learn something that changes how you think about your own work. And they may learn something from you.

That mutual exchange is how a community grows. It is how we move past the framework wars and the methodology flamewars and focus on what actually matters: building software that solves real problems for real people.

There is no single correct way to write PHP. There is only the way that works for your context, your constraints, and your team. Find that way. Respect the ways others find. And keep building.

PHP Community Development PHP Framework Programming Philosophy Career Learning