• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Review of Greenhorn Code?

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have just started programming, and I would very much like to have someone review my code so that I don't compound mistakes when I modify it. Essentially, I want to know if I am making any fundamental mistakes that could hurt me later when I try to make the code more sophisticated. Is there a forum or service available? Can it be done here?
BTW, the code I wrote is short and easy to understand. And it compiles and works with no errors. But naturally that doesn't mean errors, or substandard programming, don't exist.
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Cattle Drive --
cattle drive
about the cattle drive
is the only service like this that I am aware of.
 
Sheriff
Posts: 17665
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Marilyn,
The Cattle Drive is now a fee-based service, right? Do you mean to say that folks can't post non-Cattle Drive related code here and get it nitpicked for free?
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
>Do you mean to say that folks can't post non-Cattle Drive
>related code here and get it nitpicked for free?

That is not what I intended to say. I had the impression that Tina was looking for more than what she can get in the regular forums by posting code here.

 
Tina Parks
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about if I post the code and see? If so, in which forum?
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If it's only a page or so I'd dump the code anyway
If it belongs somewhere else you'll find out.
(don't worry about the semi-militant nature 'round these parts, comes from giving ppl guns )
Dave
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This, Java in General (beginner), is a good forum to begin in.
 
Tina Parks
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, here is the code. It is designed to draw vectors with the mouse. I stripped it down quite a bit to shorten it, including the import statements. I am most concerned with the Canvas call (is there a better way?) and the drawRect() method I implemented in order to draw a border around the applet window. (There has to be a better way.) But most importantly, I am concerned about the overall structure -- I want a code that is robust. At any rate, thanks in advance. I loooove this forum!
__________________

(edited by Cindy to format code)
[This message has been edited by Cindy Glass (edited July 28, 2001).]
 
Tina Parks
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Should I interpret the lack of responses as a good sign -- that there are no recommendations needed?
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's just that we are in awe of your wonderful code, and don't want to sound stupid by critiquing it .
Actually it looks pretty good to me.
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yup, I lloked through it also and it has no errors in it that will be detrimental to programming more sophisticated works.
Good luck, A
 
Tina Parks
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Great!
I do have one question -- what about the rectangle? In the above code I explicitly tell the program to draw a rectagle to use as a border around the applet window. Is this preferred?
 
Cindy Glass
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well if you switched over to Swing and used a JApplet then you could have a BorderFactory and do cool stuff.
The sun tutorial:
http://java.sun.com/docs/books/tutorial/uiswing/misc/border.html
 
Tina Parks
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, but I have had my fill of Swing.
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, see, now I like Tina just for saying that.
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide
 
This parrot is no more. It has ceased to be. Now it's a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic