Bad at Programming - Need to Improve

Discussion in 'Programming & Software Development' started by avexdevil, Apr 22, 2005.

  1. avexdevil

    avexdevil Member

    Joined:
    Aug 19, 2004
    Messages:
    2,114
    Location:
    Perth, WA
    This thread may seem a little awkward but here's my situation. I've always had an interest in computers, and wouldn't hesitate to try anything new that's related to computers. Even in high school, IT would be my strongest subject and I scored fairly impressive marks for most of my assignments. So it seemed a wise decision for me to choose to do a Computer Science degree when I got into uni. Well this is my first year, and I'm barely scrapping the first semester. I realise that I'm terribly weak in programming, we do haskell and java as core units for the course. The last few tests I did were horrendous, getting a 10/20 for my midsem test and only being able to do 3/6 questions for an inlab programming test. It seems as though my aptitude for 'computers' in general hasn't do me good at all.
    For all you experienced programmers out there, I was wondering whether you could give me any tips as to how I can channel my interest in computers to programming. Any tips to improve would definitely be most welcomed.
     
    Last edited: Apr 22, 2005
  2. xsive

    xsive Member

    Joined:
    Jun 29, 2001
    Messages:
    4,342
    There's no magic formula. The best way to learn how to code is to er.. code :p
     
  3. flightcrank

    flightcrank Member

    Joined:
    Aug 6, 2004
    Messages:
    744
    ^^ i second that, i leart more on my own than i did at uni. i was in the same siuation as yourself, i advise also to team up with a class mate, hang out own some n00bs in cs:s and then do some coding !
     
    Last edited: Apr 23, 2005
  4. Logistics

    Logistics Member

    Joined:
    Feb 7, 2003
    Messages:
    1,016
    Location:
    Sydney
    As already said only way to learn is code, code and more code.

    Download some java source code of something small/medium size but interests you and investigate the code, see how it works.

    Then think how you can improve even if it's just a button click and start writing it all from scratch :)

    At the end of the day you will definitely have learned something, and have the satisfaction of having a working program.

    This method worked for me.
     
  5. ktun

    ktun Member

    Joined:
    Jul 5, 2004
    Messages:
    123
    Location:
    Seven Hills, Sydney
    You need to have patience. Programming can be one of the most frustrating tasks even for experienced programmers. Just be prepared to spend most of the day in front of the computer screen and sometimes even screaming obscenities at it. ;)

    To start off, you need to start learning things outside the curriculum. It gives you the chance to "play around" with new code and a doing that will lead you to a whole lot of mistakes trying to compile and debug it. Dont worry though, making a mistake is one of the most important factors in the learning process. Think of it this way, everytime you make a mistake, you not only learn how to fix it, but also how to avoid making that mistake again.

    *edit* Don't forget to ask for help when you are stuck on something. You need more than google to understand some tricky concepts. And remember, pester the tutor as much as you can since there is no better time to talk one on one to someone about the subject matter.
     
    Last edited: Apr 23, 2005
  6. OP
    OP
    avexdevil

    avexdevil Member

    Joined:
    Aug 19, 2004
    Messages:
    2,114
    Location:
    Perth, WA
    I'm barely catching up with my work atm, I don't think I've time to check out other code and what not. Yes I believe being persistant is the key, but I have none of that :Paranoid:. I will have to work harder, but as someone sed before I'm spending a lil too much time pwning noobs in CS :). And yeah, I rather be browsing OCAU the whole day than to do any coding :weirdo:
     
  7. ktun

    ktun Member

    Joined:
    Jul 5, 2004
    Messages:
    123
    Location:
    Seven Hills, Sydney
    How about you lock yourself into your room, start going through all the previous weeks' labs and only go on the net to google up tips on programming? :p

    *Remember, CS and OCAU are things you can live without.
     
    Last edited: Apr 23, 2005
  8. Rolan

    Rolan Member

    Joined:
    Jun 27, 2001
    Messages:
    330
    Location:
    Sydney
    how about code, think, and more code.
     
  9. praiseB

    praiseB Member

    Joined:
    Dec 28, 2001
    Messages:
    6,489
    Location:
    Ferntree Gully
    You will find that alot of first year computing students will strugle with programing units unless they already have experience but by the end of the semester they will start to improve their skills. After that you will really build up an understanding of how programing works and as you move through your course you will find it gets alot easier and that it can be quite rewarding.

    And ktun is quite right about screaming obscenities at the computer. I have already spent 2 hours screaming at my current program over some polymorphism issues.
     
  10. OP
    OP
    avexdevil

    avexdevil Member

    Joined:
    Aug 19, 2004
    Messages:
    2,114
    Location:
    Perth, WA
    I just had a lecture on polymorphism...I had no idea wtf was going on haha.
     
  11. gumbi

    gumbi Member

    Joined:
    Jun 26, 2001
    Messages:
    326
    Location:
    Sydney
    What uni are you at?

    I found the best way to get good marks in programming was what the other guys said, to do it. It isnt something you can really cram like your other subjects.

    I never did any programming outside the cirriculum, unless i was really interested in it. I am not that motivated, but things like writing a webpage etc in php are all good practice.

    If only there were no other subjects at uni, then id have an awesome average :(
     
  12. Deltoid

    Deltoid Member

    Joined:
    May 24, 2003
    Messages:
    9,515
    Location:
    Brisbane
    Not much you can do man. Except practice, practice and practice some more. When I first started programming at uni (no programming experience before hand apart from html) I struggled first semester. But then I just started programming heaps of things just pointless little programs like calculators and stuff like that just to practice my skills.

    Its the only way to learn with programming. Also read guides on the net. If there is something in java or what ever you dont understand then google it. I do this all the time then read what the site has to say about it. Just 3 or 4 days ago I couldn'tuse the awk utility/programming language on linux which I needed for a bash script I'm doing. So I searched awk in google and now I can use it to do all bunches of stuff. While reading the sites I found I was making little tiny testawk scripts to put into practice what I was reading.

    Best of luck with it. I still suck at exams. I'm good at assignments and always get 85% or higher. But exams I always get around 55-65%. I just can't apply my knowledge in exams. But ask me to actually do the things they are asking in the exam and I can.

    Hehe yeah hell yeah. I get this alot. At the moment I've been programming a bash script when at home which is crazy and a pain in the arse because I have to use a linux text editor to program it (talk about pain in the arse) and then sleep then go to work and do more programming. Both are complex jobs at the moment so I've been wanting to keyboard slap my monitor all day.

    If thats the case then try working at night. I often don't start doing uni work till 11pm as I just can't concentrate before that. Then I usually just stay up till 5/6am the next day. I seem to always make awesome progress when I work through the night. I just can't concentrate during the day. Which is a pain in the arse when you have to work because you have to work during the day.
     
    Last edited: Apr 23, 2005
  13. OP
    OP
    avexdevil

    avexdevil Member

    Joined:
    Aug 19, 2004
    Messages:
    2,114
    Location:
    Perth, WA
    thanks for the replies/advice guys.

    @gumbi
    university of WA

    @deltoid
    i believe I work better in the night, but I feel sleepy before I can do anything productive :o


    I'm already trying hard not to return to the forums as much as possible while attempting some coding, but this week's lab is a killer, I don't even know how to do the pre-exercises before the marked lab!! This week's lab is on bloody arrays which I bloody suck at.

    Look at the first bit on this site if you are willing to help:
    http://undergraduate.csse.uwa.edu.a...index.php?where=labs&content=lab06/lab06.html

    "You can test all of these directly in BlueJ by literally typing in the array for the input parameter."

    what does that mean exactly??

    how do i do that!?

    eg. for public int sum(int[] a)
    i put it in as a method, then manually input something in between the [], but when i try to compile i obviously have to return something. WHich at this moment in time I don't know whether it's sum or a.
     
    Last edited: Apr 23, 2005
  14. munka

    munka Member

    Joined:
    Aug 1, 2001
    Messages:
    2,504
    Location:
    Perth
    Well, programming units at uni are my strong points. But i started young I guess you have to set yourself some of your own assignments. Make them interesting.

    I just had a unit where i had to write tetris in java, while it was a challenge and is a fairly advanced task i have to say i really enjoyed it.

    But my real key to learning a language is plain outright plagurism. Thats right, dont start by writing code, start with someone elses, see how someone that is a better programmer than you did it and then modify it to suite your needs. Once you have done it a few times you will have your own set of code of things you have written and know back to front and you can start plagurising yourself, if thats possible.

    You will not learn to program by reading a book, and to be fair the time spent in lectures would be much better spent tapping away on a keyboard.

    Good luck
     
  15. Deltoid

    Deltoid Member

    Joined:
    May 24, 2003
    Messages:
    9,515
    Location:
    Brisbane
    well just taking a guess here as your link to the lab exercise doesn't work. But I'd assume they want tyou to sum all the members in the array.

    So you want to loop through the array adding each element to the last. So something like this.

    Code:
    1. public int sum (int[] a){
    2.  int sumAmount; 
    3.  for (i=0; i<a.length()-1; i++){
    4.    sumAmount += a[i];
    5.  }
    6.  return sumAmount;
    7. }
    
    So basically.
    2. Declare a variable to hold the value of the summed amounts
    3. Loop through the array using i as a placeholder so you know what element in the array your up to. You want to keep i < the length of the array as arrays are indexed starting at 0. So if the array was [ocau, rocks, you] that is an array of length 3 with ocau at index 0. So you is at index arraylength-1.
    4. Is the same as saying sumAmount = sumAmount + a;
    5. end of loop
    6. return the sumAmount

    Basically hopefully that example helps you understand. I wont directly answer any other homework questions like that.

    I don't know about the BlueJ question. I havn't used BlueJ before.
     
    Last edited: Apr 23, 2005
  16. surfie

    surfie Member

    Joined:
    Dec 5, 2003
    Messages:
    426
    Location:
    Brisbane, 4116.
    Plan.

    I was shocking at programming (PHP, not C/Java, so a bit different but same techniques might work for you) up until about a year ago. I asked a mate who was fairly handy at programming and he just told me to think more. Think, plan, and look at how to solve the problem.

    I didn't get it at first, but slowly I started to develop ideas on paper first, using tree diagrams (many to work out events, if/else etc.). Slowly I started reading through the documentation and just looking at bits of source code and breaking it down so I understood.

    Somehow from there, I just started to pick up programming alot easier. It was just a frame a mind, as soon as I thought about what I was programming in a different way, I started to improve :)

    Good luck :D
     
  17. Deltoid

    Deltoid Member

    Joined:
    May 24, 2003
    Messages:
    9,515
    Location:
    Brisbane
    Totally, get out pad and pen before the keyboard. Even if its something simple (at this stage) write down in plain english what will happen and sort of order it in a programming sort of way. So for that code I put in my last post

    Code:
    int sum (int[] a){
      loop through array from start to finish
        add array element to the current sum
      end loop
      return sumamount
    }
    
    Then if your not too sure get out a pen and paper and deskcheck the logic. That is manually line by line step through your program writing down what the values of the variables are at each line your at.
     
  18. OP
    OP
    avexdevil

    avexdevil Member

    Joined:
    Aug 19, 2004
    Messages:
    2,114
    Location:
    Perth, WA
    thanks for the help... I'm pretty certain the URL does work.

    Code:
    public int sum(int[] a) 
    	{
    	int sumAmount; 
        for (i=0; i<a.length()-1; i++)
        {
        sumAmount + = a[i];
        }
       return sumAmount;
       }  
    
    sumAmount + = a;

    illegal start of expression.
     
  19. OP
    OP
    avexdevil

    avexdevil Member

    Joined:
    Aug 19, 2004
    Messages:
    2,114
    Location:
    Perth, WA
    i do that.
     
  20. Rolan

    Rolan Member

    Joined:
    Jun 27, 2001
    Messages:
    330
    Location:
    Sydney
     

Share This Page

Advertisement: