I felt that I should add a quick note about something good in my week. Yesterday afternoon I met with my group members for Mobile Application Development (Martin-With an accent like "mar-tean" & Max). Martin was sharing his sandbox code that demonstrated how to manipulate and display array data in HTML using some JavaScript code. He kept using the terms "div" and "method." I had heard the term div used many times before but never quite knew what it was so I made a note to research those terms later on. I asked a question which lead me to inquire on divs so that I now have a rudimentary understanding of them (generic storage containers used in HTML) and why we might or might not need to have a declared ID attached (mainly so we can specify formatting specific to that storage the data in the storage container that is displayed). It felt good to fill in some of the gap in my understanding. We ended our meeting and I was on my way to my ACM (Association of Computing Machinery) meeting on game development and the Unity development system.
A couple of hours later, I sat down to study for my C++ (object-oriented programming) course and to start writing a program due the next day - it turned out to be a quiz instead but still required the reading. Within the first few pages of the chapter, I was pleasantly surprised to find that we were learning about methods! I had this moment of hope that somehow things would come together no matter how confused and behind I feel this semester. Even better still, I was already on the right track with my guesses as to what a method was! My guess is that they were related to structures which was close but a bit off. I'll try to summarize.
In C++ we use variables that are of various types, such as integers or characters. Over the years, programming languages developed from binary coding (assembly language) which started with 1s and 0s into something far more complex and far more usable. Data structure types were created so that we wouldn't have to start with 1s and 0s every time we wanted to do something more complicated. A new data type is called a structure. We can create custom data types that are tailored to the purpose of a program such as a structure that defines what a playing card is. A playing card might include an integer that represents the rank of the card, a number or character that represents the suit (spades, clubs, etc.). An Ace of spades would be a variable created using this card structure and the rank may be 1 or 14 (depending on high or low value in a card game) and the character for the suit would equal "s".
In C++ there are these very useful groups of code called functions. They tend to serve a single purpose and are designed to perform a single function. An example might be a function called "display" which we use to show the items in a grocery list. We don't need to accept items for the grocery list in this function, we just show them to the user. We can make an infinite variation of functions but thankfully C++ has many of them built in for us. When a function is attached to a structure, the structure is then known as a class. Integers and characters are actually classes because they have functions attached to them before we even write any of our own code.
For example: A string class is a group of characters lined up, like a word or a sentence. If we want to know how long (how many characters) a string is, there is a function built in called length that will automatically tell us how long the string is. When we add a function to a data structure, the name changes to a class. What else changes? The term function also changes to... (The moment we've been waiting for) Methods!!! Other terms that apply to the contents of a class are member variables and member functions but this is where my learning in two classes converged on a topic that I knew I needed to know. Hopefully the explanation wasn't completely confusing but I felt I should at least try to explain my experience with more significance.