Bear Bibeault wrote:Heh. I didn't make it past line 12. The very fact that you have a class named ReadTextFile is a problem. Classes model things, not behaviors.
Etch-a-sketch everything and grab a pencil and paper and write down what you are trying to accomplish. Underline the nouns. These are the candidates for modeling via classes, not the verbs.
Does that change your approach?
Bear Bibeault wrote:mTrim? setIn? setIg? setIh?
These names are meaningless.
Another tip: meaningful names help to make code understandable.
It's hard to recommend a good way to approach something when what that something is trying to do is masked by poor names that obscure the meaning.
Consider the difference in readability between: and
Chuck Beauregard wrote:With all do respect, give me a break. [...] if a person can read Java's gibberish they should be able to figure out that "setIh" is setting the index of the Handicap column.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Any idea where that quote is from. I googled it and didn't find its origin.fred rosenberger wrote:"Always write code as if the next person reading it were a homicidal maniac who has your home address". . .
Campbell Ritchie wrote:Any idea where that quote is from. I googled it and didn't find its origin.
There’s a saying we have in the software world, and it will serve you well to remember it while building your Developer project: "Code as if the next guy to maintain it is a homicidal maniac who knows where you live."
Jeff Verdegan wrote:
You have asked people to volunteer their time to help you.
One of those people volunteered his time to try to help you, and gave you a suggestion that would A) in the immediate term make it easier for him and others to provide that help you're seeking, and B) if developed as a habit, make it easier for you and others (such as teammates or those whose help you may seek in the future) to understand the code that you write in general.
You then dismissed that suggestion out of hand, and told your would-be helper what he "should" do, in a rather rude tone.
That approach is not likely to encourage people here to want to help you.
Chuck Beauregard wrote:
Thank you for your feedback. Point taken.
[...]
My apologies to "Bear".
Users will need to enter their current membership roster with handicap data to start the program. This data is available from an independent (very independent) source called GHIN. GHIN has standard reports for each club, which are not very standard at all, and are NOT modifiable. These reports can be exported in a number of ways, Excel, Text, PDF to name a few.
The issue is the report has a header of varying sizes, it could be 1 line with only "Name", "H.I." and "GHIN" or a subset of them, OR the header could be several lines long. I seen examples with 8 lines of header and footer. These headers appear on each page of the report. In addition the space between the informational column is random. To be effective my program must handle all of them seamlessly.
Chuck Beauregard wrote:The fact that Java passes values in most cases and reference in others is starting to sink in.
Chuck Beauregard wrote:While my programming days were most likely before you were born and the overhead to call Functions and Subroutine was of concern, I still used them extensively to make the code readable.
I think my current issue is getting a better grasp on the movement of data from the various combinations of classes, methods, packages, objects, instance variables, arrays, lists, parameters, interfaces etc..
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Chuck Beauregard wrote:My apologies to "Bear".
Winston Gutkowski wrote:[And I doubt very much if you were programming before I was born.
Chuck Beauregard wrote:I love the idea of reusable code. The issue is finding what you need in the sea of stuff is somewhat overwhelming. I'm currently off to reread about the Collections Framework in general and <List> specifically.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:A few other things come to mind as advice for a procedural bod such as yourself:...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|