• Post Reply Bookmark Topic Watch Topic
  • New Topic

Practicing Java  RSS feed

 
Mina Daoud
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,
We are always hearing that the best way to master coding it to do it (practice). I know some practicing websites such as top coder and project euler, but those 2 websites help practicing on algorithms (solving a problem within one method). I would like to ask you guys if you know practicing materials to build proper application hirarechy and structure?
like how to build application with reusable components and easy to be modify.

Thanks,
 
Stephan van Hulst
Saloon Keeper
Posts: 7993
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simply think of a project to work on for yourself.

A worked on a fair bunch of simple games, and they are great practice. Another example (if you want something more 'useful'), I worked on an application that shares large files between users, making sure that when the connection drops, the files resume after connection is re-established. This was because I got sick of Messenger starting over my big transfers. I'm sure there are tonnes of better solutions, but I thought it would be a fun way to practice Java.

I also wrote a program that interacts with my dad's train set, it sends commands over a serial port and automates all the train traffic, and receives information on the location of the trains. You can't imagine how excited I was the first time my program made a train move around

Just think of something you would like to do.
 
Mina Daoud
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stephan van Hulst wrote:Simply think of a project to work on for yourself.

A worked on a fair bunch of simple games, and they are great practice. Another example (if you want something more 'useful'), I worked on an application that shares large files between users, making sure that when the connection drops, the files resume after connection is re-established. This was because I got sick of Messenger starting over my big transfers. I'm sure there are tonnes of better solutions, but I thought it would be a fun way to practice Java.

I also wrote a program that interacts with my dad's train set, it sends commands over a serial port and automates all the train traffic, and receives information on the location of the trains. You can't imagine how excited I was the first time my program made a train move around

Just think of something you would like to do.


You are right, I have also loads of ideas, but the thing is when i start coding and building the application, how i can tell if i am doing it the proper structure, and good performance? How to make sure that i am building my application in a good standards?
 
Stephan van Hulst
Saloon Keeper
Posts: 7993
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You think you will be building it the best you possibly can. Then you find out you made a mistake, and you have to do everything over again.

Over time your judgment gets better, and you recognize bad situations better. But it won't come until you actually start doing it, and start making mistakes.
Don't be afraid of them. Also, don't worry about performance. In general, performance follows directly from good programming. Worry about it when your program is finished.
 
Mina Daoud
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stephan van Hulst wrote:You think you will be building it the best you possibly can. Then you find out you made a mistake, and you have to do everything over again.

Over time your judgment gets better, and you recognize bad situations better. But it won't come until you actually start doing it, and start making mistakes.
Don't be afraid of them. Also, don't worry about performance. In general, performance follows directly from good programming. Worry about it when your program is finished.


Yea but you know there should be some guidlines first, like if i am building a business logic component, i should write interface then implements it to make these functionality expandable and easy to be re-used. How i can learn these technique?
 
Stephan van Hulst
Saloon Keeper
Posts: 7993
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read lots. There are books on good programming practices, and some are specifically targeted on business logic. This material will improve your design.

However, don't be afraid of working on a problem without having the certainty you know exactly what you're doing. This is how you learn.
Every programmer has made poor design decisions at some point. Reading up on good practices will give you ideas on how to improve, or even redesign your application later.
 
Mina Daoud
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right yea, i think my main problem is that i am afraid to start doing a project because i don't know how to do it properly so i get disappointed BEFORE i even start!!

I thought sometimes to participate with a small group in an open source project, but don't know from where to start or begin!
 
Anthony Andras
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mina,

If you are looking for a good resource on design aspects of Java and you are fairly comfortable with the language, I would say pick up a copy of the Head First Design Patterns book. Throughout my career, I have read over this book several times and I always seem to pick up a new detail every time. It is an investment that will pay off for a long time to come.

I believe Stephan also touched on a very important concept: don't be afraid. While good design is important, I have seen several programmers fall due to over-engineering a solution. Most of all, have fun - it is when you are having fun that you will yield your most brilliant solutions.
 
Mina Daoud
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks so much for Anthony for your helpful reply, I believe my main problem is being scared and fearing bad design/solutions.
I am now preparing for the OCPJP, so whenever i am done i will go through Head first book.

Can you guide me if you know good open source project to contribute in? i believe its much benefits to work on open source project.

Thanks,
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!