Hello to All, Well, now I see that Cattle Drive experience will be tougher than I originally thought. I was triumphant when I made Java 1a to work in few minutes, but it turned out that 'making things work' is not the only goal around here . So right now I'm working on my first revision, and I'm struggling! Also, if I have a question re: e-mail and revision - do I reply in e-mail, or post my question on this forum? Thanks! Kamilla
Hi Kamilla! Welcome to JavaRanch! As far as asking questions, you should post them in the forum. It will help you fulfill your posting requirements and if any of us can answer your questions it will relieve some of the burden on the nitpickers. Have fun!
Joined: Mar 06, 2001
ok, so why having 100 array dereferences and 100 string concatenations when doing System.out.print within a 'for loop' creates a burden on the program? Can anyone give me a clearer picture? Thanks a lot.
It is an issue of optimization. When you do string concetenation you are creating a lot of unnecessary strings in memory. Strings are immutable, so each time you create a new one, you are creating more items in memory. If there is a way for you not to create all these extra strings, then you should do that. Same for arrays. If there is a way where you don't have to look up an item in an array inside of a loop, then you should do that. Bill
I remember my first real good teacher of code. He was a grizzled, stern professor at Purdue University. All of our assignments were graded based on 3 things: (1) functionality, (2) efficiency, and (3) style. The JavaRanch reminds me of the lessons I learned years ago. I'm grateful for the refresher course in real world programming while learning Java. When programming anything it is important to do it well. By learning the "gotchas" and avoiding them society benefits with greater efficiency. In an age of bloated code I for one hope to do my part by trying to continuously improve my coding techniques. Mike [This message has been edited by Michael Pearson (edited March 24, 2001).]