Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hundred (1a) Stupid Question

 
Greg Harris
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
should i worry about how long the instructor's code is vs. my solution? i can produce the required output with 10 lines (no blanks, yet) but they say 20 lines...
i cannot see the need for anymore code here, but i do not want to turn it in and get blasted for screwing up such a simple program... i am converting from c++ so maybe that is my problem.
i saw the note that says their length is just a reference, but my code is 1/2 as long... does their length include comments?

[This message has been edited by Greg Harris (edited April 21, 2001).]
 
Michael Pearson
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the drive Greg!
I'm currently working on Java-4a Say.
Here's my take based on the nits I've had.
I think the size of the instructor's code is more relevant when your solution is noticeably bigger. The KISS principle is weighted heavily here, so if your solution is bigger you might be able to find a better initial solution.
As for Java-1a Hundred, my solution included 4 lines of comments in the way of the file Header, 4 blank lines, and 11 lines of code.
The goal of assignment Java-1 Hundred is to make you use the style guide. Watch your spacing!

Mike
 
Greg Harris
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mike,
thanks! i over-analyze everything, so i know i am making this more difficult than it is.
 
Marilyn de Queiroz
Sheriff
Posts: 9063
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I'm looking for is clean, elegant, easy to understand solutions. Focus on that. Not on line count.

The question is not stupid, and you are not stupid for asking it.


[This message has been edited by Marilyn deQueiroz (edited April 22, 2001).]
 
Angela Poynton
Ranch Hand
Posts: 3143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A tutor of mine once told me something that I have always held true since
There are no stupid questions, just stupid answers.
So ask away, no matter how stupid you think your question is, you can almost guaruntee that somebody else will also be wondering about the same thing.
 
Greg Harris
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks to all for the replies and encouragement!
by the way, i passed 1a on the first try... so on to 1b.
greg
 
Johannes de Jong
tumbleweed
Bartender
Posts: 5089
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1st try well done Greg
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic