Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

easy or hard?

 
Andreas Slirig
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, i have a question.

I have studied java for 4 month top now and i am having this work book, but i think the assigns you get for each chapters i really hard!

Here i have done 1 assignment




So here is my question. is it simple code for you guys that have studied java?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is what simple? You posted some code, I don't see a question in there.

Dealing with source code that contains non-ASCII characters may not be hard, but it is certainly not common for at least 99% of developers out there.
 
Andreas Slirig
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ..

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.

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.

I am coding in TextPad, is there any program that i should use that is better for me when i am learning ?
 
Mack Wilmot
Ranch Hand
Posts: 88
Linux Netbeans IDE Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

I am coding in TextPad, is there any program that i should use that is better for me when i am learning ?


Use an IDE like NetBeans IDE here: http://netbeans.org/

It will help you out some.
 
Campbell Ritchie
Sheriff
Pie
Posts: 48968
60
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not convinced that IDEs help people when they are first learning.
 
Winston Gutkowski
Bartender
Pie
Posts: 10417
63
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

HIH

Winston
 
J. Kevin Robbins
Bartender
Posts: 1759
19
Chrome Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mack Wilmot
Ranch Hand
Posts: 88
Linux Netbeans IDE Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.


 
Winston Gutkowski
Bartender
Pie
Posts: 10417
63
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Winston
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic