Andreas Slirig wrote:This type of code ^^, because i find it really hard do know what everything does. When i am doing an assignment i most always look back on each chapter all the time for every new thing i do ..
Well, you are kind of shooting yourself in the foot by:
1. Not documenting your work properly.
2. Not using good, descriptive names. Why, for example, are your Morse code strings called 'tab'? The only thing I get when I Google 'Morse code tab' is a bunch of music references.
3. Trying to be too "clever" when you're writing code, or trying to cram too much into each method.
For example, how about this, culled from your own toLetter() method:and with a switch statement (which, since version 7, now take Strings), it would probably be even easier to follow.
Obviously, if you wanted to add tons of accented characters, you'd probably need to find another way, but it's still going to have to be a different search from the one you use for plain letters, since there won't be any direct correlation from the index to the character.
Bats fly at night, 'cause they aren't we. And if we tried, we'd hit a tree -- Ogden Nash (or should've been).
Articles by Winston can be found here
Andreas Slirig wrote:
is it hard to train so you remember it all? because i am kind of an perfectionist when it is something that really interest me.
Yes, this stuff is hard. I spent at least six months locked in a room with a computer and a huge stack of Java books. I can't tell you how many times I told my wife "I'm just not smart enough to learn this stuff." But I did, through sheer determination. It takes a lot of patience and perseverance. Hang in there. And remember that you'll never remember it all. No one does. The important thing is to remember where to go and find the information you need. You'll remember the stuff that you use frequently, but the less common stuff you'll end up going back to the documentation when you need it.
Andreas Slirig wrote:
Is there any program out there that have all things remembered ? because i think withe the java api its hard to understand what they mean sometimes.
My complaint about the api docs has always been the complete lack of examples. This site is helpful because it provides some examples by Java class, and here is a page that explains how to read the api docs. I once found a site that took the all the official javadocs and added examples to them, but unfortunately I didn't bookmark and can't locate it now. If anyone knows that site, please post the link. It was very helpful.
Andreas Slirig wrote:I am coding in TextPad, is there any program that i should use that is better for me when i am learning ?
No, that's the ideal way to learn. Don't make the leap to an IDE until you have a better understanding of what you are doing, otherwise you'll become dependent on the IDE for things like autofill and compiling. When you are ready, I concur that NetBeans is the way to go. Save Eclipse for later.
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
Campbell Ritchie wrote:I am not convinced that IDEs help people when they are first learning.
NetBeans allows me to easily bring up the JavaDoc for an API class or member. It allows me to easily see members available if I don't know exactly what the name is or if something is available in the class. It is easier for me than flipping through a book or searching the Javadocs online.
Mack Wilmot wrote:NetBeans allows me to easily bring up the JavaDoc for an API class or member. It allows me to easily see members available if I don't know exactly what the name is or if something is available in the class. It is easier for me than flipping through a book or searching the Javadocs online.
And it also allows you to build and compile and jar without knowing the commands or even how the classpath works, which is exactly why it's not the best way to learn. Personally, I always have a copy of the API docs open in my browser, even after 12 years and even when I'm working in Eclipse.