Write good code or get the job done fast?

  • (2 Pages)
  • +
  • 1
  • 2

29 Replies - 4521 Views - Last Post: 31 March 2011 - 02:36 AM

#1 SixOfEleven  Icon User is offline

  • using Caffeine;
  • member icon

Reputation: 945
  • View blog
  • Posts: 6,342
  • Joined: 18-October 08

Write good code or get the job done fast?

Post icon  Posted 04 January 2010 - 01:29 PM

There have been a lot of topics in the C# forum like this one where the OP was asking about initializing variables. I thought that it would be a good debate on if we, as programmers, should right good, solid code from the start or if we should just get the job done quickly and move on to the next problem. In my opinion you should write good, solid code that will preform as the user of the code would expect, that would be very easy to read and understand 6 months down the line (maybe even documented but we won't go into that can of worms) and follow good programming principles to reduce the possibilities of those "undocumented features" that we as users of software are so found of.

What are your thoughts on this?

Is This A Good Question/Topic? 0
  • +

Replies To: Write good code or get the job done fast?

#2 FlashM  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 382
  • View blog
  • Posts: 1,195
  • Joined: 03-December 09

Re: Write good code or get the job done fast?

Posted 05 January 2010 - 03:56 AM

I always go for a good, solid and understandable code. And I always follow the rule: simpler code is always a better.
Was This Post Helpful? 0
  • +
  • -

#3 plasma-hand  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 80
  • Joined: 02-January 10

Re: Write good code or get the job done fast?

Posted 05 January 2010 - 08:41 AM

I always ask whether the employer want it done fast and cheap, or done slower and more efficient,with a higher cost.

That sentence sounded like I was a prostitute
Was This Post Helpful? 1
  • +
  • -

#4 DuoShin85  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 39
  • View blog
  • Posts: 135
  • Joined: 18-December 09

Re: Write good code or get the job done fast?

Posted 06 January 2010 - 10:43 AM

I support writing solid code the first time around. There is a lot less hassle working with solid code than instant spaghetti code when you or some other developer performs maintenance down the line.

Don't get me wrong. I like spaghetti but only for dinner.
Was This Post Helpful? 1
  • +
  • -

#5 Adkins  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 66
  • View blog
  • Posts: 560
  • Joined: 27-October 09

Re: Write good code or get the job done fast?

Posted 07 January 2010 - 04:34 AM

Without a doubt I go for the good solid code. You will make up the time and more down the line when you or someone else starts doing maintenance. Quick cheap code is only a benefit in the here and now, but hopefully any software that is made will stay around past that.
Was This Post Helpful? 0
  • +
  • -

#7 KeyboardKowboy  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 20
  • View blog
  • Posts: 142
  • Joined: 15-December 08

Re: Write good code or get the job done fast?

Posted 08 January 2010 - 08:58 AM

There's a paradigm in software development where you draw a triangle, and at each of the three points of the triangle you have a different result. The three points are GOOD, FAST, CHEAP. You only get to pick two.

So far instance, if you pick GOOD and FAST, your product will not be CHEAP.
If you pick FAST and CHEAP, your product will not be GOOD.
Etc...

Writing code quickly, without fully analyzing the problem or trying to future proof, although solving the problem for the time being, will come back to bite you should you need to make modifications or additions later on. Often fixing one problem, breaks another area of your system.

Take the time to write robust and efficient code, start creating templates that can be reused to save time in the future. You will be more than happy when you revisit the project and realize you can easily do what you need to.

I always try to follow the Three Tier Architecture. Data Access Layer -> Business Layer -> Presentation Layer.
Remember that high cohesion and low coupling will undoubtedly save you time and frustration.
Was This Post Helpful? 1

#8 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1639
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Write good code or get the job done fast?

Posted 08 January 2010 - 09:05 AM

Whenever I an negotiation with a client for a job the first thing I let them know is that it may take me a little bit longer than other developers he's negotiation with simply because I refuse to take shortcuts and take the time to ensure it right, efficient and extensible the first time, and that it's not even an option to :"ust get it to work".

I inform them right upfront that there are 2 ways of writing code
  • Just make it work
  • Make it work and be efficient and extensible
When I explain it that way they normally understand why I do it the way I do, and why my bids are normally a little higher than most they receive. I have yet to lost a bid for it being higher once I explain why and how I work.

EDIT: I featured this (good conversation piece) and am moving it to Corner Cubical so all programmers, regardless of language, can chime in with their thoughts on the topic :)
Was This Post Helpful? 0
  • +
  • -

#9 Core  Icon User is offline

  • using System.Linq;
  • member icon

Reputation: 774
  • View blog
  • Posts: 5,097
  • Joined: 08-December 08

Re: Write good code or get the job done fast?

Posted 08 January 2010 - 09:20 AM

Donald Knuth said:

We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.


Write code that works first, then optimize. With experience, the code you write becomes better and eventually you will reach the level of experience when the initial code is very efficient and there is little or no need to optimize.
Was This Post Helpful? 0
  • +
  • -

#10 NeoTifa  Icon User is offline

  • Whorediot
  • member icon





Reputation: 2650
  • View blog
  • Posts: 15,673
  • Joined: 24-September 08

Re: Write good code or get the job done fast?

Posted 08 January 2010 - 09:25 AM

I do both, but I focus on the quality of my work. I am known around the building for having my work done the fastest and most satisfactory, but if I had to choose, it'd be quality over speed.
Was This Post Helpful? 0
  • +
  • -

#11 BenignDesign  Icon User is offline

  • holy shitin shishkebobs
  • member icon




Reputation: 6018
  • View blog
  • Posts: 10,444
  • Joined: 28-September 07

Re: Write good code or get the job done fast?

Posted 08 January 2010 - 10:31 AM

I hate spitting out 8 tons of crap code because someone wants something done tomorrow. It only ends up costing more time and money in the long run. I would much rather take a little longer and create something simple, functional and easily maintainable than rush a project to a temporary state of completion.
Was This Post Helpful? 0
  • +
  • -

#12 milleja46  Icon User is offline

  • D.I.C Regular

Reputation: 3
  • View blog
  • Posts: 272
  • Joined: 17-December 09

Re: Write good code or get the job done fast?

Posted 08 January 2010 - 01:24 PM

You know all this is great to talk about. I know some people like neotifa might think i want to get things done fast. But the simple fact is it I know I CAN'T! Take one of my friends for example, it took him at least 4 months to learn c++ then even longer to put it to use and develop something. He recently uploaded a video of something he did with c++ and allegro, and it took awhile to do. You are one lucky person if it does not take you that long. You may know the language, but you don't know the language fully. You know what the code does but you may not be able to piece it together to a fully functional program, or webpage. So take your time. That's all i have to say here, and sorry if it offended but i think that is the cold hard truth.

This post has been edited by milleja46: 08 January 2010 - 01:25 PM

Was This Post Helpful? 0
  • +
  • -

#13 aceofspades686  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 6
  • View blog
  • Posts: 334
  • Joined: 08-October 07

Re: Write good code or get the job done fast?

Posted 08 January 2010 - 01:53 PM

I personally hate having to rush projects, but sometimes it has to be done unfortunately to keep a client. Far too many people want software written but have no idea of the process that goes into it, and seem to think its just "flipping some switches in the right order."

Typically, if I get one of these rush projects, I warn people of what they're asking upfront, and I typically charge a sizable markup.
Was This Post Helpful? 0
  • +
  • -

#14 erik.price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 485
  • View blog
  • Posts: 2,690
  • Joined: 18-December 08

Re: Write good code or get the job done fast?

Posted 08 January 2010 - 01:57 PM

Since almost all the code I write is for my own benefit, and not for school assignments or a job, I tend to take my time on it.

However, sometimes, I won't care about the end result at all, and will just hack something ugly together quickly.
Was This Post Helpful? 0
  • +
  • -

#15 SixOfEleven  Icon User is offline

  • using Caffeine;
  • member icon

Reputation: 945
  • View blog
  • Posts: 6,342
  • Joined: 18-October 08

Re: Write good code or get the job done fast?

Posted 08 January 2010 - 02:09 PM

As developers, we have a responsibility to write good code that will preform the way the end user of that code will expect. I believe that is something that we should stive for. I'm fond of the saying, "Just because you can do something with code doesn't mean that you should."
Was This Post Helpful? 0
  • +
  • -

#16 Theaegd  Icon User is offline

  • Hater & Lover

Reputation: -125
  • View blog
  • Posts: 944
  • Joined: 15-August 09

Re: Write good code or get the job done fast?

Posted 08 January 2010 - 03:15 PM

I say just take your time. Think about every line of code before writing it. Think about how that line will go with the one before and after. Do the same with your code blocks, and clases, and so on. Great, powerful, fully functional code is the key.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2