finding it difficult with programming
Turn on thread page Beta
Help on basic programming watch
- Thread Starter
- 28-02-2018 11:22
- 28-02-2018 16:53
Most people don't find programming easy when they first start - often the types of people who seem to find it "easy" on any course are the people who have done it before and maybe taught themselves at home or some other course before, so don't worry that you find it difficult; that's to be expected for anybody learning to program for the first time, you'll certainly not be the only one
There's really only one way to not struggle with it, and that's to keep on persisting with it, and practice until it starts to make sense.
The are usually two hurdles to overcome when first learning to program - firstly, there's the ability to understand the basic syntax of the language you're learning, including its "grammatical" structure, its keywords, and the usage of various symbols. Beyond that is switching your mind to learn how to "think" computationally. That means learning to look at problems in such a way that a computer can solve, particularly looking at problems from the perspective of conditional branching (for example - if/else or switch-case) and repetition (such as for, while, foreach). The only way to overcome either of these learning hurdles is to keep applying yourself to programming problems and trying exercises for yourself.
Whenever you have a problem to solve which looks too big or too complicated, then take a step back and stop trying to solve everything at once. The way to solve most programming problems is Divide-And-Conquer. That means you want to start out by reading/analysing it slowly (even read it multiple times) and identify tiny pieces of the problem which you can solve on their own, then attempt each of those tiny sub-problems one-by-one.
Whenever you're writing code, always re-run your program each time you make a small change - don't write a lot of code all in one go and hope that it works; the more code you write between each attempt at running the program, the harder it will be to see where you've gone wrong if there are any problems.
If you ever find yourself facing compiler errors, (or interpreter errors), or if you're just struggling to remember how to do something simple (e.g. how to read input from the user), make sure you use google. You learn by making mistakes, by finding answers to those mistakes, by looking at other peoples' examples related to the problem you're having to understand how and why they work, and by reading documentation/tutorials, then trying those examples for yourself to see how they work and tinker with those examples by yourself.
At every step along the way, you'll likely find that things "just work" when you're not quite sure why. You'll often make assumptions about your code, or about the language, and the tools you're using, and you may find out that those assumptions are slightly off, but the key to greater understanding is to check all of those assumptions and find out whether your understanding is right, or to go looking for answers when they're wrong.
Lastly, if you're writing code on your own computer, make sure you learn how to use the debugger in whichever tools you're using (for example, in Python using IDLE, or in Java using IntelliJ). A debugger is a quick and simple tool to learn, but allows you to "pause" or "step through" the execution of your program, in case something in that program isn't working properly - at which point you can inspect the variables and the flow of your program, to make sure that what it's actually doing matches what you expected it to do; if that doesn't match, then being able to see it in a debugger can often help you quickly recognise the problem.
- Thread Starter
- 04-03-2018 23:48