views:

361

answers:

7

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?

+4  A: 

If this is a "small startup" with no technical person in the staff, you likely won't get any more time from management to rework most of the things already finished. "Time to market" is the keyword which they may use as explanation -> "Make it work first, fast".

I don't like it either, but this may be your reality.

Karsten
+1  A: 

You could try and get an understanding of their priorities.

If they want to get the job done fast, one reason frameworks exist is to do much of the boilerplate work, saving the time you'd have to spend writing it.

If they want maintainable code, there are obvious benefits to having code laid out in a regular structure, in regular design patterns.

If they want verifiable code (I don't know too much about testability in PHP) surely extending classes in well-known patterns brings greater testability.

If it's just incompetence then education is the only answer (and what better way to do it than using a well-designed framework?).

Joe
+2  A: 

Attempting to convince them to use your preferred model isn't likely to work, most of all because they, most likely, don't see the same benefits you do.

Small steps work best. Don't go out and rewrite 2 weeks of work in a day, you'll only make yourself look like an ass.

Instead, just do what's best, while keeping in close contact with your coworkers. Unless they believe that they know all (in which case, there's simply no hope for you) sooner or later, they will ask your advice on matters. Just explain them how, and more importantly, why so, you would solve that particular problem.

Try not to come across as a know-it-all, instead, always prepare arguments. And don't expect success in a few weeks. It takes time, but if your coworkers are worth their jobs, they'll learn of the benefits eventually.

Ofcourse, if they have very specific arguments against using any model, or MVC in particular, you will just have to honor that sentiment.

Duroth
+13  A: 

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.

Larry Watanabe
I've taken the road of "Add one part at a time". I've added a model-gateway system to replace the practice of hand-written sql, and they've really taken a shine to it. We'll see how things go!
Sean Hagen
Good approach! This helps the overall goal of "help make this project succeed and contribute".
Larry Watanabe
+1 for the answerer, and +1 for the asker for not being pissed off about the quite rough criticism and actually picking up on it. Hats off!
Pekka
A: 

Basically, what you want to do is to introduce a rather deep change into your work environment. This is a very hard thing to do even for folks with excellent social skills. You'll have to take small steps that occur over a very long period of time, be acutely aware of egos, convince people, and finally actually deliver on your promises that the changes will be for the better.

I heard a rather nice podcast/interview on this topic not long ago: link. Lots of useful info in there. The most shocking thing is that many people simply DON'T LIKE change and WON'T DO IT. You have to make them part of the process and get them invested.

Angelo
+1  A: 

This is one of the "Things you should never do".

http://www.joelonsoftware.com/articles/fog0000000069.html

Is moving to MVC the best use of resources right now?

You can't count the hours on your own time as "free" because that is cheating. You could do anything in 0 hours of company time if it was all done on your own time -- rewrite it RoR, write it in Lisp, etc.

So, let's say that it will take you N hours to write it. Have you also added in the hours required to regression test it to make sure that it works perfectly? No? then add in another 2N hours. How about familiarizing the other developers with the new code? No? then add in another 2N hours.

So, we're probably up to 5N hours now. What are the other things that need to get done before your next ship date? Can you also fit in these extra 5N hours and still make that date? If so, what are the items for the ship date after that? Are the items that could be finished in 5N hours worth more than rewriting in MVC?

What will be the benefits, time-wise and maintenance-wise for the rewrite?

You are probably not thinking about this from a project management perspective. From that perspective, I personally doubt that a rewrite is the best use of your time.

Larry Watanabe
A: 

You probably won't be able to convince them, but you have the right to voice your opinion - you are part of the team after all. It's irrelevant whether you're new or not.

helloworlder