Building a Program...

Started by
3 comments, last by larsbutler 12 years, 3 months ago
I went through the book "Head First Java" and my experience was great. I learned how to do GUI's, how to catch expressions, all this awesome stuff in the Java programming language. I had videos on the internet such as Stanford's free Java course. I also had help from the tutorials from MyBringBack and TheNewBoston on YouTube. As I said it was a amazing experience, I loved going through all the stuff learning how a computer worked and how building your own programs no matter how small is amazing. You think it's your baby. <3

But here lies the issue...I know the syntax, I know what the syntax does...but how do you put it together? How do you put it together in a way where someone can tell you to build a game of Pong and you can then sit down at your computer and in two hours have a fully functional game of Pong. How do you sit down and say, "oh! I want to build this and do this."? I'm rather confused in this area.

Like I said, I know the syntax, I know what the syntax does, but I don't know how to put it together. I can read other peoples code and understand what they did, but not how they sat down and just did it.

Any advice for a new (Java) programmer?
Advertisement
Find something you want to do, and figure out how to do it. After a few years of practice it'll be second nature
Okay, do you mind pointing me in the right direction to learn collision. Collision for like something like Pong?

Okay, do you mind pointing me in the right direction to learn collision. Collision for like something like Pong?


Try to break it down a bit,

What exactly is a collision ?

* a colission occurs when two objects touch eachother
(How can we check this ? What do we know about our objects that can help here ?, Do we need to add more information to our classes ?)

* When we detected a colission, what do we want to do about it ?
(Its pong, the ball is the only thing that actually reacts to colissions, how should it react when it hits a wall ? What about the paddle ? should we treat it as a moving wall or do we want to adjust the angle of reflection based on how far from the paddles centre the ball hits ?)
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

I went through the book "Head First Java" and my experience was great. I learned how to do GUI's, how to catch expressions, all this awesome stuff in the Java programming language. I had videos on the internet such as Stanford's free Java course. I also had help from the tutorials from MyBringBack and TheNewBoston on YouTube. As I said it was a amazing experience, I loved going through all the stuff learning how a computer worked and how building your own programs no matter how small is amazing. You think it's your baby. <3

But here lies the issue...I know the syntax, I know what the syntax does...but how do you put it together? How do you put it together in a way where someone can tell you to build a game of Pong and you can then sit down at your computer and in two hours have a fully functional game of Pong. How do you sit down and say, "oh! I want to build this and do this."? I'm rather confused in this area.

Like I said, I know the syntax, I know what the syntax does, but I don't know how to put it together. I can read other peoples code and understand what they did, but not how they sat down and just did it.

Any advice for a new (Java) programmer?


The problem you are having is not a programming problem, per se. The problem you are having is an _analysis_ problem. All programs (not just games) are complex and abstract. You've learned some syntax; that's the first step. Now you need to learn how to break down a large abstract idea into small, simple, and more manageable pieces.

To use a painting analogy: You've learned how to mix paint. You've learn about the different brushes. You know how to apply to paint to brushes and even smear a bit of it on the canvas. Now is where the real work begins. You need to learn techniques and styles. You need to study art (programs) which other people have created. You also need to learn how to "see". (The most important lesson I learned from taking an art class is that art is _not_ about knowing how to apply ink to paper or paint to canvas--it's about knowing how to see.) If you want to paint a sunset, you have to break it down in small manageable problems: a line here, a curve there, red here, orange there, etc. In order to do this, you have to _see_ the sunset as a collection of lines, curves, colors, etc. The same goes for programming. You have a grasp of data types, objects, loops, control flow (if/else), and so on. These are the primitive materials available to you. Now you need to take your complex idea and figure how to express it with the right combination of the primitives that you know.

This topic is closed to new replies.

Advertisement