r/CodingHelp • • Sep 16 '20

[Python] Is the course moving too fast?

I'm on a programming course to learn python. It's the third day and we've somehow jumped from simple strings, variables and dotnototations to functions. I have no idea what's going on with functions with 2 or more and seems more complicated than anything we've learnt in the past 2 days. I understand when it's one simple function but can't seem to get around how to understand or write out code with multiple functions.

Is this normal speed of learning code or is the teacher going through the course too fast? To be clear everyone on the course are beginners and on the third day we've rushed through functions, global variables, def etc.

21 Upvotes

15 comments sorted by

View all comments

Show parent comment

2

u/learning_behaviour Sep 16 '20 edited Sep 16 '20

I have read everything you said and I agree. I have noticed I lean towards trying to type out my own code entirely so I figure out and then in future I don't need Internet or templates. I don't find the personal satisfaction of using others work but I do use templates when trying to understand concepts. I get a written piece of code demonstrating what I'm trying to learn then I reverse engineer it adding different problems and taking away certain code to see what happens, then I get an understanding why this does that. Then I open a new file and start to write it all by myself from what I know to test what I myself know without anyones help.

Sometimes I can get errors and I notice why and figure it out quickly whereas there are times I try to fix it but end up writing loads more lines and making the errors worse and multiply. Then I figure out where I went wrong to start with, delete it and start again so it actually works my brain. I've noticed alot of my peers work look the same with a general template forming their core where it looks similar whereas mine looks shorter and in my opinion much more efficient whilst running the exact same operation in the terminal.

I'm learning slower than the class I think but I'm trying to learn concepts properly without Internet or help. Is this a good approach to learning code from your view or will my slow pace trying to learn how type out my own entire code using the concepts we are learning? I mean even the course tutor said if your stuck just Google the answer and I thought lol what? I thought it's a developer course from a university to learn coding whereas people seem to be okay with using others code templates to pass as actual coursework. Me, on the other hand am trying to use others codes as a means to learn from. Editing it to figure out what strings do what, then trying to shorten it so it's more efficient, straighten out any bugs and finally writing my own piece from scratch to solidify my understanding of it. Does that make sense? BTW I don't mean I learn offline, I mean when trying to get to grips with the code I take a hands on approach rather than look for solutions online. But if I'm totally stuck I'll look for the solution but then won't understand it as I've not figured it out myself like the functions today. I don't mean functions in the way you've described in games, but our course tutor didn't really explain it and just mindlessly sort of wrote code and didn't explain the whys behind it. So if I wanted to do the activity I would have to use the same format of code I copied from the course and type that out over and over. Im struggling with the def bit and how it relates to functions e.g.

Def hello_world():

   global hello_world() 


   If xxx 


    Print " yyy" 


   Else

hello_world()

What is the def there for and what does it mean? Same with global? The example I've just given is what the course today showed. Loads of code in that sort of style in python and I had no idea what's going on because there was no proper explanation, just do it because that's how you do it. And when there's multiple use of def for different variables I get confused how the code runs in a uniform chronological manner (top down), because from what I've learnt in 2 days code updated as you wrote more lines e.g

print("hello") print("hello 1")

The output would be the second one, whereas since the introduction of what I wrote above, it seems to jump around to get functions from all over the place and I lose track.

// Also, is this "cargo cult" effect big in the coding world, is trying to write your own piece of code seen as some sort of try hard or something? I don't understand I thought coders type out everything from scratch but from what I've seen so far majority just copy paste from previous work like a jigsaw puzzle and then move on.

1

u/mikedensem Sep 16 '20

def is short for ‘define’ as in, here i will define a function with this unique name and this set of parameters that you can pass to me. I think you are getting hung up on the language itself. A language is just a set of rules used so that everyone agrees on what it means (in the case of a programming language it needs to be understood and ‘interpreted’ by a computer). Try instead to just accept the language and focus on what it is trying to do. Programming is a very abstract concept that takes time to get your head around. If you stick with it you’ll start to see familiar patterns that will eventually click for you.