Is a type of programming language where objects are created and methods (functions) are implemented for these objects to do things. The objects are usually created as class instances, and they interact with each other using the methods that programmers implement.
It's truly marvelous, programming. In object-oriented programming, by typing what seems like simple words and phrases alongside a few symbols, programmers are able to create objects in their own instances and make these objects perform tasks as they wish. Sometimes when I'm programming I feel like a god, breathing life into an object as I create a class, commanding it to do whatever I wish by simply typing a few words.
If it were only as simple as that.
Programming in Python, or programming in an object-oriented language may be like breathing life into an object, but this object will rarely ever do as you wish it to on your first try. If you wish it to move left, sometimes it might tell you you're crazy, and that you never implemented a method for it to do so when you have. Then you go back into your code and you realize that you made a typo somewhere in that move_left function. Ah--problem solved. Will the object move left now?
Maybe. Thorough testing is always needed in programming. If you wanted to write a program that allowed your object to dance, changing your move_left function might completely mess up your move_up function.
This is where debugging comes in. You must fix all the problems to your program through debugging to make it work as you wish.
Debugging is one of the biggest challenges to programming in my opinion. You may take a couple of hours to write your code and putting your ideas down, but it may take days on end to get your code to compile and do exactly as you wish.
I know many fellow students and programmers probably get into this programming zone when they're trying to program something. In this state of mind, anything is possible. It gets 10 minutes to get started, and you're just typing away like a mad(wo)man. It's a logical state of mind where breaking down problems are like a piece of cake. You create and create and create. Then after you're done you try to test the program to see if it works, but lo and behold, there's a billion bugs in there (just kidding, probably quite a few still, but imagine if a program had a billion bugs lol).
"Take a breather, friend. Go rest your brain. You deserve it."
I always tell myself this after I go on a programming rampage. I find resting the brain a little bit with a quick nap or a little bit of gaming can really help with this. When you come back to the code, you're looking at it with a completely fresh outlook, and now you're starting on your debugging rampage. :)
With extensive testing and tinkering the code, you'll eventually have your beautiful program with fantastic objects that you created and that you are commanding--and you can feel like a god again. YAY YOU! Now time to get some sleep...
Edit: Holy crap the lab this week though. We figured out how to do the efficiency part of the stack for first in first out but for some reason we couldn't figure out a way to implement it so that the run-time would be super fast.
Edit: Holy crap the lab this week though. We figured out how to do the efficiency part of the stack for first in first out but for some reason we couldn't figure out a way to implement it so that the run-time would be super fast.
I like the sentence "Take a breather, friend. Go rest your brain. You deserve it."
ReplyDeleteI'm glad you do! Brain rest is so refreshing. :D
DeleteAt the end of this course looking back... this post pretty much sums it all up. It's for me to begin coding (because I have a major issue with procrastination) but then it's 5 hours later and I have major back pains. And your section on debugging... you speak the truth.
ReplyDeleteHaha! I only speak from my experiences.
DeleteThanks for reading, friend. :)