• Post Reply Bookmark Topic Watch Topic
  • New Topic

Standard code  RSS feed

 
Jr Morris
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have a really good book with lots of different tutorials. I want to play about making an application. I have three sets of code to do different things. I thought it would be fun to merge these three bits of code to do something quite basic. How much code is standard- ie how much code from two of the three can I ignore?
 
Surendra Kumar
Ranch Hand
Posts: 236
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How could anybody answer without knowing what three sets of code you are talking about?
 
Jr Morris
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Surendra, I'll explain further. One piece of code creates a window, I have code to control the window and I have code to print a message. What I wanted to know is which are the bits of code standard to all programs that only need to be in the application once-apologies if this is a frustrating question but I'm a novice.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jr Morris wrote:Hi Surendra, I'll explain further. One piece of code creates a window, I have code to control the window and I have code to print a message. What I wanted to know is which are the bits of code standard to all programs that only need to be in the application once-apologies if this is a frustrating question but I'm a novice.


Are you novice writing production code for a client? Or are all your coding really learning examples? If the later, I wouldn't worry about -- code reuse is a good idea, but while you are learning, doing things the hard way, and over and over again, is actually a good idea.

Henry
 
Ajitesh Shukla
Greenhorn
Posts: 4
Java PHP Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you got multiple block of codes, the key is to determine if they are doing just one thing. In another words, they are taking care of different concerns. If yes, it could be neat to use them to come up with a new set of features. Otherwise, there may be instances of duplication and other code smells coming into picture.
 
Jr Morris
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ajitesh
Last night I made good progress with the GUI part of Netbeans which I found quite easy to use. I found that it was pretty straightforward to use and very much menu driven. What did amaze me was after I'd finished and got the result I wanted I went into code view and there were hundreds of lines for something which only took me an hour or so to organise using the GUI. What sort of emphasis is put on the coding side of things in the real world? Obviously there is some but for something more complex there would be pages and pages of code.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!