Forums Register Login

Just picked up on java again

+Pie Number of slices to send: Send
And this is about all I can do. I took about a half year hiatus from Java, and want to get back in to it. I was programming to see what all I still knew, and this is it. So, how do you think I should continue programming? Completely restart? Or fill in the blanks to what I don't know? Lol, I'm sort of confused on how to restart learning. Feel free to critic this code if need be. ;)

+Pie Number of slices to send: Send
Get a good book, do a java refresher of things you already know, do lots of practical coding and you should be good.
+Pie Number of slices to send: Send
 

Trey Martin wrote:And this is about all I can do. I took about a half year hiatus from Java, and want to get back in to it. I was programming to see what all I still knew, and this is it.


Which suggests to me that you've either forgotten a lot, or you didn't get very far to begin with (and that's not meant as a criticism; simply an observation), because what you've written, although nominally a class, is actually a procedure.

Sorry if I sound harsh, but you did ask for opinions.

So, how do you think I should continue programming? Completely restart?


That would be my advice. Get a decent book (Head First Java is supposed to be pretty good) and start from scratch. You may find, as you go through it, that things start to come back to you, and that you can make quick work of the early exercises; but do do them.

Feel free to critic this code if need be. ;)


OK:
1. It looks like "stream of consciousness" code to me - ie, as if you simply started writing code to solve a problem, rather than sitting down with a pencil and paper, and designing your solution.
2. Big main() methods are almost always bad.
3. Any method more than 20 lines long can usually be broken up into smaller ones.

HIH

Winston
+Pie Number of slices to send: Send
It seems I should restart. Not sure where the line between beginner and intermediate is, but I do remember touching on inheritance and extending methods and other things like that. I'll take a look at Head Start Java, thank!

Edit: Winston, that's exactly what I did. I just added in things as they came back to me. I was going to add a GUI but I don't remember getting to that at all.
+Pie Number of slices to send: Send
Hope it's not too late to welcome you to the Ranch

If you are starting GUIs from scratch, you should probably go for JavaFX; here is a tutorial. There are doubtless other tutorials.
+Pie Number of slices to send: Send
 

Trey Martin wrote:Edit: Winston, that's exactly what I did. I just added in things as they came back to me. I was going to add a GUI but I don't remember getting to that at all.


And for a "restart" exercise that's probably fine; just don't make a habit of it. And, like I said, sorry if I sounded a bit harsh.

And a second tip for you (admittedly, a personal one): Steer clear of GUIs for a while yet.

They're verbose, finicky, and "focused"; and have a lot of "process" you need to know about to prevent things like "screen flicker", which have nothing to do with what they're actually there for; which is to display the contents of your program and accept input.

And in the early stages you can usually do exactly the same thing (albeit more clunkily) with System.out.println() and a Scanner.

My 2¢

Winston

[Edit] Oops. Totally missed it until Campbell's post. Welcome to javaRanch!
+Pie Number of slices to send: Send
Thank you for all the welcomes everyone! Winston, no hard feelings. ;) I am familiar with scanners, I used one at the very top of my code. Found a Head First book for Java on Amazon, I'll have it in 3 days. Can't wait to get started again!
+Pie Number of slices to send: Send
I hope you didn't pay full price for the book. There are so many second‑hand copies avaiable.
I'm not sure if I approve of this interruption. But this tiny ad checks out:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 800 times.
Similar Threads
Need help with Exception Handling
Erroneous sym type What does this mean?
Integer Object Comparision Confusion
display number xxx as "x x x " method
Having the user input numbers separated by commas
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 17:54:05.