Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Review of Greenhorn Code?

 
Tina Parks
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • 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.
 
Marilyn de Queiroz
Sheriff
Posts: 9067
12
  • Mark post as helpful
  • send pies
  • 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.
 
Junilu Lacar
Bartender
Pie
Posts: 7793
62
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • 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: 9067
12
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
How about if I post the code and see? If so, in which forum?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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: 9067
12
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
Should I interpret the lack of responses as a good sign -- that there are no recommendations needed?
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • 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.
 
Nura Horne
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • 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
  • 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"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks, but I have had my fill of Swing.
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic