Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I read many books about how to design great software, but I kind of struggle to come up with a good design decisions when it comes to business apps, especially when the timeframe is tough.

In the company I currently work for, the following situation happen all the time: my teamlead tells me that there's a task to do, I call some guy or a girl from business who tells me exactly what is it they want, and then I start coding. The task always fits in some existing application (we do only web apps or web services), usually it's purpose is to pull data from one datasource and put into the other one, with some business logic attached in the process.

I start coding and then, after spending some time on a problem, my code didn't work as expected - either because of technical mistake or my lack of knowledge of the domain. The business is ringing me 2-3 times a day to hurry me up. I ask my team lead to help, he comes up, sees my code and goes like 'What's this?'. Then he throws away about half of my code, including all the design decisions I made, writes 2-3 methods that does the job (each of them usually 200-300 lines long or more, by the way), and task is complete, code works as it should have. The guy is smarter than me, obviously, and I'm aware of that.

My goal is to be better software developer, that means write better code, not finish the job quicker with some crappy code. And the thing is, when I have enough time to tackle a problem, I can come up with a design that is good (in my opinion, of course), but I fall short to do so when I'm on a tight deadline. What should I do?

I am fully aware that it's rather vague explanation, but please bear with me

share|improve this question
2  
If he's throwing away half your code, it's not a matter of limited time, it's that the majority of your code is patently wrong. Do you look at the fixed solution so you can do it right yourself? Are you actually improving? – Telastyn Dec 9 '12 at 21:50
3  
@Telastyn: While I agree with your point in the general case. The OP describes the "fixed solution" as few 100+ line methods. That makes me think that the lead is only concerned with creating code that works and moving on. – unholysampler Dec 9 '12 at 21:58
@unholysampler looks exactly like it – chester89 Dec 9 '12 at 22:25
1  
@unholySampler - sure, but my point is that the OP isn't falling short because of a tight deadline. Short is something that has a simple bug somewhere, or has one bad spot. 50% thrown away isn't close. That's bad. The OP clearly wants to improve (kudos OP) - so look at what the lead did instead. Ask why they did that. Try to do that in the future. – Telastyn Dec 9 '12 at 22:31
1  
200-300 line methods? Yuck. Doesn't mean he's smarter or a better coder. The guy just knows how to survive in a fire-fighting time pressured shop. – Marjan Venema Dec 10 '12 at 7:23
show 4 more comments

closed as not a real question by Peter Rowell, Glenn Nelson, Walter, Tim Post, gnat Dec 10 '12 at 9:25

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.