Php – Convincing Coworkers To Use MVC

model-view-controllerPHPzend-framework

I'm about to start working on a new project at a somewhat new job, and I've run into a bit of a problem. They're not big fans of MVC.

The reason why this bugs me is that they claim they're currently using the Zend Framework when they're really not. They're barely using the DB model classes, and that's about it. No MVC, no extending of Zend classes to achieve their goals.

The last project I worked on used Zend very heavily. Once the project was done, we were left with a nice MVC framework. Very clean controllers, most of the heavy duty logic was in the models where it belonged, and a nice model-gateway system to boot. To go from that to sphagetti code with hand-written SQL is kind of a shock.

So, I ask you, StackOverflow community. How do I convince my coworkers to move to an MVC framework? I have the feeling that they're afraid to use MVC because it would mean a learning curve for the two established programmers ( it's a small startup ). I've been thinking about doing a copy of the current project using MVC and all the Zend goodness in a seperate SVN repository ( on my own time ), and show it to them in a few weeks to see what they think.

Any thoughts on how to convert coworkers to MVC?

Best Answer

There's a good post you should read "what is the most important thing they didn't teach in school". One of them is social skills. It looks to me like you're falling on your face here.

First, you're the newbie on the team. Who are you to tell them what to do or how to do it? If you rewrite the code, if it's worse you're an idiot. If you succeed, you're an ass. Either way, you're either the laughingstock or on your way out.

What you need to do is solve the following problem: "How can I learn to fit into this team, help the project succeed, and contribute?" From this perspective, showing others that you know more than they do and that they are idiots isn't the solution.

Broaden your perspective -- your problem here is probably 10% technical, 40% learning how to function as part of a team, 30% social, and 20% communication.

From the project perspective, what do you think is more important? What do you think will get the project finished on time?

a) Everyone working together productively and harmoniously in the wrong framework. b) The team split up with 1 person working in 1 framework, the other 2 ignoring him and everyone making each other look bad to the team manager/management.

You've spoke your piece, now shut up and do the work they tell you to do, do it well, do it fast, and, if you want, put as much MVC into it (your part) as you want as long as you don't tell anyone else how to write their code :) If you're so good you get it done extra fast, then ask them for more work to do, and repeat above steps.

Once you've earned their respect, and ideally friendship, then try bringing up the subject again.