Recently I started to look for an excellent way to learn more about programming and to be a better problem solver. My first task of problem solving hit me in my first advanced computer class when I was in the 10th grade here in the States. I loved it, the rush of dopamine when you solve a problem (even if it is one that needs no solving) is the greatest feeling in the world. That may come as a surprise to any teenagers out there but trust me, it's my drug of choice now.
Before we continue:
... it’s true that dopamine is associated with things like sex, drugs, and rock and roll, dopamine is NOT your brain’s reward chemical. Or rather, dopamine is not JUST your brain’s reward chemical, nor is it your brain’s ONLY reward chemical. - NeuWriteSD.org
That being said, I'm still going to use "dopamine" as the descriptor here but just keep in mind that what I am referring too is more than just that one chemical. It is the total result and something I have no better way to describe.
Dopamine is the reason I code and work to solve problems in my everyday life. The reward is so good that I keep coming back to the misery of the unknown. The hours or days before solving a problem and getting that hit of dopamine is a slog and often makes me think I'm a complete idiot. This anguish is the exact reason why the brain chemicals hit so good upon conquering a challenge.
As a side note, dopamine is also the reason that I don't pull out my mobile device at every instance I am bored or need to kill time. Today, apps are made to give us small hits of dopamine over and over to keep us there and consuming media. If I am always on a slow drip of these beautiful brain drugs then when I need to solve a problem or tackle some hard coding problem I'll be more likely to quit.
So that brings us to why I love to program and learn new things (especially new coding things). Because I always want to learn more and become better at making effective programs I always look for ways to practice. Practice needs to both reinforce what we already know as well as push us to our boundaries. If we are not forced to the edge of our current understanding, we can never become better. It's also on this edge that I find the most pleasure because for me I tend to get more of those brain drugs upon figuring something out that I have never tried before.
Since I am always looking to learn new ideas, concepts, and be more effective, I was looking around for a way to practice programming. I wanted it not to be myself thinking up problems because then I would be more likely to never step outside my comfort zone. Not because I would purposely pick easy practice problems but because I would not even know the harder ones existed.
Then I found this site called DailyCodingProblem.com from another programmer who has lots of videos YouTube. The channel name is CS Dojos, and he has a lot of great videos even a series for beginners. I like his stuff, probably because he did not go to school to be a programmer and shows that you can learn how to code without a college degree.
After signing up for the Daily Coding Problem I got my first email with a challenge. It was not hard but also not easy. What I love about this mailing list is that if you pay the 9 USD/month, they will send you a detailed explanation of that problem the following day. In the report, they cover different ways to solve the question and what is the best route from the standpoint of time and complexity.
I am not even a week into the mailing list and already have learned more than I would have if I just went through tutorials, books, and self-coding. It's pushing me to my limits and causing me to learn, and when I finally have a solution, the brain drugs come rushing in and give me the motivation for the following day. This motivation is needed because on the tough days of this challenge I get frustrated and want to quit. Push through these dips in confidence and knowledge is what leads us to better understanding.
Here is an example of what the daily email looks like:
cons(a, b) constructs a pair, and car(pair) and cdr(pair) returns the first and last element of that pair. For example, car(cons(3, 4)) returns 3, and cdr(cons(3, 4)) returns 4. Given this implementation of cons: def cons(a, b): def pair(f): return f(a, b) return pair Implement car and cdr.
This is my solution to the problem above. I by no means have the best answer or the most correct answer. This is just how I was able to solve it during my learning process.
def cons(a, b): def pair(f): return f(a, b) return pair def first_element(a, b): return a def last_element(a, b): return b car = cons(3, 4) cdr = cons(3, 4) car(first_element) cdr(last_element)
Before I get the next coding challenge and see their solution to this one, I will probably try to simplify this more. It is also a good idea to check the time it takes for the answer to run and then scale it by adding more data to see if the complexity is not exponential. Of course, checking the time and complexity is not needed to complete the challenge, but it is a good idea. When checking for time and complexity, you get a sense of how fast your code will execute and how robust it can be with large datasets.
Thanks For Reading!
If you have any topics that you would like me to cover please feel free to comment them below and I'll add them all to my list!
All images came from royalty and attribution free sources unless specified.
Click here to vote with SteemConnect
Or go to https://steemit.com/~witnesses
jrswabin the box at the bottom.