• How do I improve my programming.
    29 replies, posted
  • Avatar of Over-Run
  • Hey. So I'm doing a Computer Science course, so I should really be getting good grades in Programming, but it's my weakest subject. I just got my exam results today and I only got 32 in the exam. The exam covering everything from ArrayLists to binary tree's, and all that sort of stuff in between. The problem I have is that, I just find doing the exercises the course provides not that fun. I mean, they are all trying to help you get better in specific areas, like BinaryTrees or HashSets or something, but I'm just not as motivated to do stuff like that, even though I need to know it, I don't think the lecturer was as clear as he could be when he explains this sort of stuff. I mainly would like to eventually develop small Applications and maybe even in the far future games. I got the Head First Java book, and was going through how to do stuff like build a GUI and output music and stuff, and even when I was doing all of that, I had no idea how I would remember any of this stuff. Like in the book they provide the code and explain it, but it seems so complex for something as simple as playing a sound, that it sort of discourages me because I don't think I will ever get it. So I guess what I'm saying is, what is the best way to improve? I know I have to program to get better, but does anybody have any recommendations of good books or anything that could help understand stuff a bit clearer? I really want to get much better for my repeat exam, so I could happily come out of it knowing I passed it. Cheers boys.
  • Avatar of neos300
  • Books never really did much for me, I just wrapped my head around stuff till I figured it out. You have to be motivated to program.
  • Avatar of Octave
  • Start making extremely simple programs. As you progress, you'll know how to do things intuitively because you've done them so much. Then you can move on to more difficult things and incorporate all the little things you've learned into them and all of that stuff can act as a "foundation" of more complicated programs.
  • 1. Take no talent points charisma, medieval European folklore, or square dancing. 2. Put [i]ALL[/i] THE POINTS into strength, intelligence, computer science, and broadsword proficiency. And [i]that[/i], my friends, is how we min-max.
  • Avatar of uitham
  • [QUOTE=ROBO_DONUT;34736499]1. Take no talent points charisma, medieval European folklore, or square dancing. 2. Put [i]ALL[/i] THE POINTS into strength, intelligence, computer science, and broadsword proficiency. And [i]that[/i], my friends, is how we min-max.[/QUOTE] I don't know man, I am used to distribute the talent points across my skills so they are all the same
  • Avatar of DrLuke
  • [QUOTE=Over-Run;34744535]Hahaha. So any suggestions for those simple programs I should build upon?[/QUOTE] Pong, Tetris, Minesweeper, Calculator, Notepad
  • Avatar of Syngenetic
  • Man, I feel you. I'm pretty much on the same boat. Look..you won't learn anything if you do programming once a week or two. You gotta be constantly creating programs and code almost daily. It's like math. You start with Algebra and the more you do the better you get and eventually you move to trigonometry, Pre-Cal, Calc 1, and Calc 2. It's doable, so just focus and the more you do the easier it will become. Good luck!
  • Avatar of Over-Run
  • One of my friends made Pong in x8086 so I guess it couldn't be too bad. I think I will give it a go. Any good resources like books or websites or anything I should really take a look at?
  • Avatar of Over-Run
  • [QUOTE=zzaacckk;34753564]Go make a simple chat, pretty simple and will give you some experience.[/QUOTE] Oh really? Any links to tutorials on it or something?
  • Avatar of Over-Run
  • My main language is Java at the moment, we are learning C++ this year though.
  • Avatar of NPerez
  • Well, you can code without CS knowledge.. and likewise, you can be pretty good at CS concepts, but not so great at actual coding. It took me years to realize how much less valuable I am because I've never really focused heavily on CS. You can code up a bunch of demo apps for practice, but you won't necessarily need to apply any knowledge of algorithms & data structures. Once you start working on large-scale, complicated stuff that needs to be fast and concise, that's when you realize how useful it is to understand how to make every little piece of an app as efficient as possible. If you wait to learn CS concepts until you're assigned to a project where you really need to know your stuff, it's kind of embarrassing. It's not even that hard to learn - but I understand that it's hard to feel motivated when you don't know how you're going to apply it.
  • Avatar of Tony
  • I'm with you, binary search trees and hash tables are pretty annoying, easily one of the worst things I've had to learn so far in comp sci. It looks like after you get that stuff downpat though, the course gets a whole lot better. At the end of the day BST's and hash tables aren't something you'll use a shitload anyway. If you're good at your basic programming skills then you should be fine for the moment - it's far more important to get the basics down before you even bother trying to learn complicated algorithms or data structures like BST's. I guess if you got 32 though you might be missing the basics. For me textbooks are absolute shit for learning programming, so look up some videos and tutorials online. Your uni should have all the lectures up online as well. Here's the videos for my uni for my course that included hash tables/BST's, I assume you did a similar level course. [url]http://www.youtube.com/watch?v=aErYv5HyX8Y&feature=player_embedded[/url] All the other videos for the course are on that same channel.
  • Avatar of Over-Run
  • Yeah you see I don't know what would count as the basics, but I am fairly certain I know the basics. It's just that the exam was structured so we had to use the course material we learned such as writing a method for a binary search tree, and knowing Time Complexity' and stuff like that, so I'm basically looking for a way to get better at coding so when I have to sit my repeat exam I can make sure I don't fail it.
  • Avatar of Bambo.
  • Motivate yourself and make things that are fun to make, most of the time while creating simple programmes you learn a fuck-tonne of shit along the way.
  • Avatar of Over-Run
  • Yeah that's what I wanted to do but I'm not too sure where the best place to start is. I was thinking about making a simple alarm clock, but I don't know where I would start with that.
  • Avatar of Hentie
  • Buy some EasyMac and reward yourself after you finish an awesome project. Classically condition yourself to enjoy programming, no matter how difficult the concept is. Lol idk what I'm talking about, but I'm entering Computer Science next year and I'm wondering if it's actually as difficult as everyone says it is. I already know C++ and Java, but I have a feeling that CS might delve deep into the innards of assembly *shiver*.
  • Avatar of Over-Run
  • [QUOTE=Hentie;34785063]Buy some EasyMac and reward yourself after you finish an awesome project. Classically condition yourself to enjoy programming, no matter how difficult the concept is. Lol idk what I'm talking about, but I'm entering Computer Science next year and I'm wondering if it's actually as difficult as everyone says it is. I already know C++ and Java, but I have a feeling that CS might delve deep into the innards of assembly *shiver*.[/QUOTE] Yeah well our course does, we done the 8086 architecture and this semester were doing MIP64. Started C++ and are doing some Operating Systems stuff under Linux with C. Haven't touched too much on it yet.
  • ProjectEuler.net is a great place to start, if you enjoy math. It has 371 (?) math-related problems that you must solve using programming. Though you aren't require to program to get the answer, it is what is expected (sometimes you can do the problems on paper, or just google them). Depending on what methods you use to solve them, the problems can really help you better understand certain concepts with whatever language you use, and also helps make programming a bit more fun. As other people have said, though: If you don't already have a passion for programming, it's not really going to go too well. Personally, I love programming, it's my hobby :D If Project Euler is too much for you at this point, just start with simple things that don't require a gui, and then just build up. If you write enough code, you will retain it.
  • Avatar of Over-Run
  • I have seen Project Euler and I think a lot of it seems really hard. I enjoy programming, nothing beats the feeling of actually making something work, I just don't know how to get great at it
  • Avatar of Tony
  • [QUOTE=Over-Run;34775405]Yeah you see I don't know what would count as the basics, but I am fairly certain I know the basics. It's just that the exam was structured so we had to use the course material we learned such as writing a method for a binary search tree, and knowing Time Complexity' and stuff like that, so I'm basically looking for a way to get better at coding so when I have to sit my repeat exam I can make sure I don't fail it.[/QUOTE] Yeah you really did do a similar subject to me then, we did a lot on time complexity of algorithms. It seemed a whole lot more like discrete maths than programming, so I can see why you didn't go so well. Fortunately stuff like time complexity isn't super important to know - don't get me wrong, it's important to be able to choose the right algorithm for whatever set of data you have, but once you've chosen it, you need to actually be able to code it, which is far more important. To get better at stuff like time complexity/big-oh notation stuff, and binary search trees, I think youtube videos, tutorials, and textbooks will be the most helpful. For example, given a set of 10 ints and being told to put them into a BST is something that can be really easily taught by any medium since it's a pretty simple process. I'm not sure what sort of style questions your exam had/will have, but mine was split into two halves - content where you had to understand a concept, and where no coding was required, and then content where you had to code a solution. The concept sort of questions were like this one: [CODE] Question 2 (2 mark) The following alternatives list expressions for the worst-case time complexity T(n) of various algorithms. Which alternative has an asymptotic worst-case time complexity of O(n2)? [A] 1000.log(n) [B] 0.01n3 + 2n2 + 1000000 [C] 5n + 2n(n + 1) + 100 [D] n! + 5n2 [E] 2n + 5n2 + 3n + 1 [/CODE] There you don't need any knowledge of actually coding a solution, it's just understanding time complexity. If it's the coding of the solutions that you need to get better at, again, write small programs and work your way up, supplemented by tutorials and stuff. Questions like: [CODE] Question 6 (4 marks) In the space below write a function which reads an integer n using scanf, and then prints all the numbers from 1 to n in order, except not printing any number divisible by 7 or 3. You may assume that n is not negative. For example if n was 15 the output would be 1 2 4 5 8 10 11 13 The prototype for the function is: void printSome(void); [/CODE] Require some basic programming knowledge. It's just up to you to find out where you're at with your coding. TL;DR - I think you need to work out whether you're having trouble with coding solutions, or with just understanding the content that you simply need to understand and then memorise.
  • As others have said in this thread, it's best to start small. I remember when I was 12 or 13 (can't really remember when I first started programming), I ordered a book on game programming and dived head first into some really complex stuff. Obviously I shelved that book. However, I had a really strong ambition to take my ideas and put them into games. At first I started by altering textures of an games characters or objects. Then models. And finally, I discovered that my favorite game at that time (Mount & Blade) had an scripting interface for creating mods. That discovery changed my life completely. I scripted various games (especially Mount&Blade) until I got 15. At that point I decided to recover that old book ([URL="http://www.coderedgames.com/"]Programming a multiplayer FPS in DirectX[/URL]) and when I read that book and wrote code from it, I actually understood it completely. Of course, a lot of things were new, such as DirectX and polygons and what-not, but I was satisfied to understand the basic concepts. tl;dr I believe one has to acquire a programming mindset in order to start writing and learning more complex things.
  • Avatar of Over-Run
  • Thanks for the reply's guys. In the exams, we never had to actually give a Time Complexity and then code it, it would be more like, What would the time complexity of this be? And we would write in the answer. I know how binary search trees work, smaller numbers to the left, larger to right, it's more the coding of them I have trouble with, how you would make one actually work. We had to write a contains method I think it was in the exam, and I really had trouble with that, and we also had to write methods like that for stuff such as ArrayLists or LinkedLists. I had a lot of trouble grasping Nodes, and I still don't think I have a full understanding of it. I mean, I know how a stack and queue works, that's the easy part, it's actually the coding of it and grasping it that I find tricky.
  • Avatar of Tony
  • Yeah, same with my exam, if you can't get that stuff then it's not that you're a bad programmer/can't code, you just need to read and memorise more about the different algorithms and their corresponding time complexities. It's really just memorisation, there's very little understanding to be done with time complexity. I had huge trouble with Linked Lists in a first semester course as well, not sure why. This is the video my lecturer did which ended up teaching it to me: [url]http://www.youtube.com/watch?v=udapt4FGY20[/url] Hopefully it can help you too, LL's are pretty important down the track as you've seen with BST's and stuff
  • Avatar of Over-Run
  • Cool thanks I'll have a look at the video man cheers. Hopefully I can just wrap my head around it all
  • Avatar of PvtCupcakes
  • [QUOTE=Over-Run;34800853]Thanks for the reply's guys. In the exams, we never had to actually give a Time Complexity and then code it, it would be more like, What would the time complexity of this be? And we would write in the answer. I know how binary search trees work, smaller numbers to the left, larger to right, it's more the coding of them I have trouble with, how you would make one actually work. We had to write a contains method I think it was in the exam, and I really had trouble with that, and we also had to write methods like that for stuff such as ArrayLists or LinkedLists. I had a lot of trouble grasping Nodes, and I still don't think I have a full understanding of it. I mean, I know how a stack and queue works, that's the easy part, it's actually the coding of it and grasping it that I find tricky.[/QUOTE] I don't know what you're having trouble with specifically, but I wrote a Binary Search Tree in C about 6 months ago. I put it on pastebin if you want to have a peek. [url]http://pastebin.com/pnJ9h41U[/url]
  • Avatar of Over-Run
  • My problem was actually writing one. I understood how they work. But it was trying to think how the nodes and stuff worked in terms of actually writing code for it Thanks a lot for uploading that man I will have a look :)