• How can I get better?
    11 replies, posted
Hey everyone. I am doing a Computer Applications degree in college, and basically I did this degree because I would of liked to try become a games programmer out of it. When we started off it was fine, I understood most of it, but when we hit arrays, things started to not make sense for me. I know many of you would know find this sort of stuff simple, but when we started semester 2, we were doing classes and I was confident enough with it, but once we started revision on arrays my confusion just started again. I want to know if there is ways I can train myself to think more logically, because when for example our lecturer shows us his code for a program, for example, making a magic square (A square where all numbers across or diagonal all add up to the same number), he would have stuff like if(j%2==0) and I know that this code would look laughably easy to some of you, but I just can't get my head around the logical thinking of if the modules is 0 and all that sort of stuff. Is there any advice on how I can hone my programming skills? Any websites out there where you are given easy problems to start with and gradually get better? Or just some really good tutorials? Would appreciate any feedback, cheers.
Experiment. Make stuff that requires the use of whatever it is you don't understand, let the debugger teach you.
Probably not the best places to start off with, but for programming 'tests' or challenges there's [url]http://www.spoj.pl/[/url] and [url]http://projecteuler.net/[/url]. As for learning to understand things - I'm not sure how hard it is to learn, as such; I seemed to be able to know what was going on without teaching, so I can't really say. You could try thinking things through in your head, such as how if statements work and what the logical operations inside the brackets do, and their order. As you seem to have particular difficulty with arrays, is there any specific section of arrays that you find confusing, or the topic as a whole? Before I'd started programming, I hadn't heard the term array used at all, so that was a bit confusing to me. Realising an array was more or less the same thing as a list helped me to understand the basis of arrays, and how they operated - accessing indexes, insertion\removal, etc. Your example of a magic square sounds like it would be a hard project to understand without writing yourself, so I suggest getting a pen and some paper and drawing up some squares of various sizes and jotting down how you find out the sum of each side, row, etc. Rewrite it in terms of the x component and the y component, then try and generalise that into something you can implement with a for loop or equivalent in code. Hopefully this is of some assistance to you :smile: [editline]29th March 2011[/editline] [QUOTE=Dr Magnusson;28871699]Experiment. Make stuff that requires the use of whatever it is you don't understand, let the debugger teach you.[/QUOTE] This too. It doesn't sound like the greatest advice at first, but I pretty much learned how to program solely through the errors that various compilers and interpreters bitched at me incessantly. The story I often relate of learning C# after using VB.NET for an eternity was simply typing crap, pressing build, changing a character, pressing build, repeat etc. and noticing when the highlighting wasn't doing what I expected. So just experiment with stuff, google [b]everything[/b] and you should get a pretty good start. One of my friends, who has some skill with programming, dislikes this approach - and as a result is constantly asking me for help with things or what the argument order of xyz function is. My response is invariably the first result on Google. If you're in a similar situation, skip the middleman and head straight to the search box yourself - chances are someone else has already had your problem and found a solution.
As bad as it is, [url='htt[://www.codingbat.com/']CodingBat[/url]. It's in Java, but it's similar enough.
[QUOTE=mechanarchy;28871910]Probably not the best places to start off with, but for programming 'tests' or challenges there's [url]http://www.spoj.pl/[/url] and [url]http://projecteuler.net/[/url]. As for learning to understand things - I'm not sure how hard it is to learn, as such; I seemed to be able to know what was going on without teaching, so I can't really say. You could try thinking things through in your head, such as how if statements work and what the logical operations inside the brackets do, and their order. As you seem to have particular difficulty with arrays, is there any specific section of arrays that you find confusing, or the topic as a whole? Before I'd started programming, I hadn't heard the term array used at all, so that was a bit confusing to me. Realising an array was more or less the same thing as a list helped me to understand the basis of arrays, and how they operated - accessing indexes, insertion\removal, etc. Your example of a magic square sounds like it would be a hard project to understand without writing yourself, so I suggest getting a pen and some paper and drawing up some squares of various sizes and jotting down how you find out the sum of each side, row, etc. Rewrite it in terms of the x component and the y component, then try and generalise that into something you can implement with a for loop or equivalent in code. Hopefully this is of some assistance to you :smile: [editline]29th March 2011[/editline] This too. It doesn't sound like the greatest advice at first, but I pretty much learned how to program solely through the errors that various compilers and interpreters bitched at me incessantly. The story I often relate of learning C# after using VB.NET for an eternity was simply typing crap, pressing build, changing a character, pressing build, repeat etc. and noticing when the highlighting wasn't doing what I expected. So just experiment with stuff, google [b]everything[/b] and you should get a pretty good start. One of my friends, who has some skill with programming, dislikes this approach - and as a result is constantly asking me for help with things or what the argument order of xyz function is. My response is invariably the first result on Google. If you're in a similar situation, skip the middleman and head straight to the search box yourself - chances are someone else has already had your problem and found a solution.[/QUOTE] Really appreciate the answers. Yeah I have heard of Project Euler and have had a look at it. As for the difficulty with the arrays, it is just the fact of storing things, if I should be storing them in separate arrays etc, for example, one program asked us to input many names in the format: 12356778 John Smith maths computers stats Now there would be many of these and it would want us to organize it by name, and what subjects the students do and put them in group. I wouldn't know if you would need a separate array for the int and the strings, this sort of thing confuses me, and I would never know how to do stuff without being showing it really!
[QUOTE=Andy;28874835] As for the difficulty with the arrays, it is just the fact of storing things, if I should be storing them in separate arrays etc, for example, one program asked us to input many names in the format: 12356778 John Smith maths computers stats Now there would be many of these and it would want us to organize it by name, and what subjects the students do and put them in group. I wouldn't know if you would need a separate array for the int and the strings, this sort of thing confuses me, and I would never know how to do stuff without being showing it really![/QUOTE] If you were to use an array here, it would be an array of objects (struct or class instances etc., depends on your language). To organize by name though, you wouldn't usually use an array, but instead a map of some sort.
I can quickly explain modulus for you if you need it: Do you remember in early school when you first learned division without decimals? Like 5/7 = 1 and 2 leftovers. That is modulus: 5%7 = 2 while 5%5 = 0
[QUOTE=Zyx;28875117]I can quickly explain modulus for you if you need it: Do you remember in early school when you first learned division without decimals? Like 5/7 = 1 and 2 leftovers. That is modulus: 5%7 = 2 while 5%5 = 0[/QUOTE] Oh no I understand what the modulus is and all that, I appreciate your help, but what I mean is that, I would never, while coding, think to use the modulus, that is what I mean, I don't have that sort of logical thinking you need with programming.
You don't understand it because you don't do enough of it. When I first started I was the same, when somebody mentioned using a table my fingers turned to jelly. Then one day it just clicked, and I was enjoying it. But it won't click if you don't try, so keep at it. Ask people, read books etc. like everyone else. And an example for the modulus thing I guess would be.. if you had cakes that you wanted to sell, but you could only sell whole cakes you'd use modulus to find out whether the cake is whole or not. You'd loop though an array of cakes. Cake1, Cake2, Cake3. Only cake 3 is whole. Pulled that out my arse so if it doesn't make sense just ignore it and rate me dumb.
Ah well it is good to know I am not the only person who found the logics of programming hard. I already have a book called Head First Java, which is pretty good, but I stopped reading it because once I got to classes in it, for some reason the code wouldn't work, and then when I got to the battleship game section I just didn't understand it at all. It made me sad.
[QUOTE=Agent766;28872460]As bad as it is, [url='htt[://www.codingbat.com/']CodingBat[/url]. It's in Java, but it's similar enough.[/QUOTE] Wow, that site has some pretty good practice problems on it. How is it bad?
I mentioned it in an IRC chat and they all 'rada rada that's shit blah blah'. Not sure of their reasoning though. We were supposed to do about 25 problems for my Intro to Computer Programming class. I'm at 225. I can't get my head around recursion :smith:
Sorry, you need to Log In to post a reply to this thread.