Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

program design and coding style

 
david russell
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey folks,
i was wondering if anyone has any tips on the best method of designing a program. i have a set of requirements and i know fuctionally what the program will do,im just not sure where to put the code, and what should be classes and methods and so on.
does anyone have any tips or preferences for designing/laying out of code?
all feedback is greatly appreciated
dave
 
Mark Herschberg
Sheriff
Posts: 6037
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a general programming question, I'm moving it to Java In General (Beginners).
--Mark
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whole books and entire courses are devoted to this topic, and you want it summarized into one post?
The standared answer is
- Look for the "nouns" and make classes out of those
- Look for the verbs and make methods out of those
But of course that is greatly simplified, and if you stick to that TOO closely you miss the big picture.
 
Jennifer Bhamoo
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I highly recommend that Just Java book (which JavaRanch also recommends).
I just happened to have that book before I started coming here and it explains everything very nicely. Do you have a programming background? I think this book may be a little confusing if you don't have any programming background, but not sure. Good Luck!
 
david russell
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey,
i do have a little experience writing java programs, especially for the j2me spec. ive found a good example of how to lay the code out now, i just have to get on with it!! any tips would still be appreciated though!
dave
 
David Duran
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're in no rush, writing out your program in pseudo-code, on paper always seems to help. Again, if you're in no rush, planning out the structure of your program, the type of data structures you might want to use, the logic, etc. is always helpful before you actually sit down and write code.
Of course, people depending on you for that program frown when you show them oodles of paper but not one line of code in a program, hahaha.
 
John Spindler
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am reading Jacquie Bakers Beginnin Java Objects and currently reading on how to layout static diagrams, sequences diagrams. All of this is being done in UML and I can't stress enough how much it brings your code together and the best part is while your modeling your code you can change it a billion times over without ever having to worry about reconstructing your code. If you model it writing the code will only take you time because everything else is already figured out!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic