Login Register






java question filter_list
Author
Message
java question #1
hello all i just wanna ask this question it might look silly but it's important to me !!
so you have a project what i want to ask is how should i start working on it how to think about it from where to start ?
should i start by thinking of the methods i need to use and working on them then working on my main ?
[Image: blackeagle_zps6ad86521.gif]

Reply

RE: java question #2
If you have an idea, you could write in on a paper and develop it there.
Also you can write some pseudo code before you start the 'real' coding.


Reply

RE: java question #3
@Slarek pseudo code ? what does it mean ?
[Image: blackeagle_zps6ad86521.gif]

Reply

RE: java question #4
Personally... I make a plan first of what I want the program to achieve, and roughly how im going to achieve it.

from there i start with my main method. Thats where most of my coding is done. I only determine what methods are needed as i need them. I tend to start coding in the main, and then when i realize that a piece of code is better off in its own method, i move it down.

Not saying thats the right way, but thats the way ive always done it. I dont see a point in planning out methods because your going to determine that youll need more than you planned for, or end up not using them.

Reply

RE: java question #5
Two links to help you understand:
http://en.wikipedia.org/wiki/Pseudocode
http://www.unf.edu/~broggio/cop2221/2221pseu.htm


Reply

RE: java question #6
well that's what i used to do !! i worked like this in my rock paper scissors project !!
but i'm not sure if making a plan b4 figuring what methods i need starting by methods since i'm gonna need thm in my main in staid of working on main then changing my code t methods that will take more time !!

@Slarek thank you i understood it's like a shortcut code !!
you right everything but not fully coded !!
you make them better when you start the work on you're project !!

but still i need every1 else opinion to see what's the best way !!
(This post was last modified: 11-11-2013, 01:37 PM by LordPankake.)
[Image: blackeagle_zps6ad86521.gif]

Reply

RE: java question #7
(11-11-2013, 01:35 PM)blackeagle Wrote: well that's what i used to do !! i worked like this in my rock paper scissors project !!
but i'm not sure if making a plan b4 figuring what methods i need starting by methods since i'm gonna need thm in my main in staid of working on main then changing my code t methods that will take more time !!

everyone has their own preference. i find its easier to follow code if its written together. Now if i know a piece of code is going to go in a method ill write the method straight up, usually. but i dont worry about it too much. I dont find moving code around too time consuming.

Reply

RE: java question #8
well thx guys Smile i would like to know what @Deque thinks about this !!
[Image: blackeagle_zps6ad86521.gif]

Reply

RE: java question #9
Uff. That's a hard question, because I find it hard to explain.
I don't do any pseudocode or anything on paper beforehand (unless I am stuck). I plan the structure of the code in my mind and I keep refactoring the code while working on the project. Usually I only realize what should be done after working on it for a while. I don't think you can -- for large projects -- plan everything beforehand. I do one step and afterwards I think about the best way to implement the next step.
Usually you would think about separation of concerns. Everything that belongs together (semantically) should be kept together, i.e. in one class, one file or one package.

Quote:should i start by thinking of the methods i need to use

I can't tell you how you should do it.
I don't think in methods. I think about a problem and divide it into steps.
Then I start working on a step. If that step is too large for a single method (or class or whatever scale you are at that point), I divide the step in further smaller steps and so on. So the methods just occur in the process when I see one method will be to large for everything or that I could reuse that code piece later.

The more you code and the more experience you have, the more you will write well structured and flexible code. That comes with experience. It's nothing you can just adopt from me explaining to you how to do it.

One thing that helped me a lot in object oriented programming was the understanding of design patterns. Get a good book about it and try to see where you can implement these and understand where it makes sense to use them and where it doesn't (in case you do OOP).
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.

[Image: 2YpkRjy.png]

Reply

RE: java question #10
(11-11-2013, 03:08 PM)Deque Wrote: Uff. That's a hard question, because I find it hard to explain.
I don't do any pseudocode or anything on paper beforehand (unless I am stuck). I plan the structure of the code in my mind and I keep refactoring the code while working on the project. Usually I only realize what should be done after working on it for a while. I don't think you can -- for large projects -- plan everything beforehand. I do one step and afterwards I think about the best way to implement the next step.
Usually you would think about separation of concerns. Everything that belongs together (semantically) should be kept together, i.e. in one class, one file or one package.

Quote:should i start by thinking of the methods i need to use

I can't tell you how you should do it.
I don't think in methods. I think about a problem and divide it into steps.
Then I start working on a step. If that step is too large for a single method (or class or whatever scale you are at that point), I divide the step in further smaller steps and so on. So the methods just occur in the process when I see one method will be to large for everything or that I could reuse that code piece later.

The more you code and the more experience you have, the more you will write well structured and flexible code. That comes with experience. It's nothing you can just adopt from me explaining to you how to do it.

One thing that helped me a lot in object oriented programming was the understanding of design patterns. Get a good book about it and try to see where you can implement these and understand where it makes sense to use them and where it doesn't (in case you do OOP).

I think this sums up what i was trying to say quite well. Its a difficult process to describe as much of it just comes naturally with experience. You just sort of "know" when something you are about to code, or have just started coding, should be in its own method, class, etc.

Reply