Java Improving Your Java Programs - Tips & Resources

AI Thread Summary
In an AP Computer Science class focused on Java, a student seeks advice on enhancing their programming skills beyond basic functionality. Key suggestions include focusing on elegant design, consistent code formatting, and effective commenting. Emphasis is placed on utilizing object-oriented programming principles such as abstraction, inheritance, and polymorphism to create a robust object model. Resources recommended for further learning include Oracle's Java tutorials and Wikibooks. The discussion also touches on the perception of free software in the U.S. compared to other countries, highlighting that while some view freeware as less desirable, many organizations prefer it due to cost-effectiveness. The importance of exploring various Java frameworks and understanding core classes is also noted for a deeper comprehension of the language.
noagname
Messages
143
Reaction score
5
In school I'm in a class AP Computer Science where we learn java. In the past few weeks I have learned the basics of java which came very easy to me. Now I want to know what can I do to my programs to make them stand out? What should I strive for, least amount of lines or looks the best(we aren't learning Gui's.) Or is there something else I can strive for? Also if you have any good resources like these http://www.java2s.com/Tutorial/Java/CatalogJava.htm" that would be greatly appreciated.

Thank You

Here is my latest program, which was meant to just add two numbers but I added the dashes and the quit command to make it better.

-------------------------------------------
Please enter 2 numbers for me to add

Enter first number: 20.625
Enter second number: 21.375

Answer is: 42.0

To quit press 9 or press 1 to start over: 1
-------------------------------------------
 
Last edited by a moderator:
Technology news on Phys.org
Sun, now Oracle, has a good java tutorial as well:
http://download.oracle.com/javase/tutorial/index.html
(Interesting, my link was actually to sun.java but it got
mapped to oracle...what will they think of next?)

Wikibooks has a good java book too:
http://en.wikibooks.org/wiki/Java_Programming

Are you assigned specific problems in the class or do you get to invent stuff yourself? If the latter, find something to do in a field that interests you, making astronomical calculations, doing astrological charts, calculating parameters for your hot-rod engine...whatever. While doing assigned homework problems, aside from consistent code formatting and good commenting, I would concentrate on elegant design and algorithms. Try to decompose the problem into a good Object Model using Abstraction, Inheritance, and Polymorphism...see the wiki article for more: http://en.wikipedia.org/wiki/Object-oriented_programming

ps...I would change your adder program to use a "q" or some other non-numeric input instead of "9" to quit...
 
Devshed is one of the better resources for coding.

At this point in your education you should explore techniques with the technology. I am not a big fan of Java and the only reason it is widely used is because it was free. In the US free software is a big no-no, but globally developers like free tools even though you are giving away the code.

There are legal reasons why freeware is not embraced in the US, and it only becomes acceptable once a company like Oracle buys it. That is why everywhere else in the world they scratch their heads and wonder why freeware has not boomed in the US, like it has in Europe, India, and China.

But if you must use java, learn all of the flavors, awt, console, and jsp. Implement your code in all of them and you will learn alot.

Learn the core classes for each data type and how the operations are inherited. Understand typing to a science.
 
airborne18 said:
In the US free software is a big no-no

I disagree with that. Many corporations and government agencies prefer to use freeware. Getting the customer to pay for software that is freely available is not an easy sell. There has to be a very good reason to not take the freeware over something that costs money but does the same thing.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top