2 Replies - 442 Views - Last Post: 23 December 2012 - 02:01 PM Rate Topic: -----

#1 XxLegendxX  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 81
  • Joined: 10-April 12

Please Help I Don't Know What Wrong

Posted 23 December 2012 - 11:51 AM

Ok, I have been programming now for about two years or so. I started with VB.Net back in 2010 but I didn't like it because it seemed way too pointless and completely useless. So after about a week or two of trying to learn VB.Net I decided to switch over to C# and I learned a bit more about OO programming and basic programming stuff like variables and if else statements and other very basic stuff but after a month or so of that I didnt know where else to turn to keep learning it after the youtube tutorials ended. So I just decided to switch languages again and i start learning java this time because i found out that i wanted to develop for android, and i went out and got a beginner java book and learned it all and then i got a really comprehensive java book that was over a thousand pages and i started learning that but about six months into it i realized that at that point ive been learning java for over a year and still havnt got to the interesting things like GUI so i chose to downgrade to a much more easier language called python so i could see progress quicker. Ive been programming in python now for just over a month and i feel that i know most of the language but when i try to start making my own program from complete scratch in python i have no idea how to put everything together to make it do something useful that will work. I know how use variables, how to use classes, inheritance, constructors, methods, functions, overriding methods, loops, if statements, and a lot of other stuff but i just dont know how to put it all together into a program that will do something, i dont know where else to turn, please help.

Is This A Good Question/Topic? 0
  • +

Replies To: Please Help I Don't Know What Wrong

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4359
  • View blog
  • Posts: 12,176
  • Joined: 18-April 07

Re: Please Help I Don't Know What Wrong

Posted 23 December 2012 - 12:29 PM

Sounds like you are getting syntax overload. What I recommend you do is find some simple programs written in Python (since that is the language you are CURRENTLY using). Then try to build a few features onto it. In other words, grow it out. This will do a few things for you...

1) Give you a chance to practice without needing to start from scratch.
2) Teaches you about the structure of a program because extending something you need to first learn how it works.
3) Allows you to build incrementally and thus you are taking smaller bite size chunks at a time
4) Can give you immediate feedback. Add a few lines, run the program and see if that new feature works.

For example below is a simple letter grade program. It works in Python3 and can be the base to work from.

def letterGrade(score):
    if score == 5:
        letter = 'A'
    elif score == 4:
        letter = 'B'
    elif score == 3:
        letter = 'C'
    elif score == 2:
        letter = 'D'
    else:
        letter = 'F'
    return letter

def main():
    x = input('Enter a numerical grade: ')
    letter = letterGrade(int(x))
    print('Your grade is %s.' % letter)
	
main()



Try to make some changes to it. Here if I type in 4 I get a 'B'. What if I want it to be a range? How would I do it?

I want to add another function that allows me to collect multiple scores and then calculate the grade for each one. Put the scores in a list and then loop through the list, passing each score to the letterGrade function.

Things like this can help you grow out a program, gain some knowledge, practice what you learned, and help you understand how programs are built.

:)

This post has been edited by Martyr2: 23 December 2012 - 12:30 PM

Was This Post Helpful? 1
  • +
  • -

#3 BloodyInari  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 106
  • Joined: 16-November 09

Re: Please Help I Don't Know What Wrong

Posted 23 December 2012 - 02:01 PM

A trip of a thousand miles begins with a single step. If you aren't willing to commit to a language long enough to develop a fundamental grasp on it, as it appears to be the case with the past languages you seem to have attempted before, you won't learn anything at all.
Granted, some of them weren't necessarily the easiest of choices for a beginner but the point remains the same that you just got to keep at it; even if its just 30 minutes of tinkering or staring at old code, continue to try. Eventually bits and pieces will start to make sense to you and you will be able to actually do meaningful things with what you have learned.

We are unable to "magically" teach you to code, this is your own initiative and your own desire that allows you to do so. We can point you to websites and our favorite learner manuals and give you snippets to play with but its up to you to read and learn and try. We can help you figure out what is wrong with your code but we cannot and will not write it for you.

However on a lighter note, I would definitely recommend Python The Hard Way as it consistently reinforces those little things that make a programmer... well, a programmer. Very easy for a beginner as well and once you feel you've gotten a decent handle on Python, the author has also done other work on other programming languages like C.

[edit]:

Quote

1) Give you a chance to practice without needing to start from scratch.
2) Teaches you about the structure of a program because extending something you need to first learn how it works.
3) Allows you to build incrementally and thus you are taking smaller bite size chunks at a time
4) Can give you immediate feedback. Add a few lines, run the program and see if that new feature works.

Martyr2 brings up a good point. Learn to grow the program and become familiar with how each thing works and what will happen when you make a certain change here or there. Mastery isn't going to be overnight unfortunately. Just tinker some more and then find ONE thing that you don't understand and attack it, figure that thing out and repeat. That's a lot easier than trying to pick it all up at once and you will actually learn the syntax better this way.
Don't worry so much about getting a "useful" program as some much a functional program that is works for you. Polishing your work into that comes last.

This post has been edited by BloodyInari: 23 December 2012 - 02:14 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1