7 Replies - 2891 Views - Last Post: 28 April 2011 - 03:04 PM

#1 Dogstopper  Icon User is offline

  • The Ninjaducky
  • member icon



Reputation: 2874
  • View blog
  • Posts: 11,047
  • Joined: 15-July 08

How to tackle large programming tasks

Post icon  Posted 25 April 2011 - 03:23 PM

This article explains some methods for tackling a large daunting project that I feel I should share:
http://www.dzone.com..._read_this.html

While I agree with a good number of those points, I rather disagree on the copy/paste part. I think that even if one cleans it up to "work", the idea of being able to copy code is a little tempting for many people who want to "just be done" with their app. IMO, not a good way to get started.

I also am not crazy about the "pragmatic solution". Sure it works, but is it extensible? 5 years down the road, could you easily take the current code base and make a major change/adjustment to it? That is the question. I ran into this very problem the other day with my JTomato API (accessed by my TomatoBrowser app). I tried to separate the project logically into API/App and it bit me rather hard. I had too closely intertwined the application and the API, and suddenly was too limited on JTomato. So I took a step back and restructured it to be the MC part of MVC. All you have to do is add the front end, and a few Controller parts. I definitely think that there is a fine line between a working solution and a perfect solution and one that "will do, and more".

Otherwise, what do you all think about the article? Does it bring to light many things that may have been unclear before?

Is This A Good Question/Topic? 2
  • +

Replies To: How to tackle large programming tasks

#2 sas1ni69  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 85
  • View blog
  • Posts: 431
  • Joined: 04-December 08

Re: How to tackle large programming tasks

Posted 25 April 2011 - 09:56 PM

Very nice read. I think it's only okay to copy paste your own code. If you know what you're copying then it's alright.
Was This Post Helpful? 0
  • +
  • -

#3 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 911
  • Posts: 3,178
  • Joined: 12-May 09

Re: How to tackle large programming tasks

Posted 26 April 2011 - 06:31 AM

Often (not always), if you're copying code, it's because you didn't think on a high enough level functionally.

The only strategy to solving large problems that I consciously employ is decomposition.
Was This Post Helpful? 0
  • +
  • -

#4 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 2042
  • View blog
  • Posts: 4,223
  • Joined: 11-December 07

Re: How to tackle large programming tasks

Posted 26 April 2011 - 07:13 AM

Depends what you are doing. Say you want to connect to a database, either you know how to do that or you don't. And if you don't, you don't have many options other than copy/pasting.
Was This Post Helpful? 0
  • +
  • -

#5 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 911
  • Posts: 3,178
  • Joined: 12-May 09

Re: How to tackle large programming tasks

Posted 26 April 2011 - 09:42 AM

View Postcfoley, on 26 April 2011 - 10:13 AM, said:

Depends what you are doing. Say you want to connect to a database, either you know how to do that or you don't. And if you don't, you don't have many options other than copy/pasting.

xclite said:

Often (not always),


Sounds good.
Was This Post Helpful? 0
  • +
  • -

#6 TomJoad  Icon User is offline

  • D.I.C Head

Reputation: 12
  • View blog
  • Posts: 54
  • Joined: 01-December 10

Re: How to tackle large programming tasks

Posted 28 April 2011 - 07:58 AM

I laughed at the rubber ducking.

Two days ago I got stuck on a problem that I just couldn't figure out and was turning to this board for some help. Well I typed out the whole thread, commented the hell out of the code, gave explanations for everything I was trying to do and each step in the code, and suddenly the problem and solution became clear! I then cancelled the post, but just trying to explain everything to someone else lead me right to my error.

I thought about in the future turning to my fiancée to explain it to, but she would just look at me with a "what the hell are you talking about?" face. Perhaps I'll employee Mario or Mecha-Godzilla, who live on my desk, for help.
Was This Post Helpful? 1
  • +
  • -

#7 Curtis Rutland  Icon User is online

  • (╯°□°)╯︵ (~ .o.)~
  • member icon


Reputation: 4525
  • View blog
  • Posts: 7,893
  • Joined: 08-June 10

Re: How to tackle large programming tasks

Posted 28 April 2011 - 02:53 PM

I almost never copy/paste code unless it's my own. I find that if I type it myself, and make small changes to non-essential things (like variable names), I force myself to understand the code. I tend to skim while I read. So it's easy to miss something critical if I just try to read the code before or after I copy it. Retyping takes some time, but I actually know the code by the time I'm done.

As to pragmatism, well, sometimes you can wrap yourself around the axle trying to find a graceful and elegant solution to a problem that doesn't lend itself to one. When sometimes, brute force is not only quicker, but more efficient when you consider effort vs. return. If this is going to be a solution that you'll be using down the road, then by all means, try to do it as elegant as possible.

But if it's a "throwaway", or it's just to fulfill a particular unique requirement, sometimes it's just better to do it the messy way and be done.
Was This Post Helpful? 1
  • +
  • -

#8 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6075
  • View blog
  • Posts: 23,540
  • Joined: 23-August 08

Re: How to tackle large programming tasks

Posted 28 April 2011 - 03:04 PM

Quote

I find that if I type it myself, and make small changes to non-essential things (like variable names), I force myself to understand the code. I tend to skim while I read. So it's easy to miss something critical if I just try to read the code before or after I copy it. Retyping takes some time, but I actually know the code by the time I'm done.


Curtis, that is EXACTLY what I do as well! Maybe refactor it a bit.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1