views:

890

answers:

14

Here's the story: I have moved to a new job 3 months ago. The development team consists of 5-6 people, with one lead developer. All of the projects here are "one-man-jobs", there are no tasks requiring teamwork, everyone works on their own.

Management wants us to use an in-house framework, so that the projects where there will be more than one people are involved, can go more fluently. One person was tasked with writing the framework himself a few months ago, and now I have been given the task to use this framework from now on.

Much to my horror the code is filled with eval()s, call_user_func()s, silencing operators (@), global state is all over the system through static methods, public fields, global variables, and singletons. The classes all begin with the same prefix (the FW's name), thus killing code-completion, and all the classes' filenames begin with 'class.', making it even more impossible to use automatic completion. The classes are basically used for namespacing purposes, with no sign of polymorphism and encapsulation. Lots of already provided functionality are reinvented, like file locking, and session handling.

I have strongly rejected using it. We have agreed to have a discussion about why this is bad, and what can we do to make it better. Beside me, two other people were on the meeting, the lead developer, and the colleague who wrote the existing framework.

I was pretty much devastated after that meeting. I have tried making solid arguments, and giving examples why things are bad, and how they should be done, to make it more safe, reusable, and maintainable. They sprung back like pingpong balls. One argument against using private variables, and getting rid of global state, was that we can easily "gunge in" (is that the correct word?) changes at the last minute, which is harder to do with proper encapsulation. They didn't understand why I want to get rid of the @ operator, that it silences everything, not just php's default error displaying, and it will be almost impossible to find bugs, if they happen in a @function, and they should handle errors, not silence them. One of them agreed with me, that yes, we should handle errors, but this is a small thing, and there are errors that you cannot expect. I agreed on the last part, and told them that yes, that is why you disable error reporting. They didn't understand why I would want to disable that, because then you won't see any errors. In fear, I asked if they have error reporting turned on, on production servers, and a very confident and resounding, "yes!" was the answer.

I didn't know how to argue after this, I proposed the idea of coming up with some made up task, and everyone should solve it in their own way, and then give a presentation about how, and why they did it, so maybe we can demonstrate our opinions more easily. Everyone agreed. The task we came up with is a very very simple CRUD task. After 30 minutes I realized that I have just given a death sentence to myself. For a very simple task like this, using a full-blown MVC system is overkill, the other guy will use the framework in question, and solve the problem with 5 classes, whereas I will use ~20 or something, since much of MVC's strength lies in separation, scalability, and maintainability. If I try to reason for unit testing, dependency injection, loose coupling, they will think I'm a bozo.

I have proposed using a freely available framework, such as Zend Framework, since it's already written, tested, used, whatnot. The idea wasn't exactly shot down, but the lead developer didn't like it, since it's hard to extend the functionality of already existing frameworks. I'm not sure how much of this is true, I have only used ZF for a month, I don't consider myself proficient enough in it, to vote harder for it.

A little background: I already have a pretty successful project behind me, it was on a very short deadline so I had the option of using my own stuff, so I'm not completely seen as the "random smartass from streets", but I haven't earned too much respect yet either.

How would you go about solving this situation?

+13  A: 

As with anything, SHOW them you can do a better job or create something better.

There is nothing worse than someone who will just complain about something, or talk about "how they can do it better" but doesn't supply anything concreate in the form of a new framework.

Also remember that telling people about bad code, or lack of proper Object Oriented design means absolutely nothing to management. They care about deliverables, getting things done on time and making money. So if what is currently in place works for them, they aren't going to care that it's not done properly.

however, if you can create something that gets things done QUICKER, then they might start to listen to you.

Remember, SHOW IT, don't tell it.

Jack Marchetti
I'd say - get out of that company. They seem clueless.
Hamish Grubijan
@Ipthnc - Quitting your job every time you run into clueless coworkers is a good way to be permanently unemployed. Idealism is fine, but reality pays the bills.
zombat
@lpthnc they sure seem clueless by WishCow's account. But don't reject the possibility that WishCow is presenting an account of the situation favourable to WishCow.
High Performance Mark
Ok, but the damage has been done. The possibilities for damage control are narrow. People remember stuff. I would get out not because the code is bad, but because I took a risk and lost.
Hamish Grubijan
Be careful SHOWING people how to do something right. No one likes the new guy coming in and wasting time trying to refactor and reinvent what they've already invested a lot of time and money in already.
George
@Ipthnc - I definitely concede to you on that point. If WishCow came out of it looking very poorly or pushing the wrong buttons, that can be tough to recover from. He'll be the only one that can analyze the situation with true accuracy from that angle.
zombat
@George - I couldn't agree more. A former "architect" I worked with tried that out at his new place, they promptly canned him for being an a-hole. What I mean by "show" is, with your own work, not necessarily refactoring everyone elses stuff.
Jack Marchetti
Will definitely try to show, by showing my own stuff and not by pointing out the flaws, and not producing anything. Telling management about OOP will not get me anywhere, that is why I am trying to persuade the developers and not management.
WishCow
+5  A: 

Be professional. Bad code looses money.

Write a report from a business perspective and give examples of alternatives and routes to replacement. Make an analysis of the time/money that might be being lost.

Be pragmatic, if investment has been made in the existing framework, can it be improved? How? At what cost? What financial benefit?

No company wants to loose money or time. Write it up, send it around, see what happens. If the company is non-responsive to well thought-out arguments and information, ask:

is it the right one for you?

Aiden Bell
Bad code doesn't necessarily lose money. I mean it depends on what you are doing. The original Netscape was apparently HORRIBLY written, but it worked on a lot of different machiens.
Jack Marchetti
Aye, but going off the given example, sounds like it will just cause stink ... which then needs sorting ... costing money. Better to sort it earlier.
Aiden Bell
I'm not sure writing letters to management on how not to lose money on development is rewarding. They will just ask the lead developer about it, and trust his opinion (which is how it should be done).
WishCow
@WishCow - If I were managing, would want to obtain a real, balanced account of what may or may not be happening; this would not be only asking the person who may have made an error. Everyone covers their arse. Nor did I suggest sending a letter to only management. Send to anyone who might care. It isn't a mid industrial-revolution production line;
Aiden Bell
+2  A: 

Extend the task. Make it an iterative process, so you can show better extendibility. Preferably in a way the FW doesn't provide for.

Sometimes, you have to accept that you're working with people who are too clueless to even understand the problems you're talking about. Experience and education do matter. Some people have neither, and just need a few more blown projects to learn from.

Stephan Eggermont
+1  A: 

You need to learn the fine art of politics. Being the best coder does not mean you will make top bucks and will not get laid off.

Hamish Grubijan
+2  A: 

Hmm. Sounds like a difficult situation, given that you have no seniority, and there seems to be little to none understanding of the techniques you would like to use (which is worse than shops that know they should do things like unit tests, but say they can't due to time, personnel and budget constraints).

There are good answers already suggesting productive ways of earning more standing, and over time putting up a fight for more quality (politely and professionally, of course). If you feel they're worth it, stay and try. If it doesn't work out, and you're permanently unhappy with the way work is done, leave.

Pekka
A: 

How would you go about solving this situation?

Quit.

And your lead developer is a monkey if he superficially thinks "frameworks can't be extended" if he hasn't even done the legwork to backup that statement.

Peter Bailey
+2  A: 

Hi

They do all seem to be out of step with you don't they ? I'd either fire you or counsel you along this lines:

Keep your mouth shut and your powder dry until you have earned the respect of your colleagues. You will earn this by turning in good code, not by persuading them that they are doing it all wrong. How can you propose to use a technology, Zend Framework in this case, in which, by your own admission, you are not proficient ?

After your quiet period start to spread your wings a bit. Look for, or make, opportunities to improve the framework in small ways before tackling big chunks of it. Take care not to set up meetings in future at which you demonstrate your own naivety. Identify a path from the situation you are in then to the situation you want to be in.

Regards

Mark

High Performance Mark
Telling this someone who comes and says "this sucks, let's do it my way", is okay. Telling this someone who backs up their opinions with reasons, and shows examples what should be done instead, and why that would be better, in this harsh way isn't. (haven't heard the phrase before, but sounds pretty harsh)Suggesting using a well-known, and tested framework, instead of building it by yourself, even if you are not proficient with it, is not naivety, it was definitely worth a try.
WishCow
@WishCow, taking your own advice helps too.
Aiden Bell
+1  A: 

Trying to argue, about a code thats already there and the developer who wrote it being there can be a very tricky situation. It moves beyond technical discussion at that point.

You can also try the following 1. Try to show the performance pitfalls of the in-house vs public frameworks, if you have the time or bandwidth 2. Alternatively, try to use the Zend framework in your new project and have someone else who is onto a similar task try the in-house framework, with the "statement" that if the latter proves successful you will adapt to it and make the necessary changes yourselves. This may prove your point as well as keep you in good books of the others as well.

Sands
A: 

Time for a new job. That place sounds like pure poison. You will not grow as a developer there.

Terry Donaghe
Sounds to me like an ideal opportunity for WishCow to learn some useful team working and other soft skills.
High Performance Mark
+26  A: 

I would rather have ten developers producing crappy code that gets the job done than twenty world-class developers sitting around arguing about why it doesn't.

In the end, you could be the most brillent programmer alive, but if you don't produce, you're pretty much worthless.

So simply saying, take it in stride. You will garnish more respect through showing that you are willing to adapt to the environment and are making an honest effort to improve the quality of the code one step at a time.

Tread lightly and your day will come :)

George
Hear hear, I've upvoted the answer.
High Performance Mark
Shipping the product is an oft-overlooked feature.
zombat
I think that George is cautioning the OP on the different values in the workplace of technical excellence and of working in a team with products to ship. I think it will help OP if (s)he pauses to consider how the rest of the team and the team leader might view him/her. I agree with George.
High Performance Mark
I agree on producing and not pondering. But we have the chance to refactor it **now**, and I would like to grasp this chance.
WishCow
Netscape made the mistake of throwing out their codebase, netscape who? Exactly. There is no such thing as an unsaveable codebase that is currently working, and rewriting from scratch is rarely a good idea.
Refactoring code doesn't guarentee that it will make more money one way or another. If you put forth your case and they blew you off -- too bad for them (or maybe good for them). If they don't agree -- then oh well, you're still getting a paycheck. I know it's an ugly attitude, but software development can be an ugly business.
George
+19  A: 

The problem here is the same as anywhere. You're the new guy. You can't just walk in and say "Oh, hey, that project that you guys spent months writing? Yeah it's garbage, and we should scrap it and use something else instead." The management and developers have obviously spent a lot of time on it, and a company can't just throw out months worth of work unless it's fairly obvious it's a lost cause. In your case, it's clearly not obvious to anyone but yourself.

My suggestion would be to use the framework. With only a few months development behind it, odds are that it's not going to be overly complex. Buggy? Hell yes. A pain in the ass to use? You know it. You're going to experience frustrating bugs. But there are upsides.

You obviously know you're stuff. You're confident enough to take on management and the lead developers and give them your professional opinion. But don't let it go farther than that (unless you don't value the job). Take their framework and use your skills to improve it. It's not too hard to refactor out garbage like eval statements. Painful, yes, but not difficult. By improving the framework, you'll get more accolades and respect as other users see what you've done, and building/improving a framework is a task with it's own rewards. You will learn a lot (even if you've done it before).

Document everything you do. JIRA or another bug-tracker can help you there. Track every fix you make to the framework. After awhile, put together a report on it saying "this is all the crap I fixed". If it's not any more usable by then, use that data to make a case for Zend or something else at that time. More than that, focus on the technical limitations of obvious flaws of the framework that you haven't been able to fix or can't be fixed (e.g. "because we use eval to do X, our traffic capacity is reduced by y% over this other proven method").

Keep the pressure on, but do it professionally and don't get angry about it. They spent months building it. It might be crap, but it's their crap.

zombat
+1 alone for 'It might be crap, but it's their crap' (so true ;-)
ChristopheD
I actually know a guy who did that. Came in and said "wow your stuff sucks" Unfortunately he didn't offer ways to fix it, and when they pressed him on how to fix it, he froze up. So they fired him :)
Jack Marchetti
Wouldn't I just meet resistance again? An example, I make my fields private, so I can reject setting invalid parameters into the object in the setter. If they complain that using the setter is troublesome because they now have to use a try/catch, what do I do? But worth a try definitely.
WishCow
Yep, you definitely might meet resistance. All you can do is your best. If you're building things that they're going to bitch about, I'd say add some documentation and give it to them. ie. generate something from PHPDoc comments as an object reference. It sounds like they'd probably be fans of "copy and paste" anyway, so a working example would be hard to argue with.
zombat
+1, I like this point of view.
Aiden Bell
A: 

It seems (probably since most of you have developed individually until now) that you do not have any written in-house code standards.

A (partial) way out of this situation may well be to try to agree on 'good practices' for company code.

For some of the problems you mentioned above it should be easy to convince your colleagues of the merits of 'better' practices (most obvious examples: the variable naming, filename conventions etc...). It may help a little.

Try to iteratively improve the framework code itself (don't change a lot of it in a short time or you may find fierce resistance with the original author).

ChristopheD
+1  A: 

Do your job as best, as you can. Produce good code and don't give in; show them, that you can be more productive, by going your way. If you have solid proof, that you can do your job better, they will come to you and try to copy your ideas.

There is no sense in coming as a newbie to the rest of the team and saying: hey, I know better; change your old ways and come with me. No matter how right you are, they won't. The moment they see, that you produce less bugs and your code is more manageable, you won't need to convince them any more.

Software engineering is a great thing, you know. If you are right and better, just do your job and it will come out eventually :-) And, by the way, read this. It's a little more elaborate description of what I am saying by a much more experienced and known engineer ;-)

gruszczy
+1  A: 

As the new guy you really haven't gained their trust in your technical expertise, and you won't until you roll up your sleeves and show them. Work with the bad framework, make improvements upon it. Some coders talk a good game but in the end they submit endless quick fixes. Show them your ideas in working code, and show that they are more robust, more adaptable to changing requirements, have fewer defects, and take the same amount of effort, if not less.

If, after six months you feel like it's going nowhere, I'd look around for a new job and this time interview them as much as they interview you. Make sure it's a company which practices the kind of day-to-day coding you want to do.

jshalvi