|
|
#10 |
|
Kawaii Desu Ne?
Join Date: Dec 2007
Location: The Kawaiian Island~
Age: 32
Posts: 4,186
|
It's kinda hard to help considering the vagueness of the OP. So the only thing I can provide is some generic/vague suggestions:
-practice -If you get stuck, look at someone else's code (Google is your friend). When one first starts learning something, sometimes it's easiest to learn by imitation. Try copy/pasting some code and modifying it to suit your needs. If you do this though, make sure you go through the copied code line by line, and try to understand exactly how that piece of code is working. Eventually, you'll be good enough to where you don't need to Google them anymore (e.g. I would hope don't have to google "how to loop through elements in array" 30 million times before you can do it on your own). You can pick up a lot of things from someone else's code such as good coding patterns and good code styling (e.g. variable names, use of whitespace, etc). -Focus more on the algorithm/logic and the different paradigms in imperative and OO-programming as opposed to the syntax or memorizing function names in the Java standard libraries. Personally, I'm horrible when it comes to the latter (syntax and function names) but those are a quick google search away. The syntax will come naturally to you over time. -Learn how to read the official documentation. Tutorials and stuff can help, but sometimes you need to go directly to the source to get the information you need. For example, this is the official documentation for Java's String Class: here. -Learn how to effectively use your IDE. Make use of any code completion features and such. For example, for many IDE's, when you type a function call and start entering parameters, it'll tell you what the parameters are. -Comment your code. First, by commenting your code, it forces you to think about what the piece of code is actually accomplishing. Second, comments help for when other people (including future versions of yourself) have to read your code. -When trying to program, sometimes it helps to not jump straight into coding. In essence, you want to create an algorithm. In cooking, people call this a recipe. If you can write a recipe, you can code. First, think about how you would describe the algorithm ("recipe") to another person, in English terms. It can even be an algorithm that involves the other person using a paper/pencil setup. Now, for each step in the algorithm you came up with, clarify the step and/or break down the step into smaller steps such that every step is unambiguous. Once you have your collection of unambiguous steps, then they should easily translate into code. -Learn how to trace your code (by hand). Given a piece of code, you should be able to tell what the output is going to be. This is a good skill for debugging, especially for small test cases and edge cases. |
|
|
|
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|