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?
How to tackle large programming tasks
Page 1 of 17 Replies - 2293 Views - Last Post: 28 April 2011 - 03:04 PM
Replies To: How to tackle large programming tasks
#2
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.
#3
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.
The only strategy to solving large problems that I consciously employ is decomposition.
#4
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.
#5
Re: How to tackle large programming tasks
Posted 26 April 2011 - 09:42 AM
#6
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.
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.
#7
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.
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.
#8
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.
Page 1 of 1
|
|

New Topic/Question
Reply





MultiQuote









|