Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Debugging
Index -> General Programming
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Martin




PostPosted: Fri Oct 15, 2004 10:33 am   Post subject: (No subject)

4. Pen and paper
Okay, we're almost at the actual programming, but this stage is essential. Get out a pad of paper and your favourite writing device, and on paper, figure out what it is you want your program to do. No, this doesn't mean just write code: make a flowchart, trace through what you want your program to do, and figure out how to. Sure, you'll end up scrawling down a few lines here and there, but for the most part it's just to make your ideas tangible.

For example, my current computer science project requires me to create a sparse matrix, that is, a matrix that is composed mostly of zeros. This SparseMatrix class has to be able to store the matrix efficiently, be able to transpose the matrix, and be able to multiply the matrix by either another SparseMatrix or a DenseMatrix (one not composed mostly of zeros). We chose to do this with linked lists, and, if you've used linked lists, you know that they can get confusing very easily. Out comes the trusty pen and paper, and we figured out an algorithm, and in no time, the program worked.

Basically, if you know what you are going to do before you start coding, it's much better than if you just figure it out as you go along.
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 16 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: