Okay, so one of the hardest things I have had to deal with in programming is determining what I need to question or what simply is.
If you create a new Java project, you will see a method called “public static void main(String[] args)”. The first time I saw that, I was like, “What the hell is that?” My background prior to this was doing PHP and JavaScript and neither of them has this funky code that has to be there. For PHP, you just type the PHP script declaration and you’re all set. Why do you need this weird group of words to make a project work?
So you just kind of take on faith that there is a reason for it. You know if you don’t put this in your project the compiler yells at you until you do it, so you just learn to regurgitate it any time you are asked to start a new project.
There is a lot of similar things in Objective-C. The main method has autoreleasepool. What does that mean?? It makes no sense!
I did find out later after reading an Objective-C book from 2010 that it used to have an object called NSPool, which had a method called “drain pool”. Well now THAT explains a lot!
Does knowing this make me a better coder? I don’t know. I am inclined to think not, but it is possible that trying to understand why rather than just accepting will eventually mean something.
A better example of asking why came later. I knew from looking at the documentation for an object that it had a certain method, but I could not get it to show up in Xcode. So I went to the teacher and asked what about the documentation I did not understand. He told me to call the method and I was confused. I call a method by typing some stuff into the IDE and it shows up or it doesn’t. If it doesn’t then I don’t know what is going on. He said to call a method you need to use the straight braces “[]”.
I was floored. I knew that you use the straight braces in Objective-C, but I never processed why. I was like, “I use them because that is how they do it”. I never thought about what “it” even was. I got used to just kind of not understanding why I was doing something but doing it anyway because that is what I needed to do to make the program run. This was an epiphany that you call a method by using the braces. Everything I am doing makes so much more sense now.
Part of you may wonder why I would just passively regurgitate code without knowing why. The problem is that learning coding is so overwhelming that you need coping mechanisms in your brain to process anything because if you don’t you become paralyzed by things that are trivial. It is difficult to differentiate what is important and what isn’t when everything looks like an alien language.
I just feel I need to have faith that anything that is important will eventually reveal itself to me when I am ready to process it!