Improving Your Java Programs - Tips & Resources

Click For Summary

Discussion Overview

The discussion revolves around improving Java programming skills, particularly for students in an AP Computer Science class. Participants share tips, resources, and strategies for enhancing program quality, focusing on aspects such as code elegance, design principles, and available learning materials.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant seeks advice on how to make their Java programs stand out, questioning whether to prioritize brevity or aesthetics.
  • Another participant suggests using resources like Oracle's Java tutorial and Wikibooks, emphasizing the importance of elegant design and algorithms.
  • There is a recommendation to focus on Object-Oriented Programming principles such as Abstraction, Inheritance, and Polymorphism.
  • A participant expresses a critical view of Java's popularity, attributing it to its free availability and discussing the perception of freeware in the US compared to other regions.
  • Another participant counters the claim about freeware, arguing that many corporations and government agencies do prefer using free software.

Areas of Agreement / Disagreement

Participants express differing views on the acceptance and use of freeware in the US, indicating a lack of consensus on this topic. There is also a variety of opinions on the best practices for improving Java programs.

Contextual Notes

Some participants mention specific programming techniques and resources without resolving the effectiveness or applicability of these suggestions. The discussion includes personal opinions on the software industry and educational approaches, which may not reflect broader trends.

Who May Find This Useful

Students learning Java, educators in computer science, and developers interested in programming best practices and resources.

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 a lot.

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.
 

Similar threads

Replies
8
Views
3K
Replies
1
Views
2K
Replies
3
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K
Replies
3
Views
3K
  • · Replies 6 ·
Replies
6
Views
6K
  • · Replies 5 ·
Replies
5
Views
2K