41

Climb Your Way Through Coding

 4 years ago
source link: https://towardsdatascience.com/climb-your-way-through-coding-15bfc2c81df0?gi=550d8ca30e95
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Learning new things can be difficult. No, I don’t mean remembering new things. Really learning something only comes with really understanding something. Sometimes it can take a little bit of time for someone to understand a new concept. It isn’t a lack of hearing the new ideas or knowing that it makes sense, but having everything click into place might not happen right away. For me, that usually happens when I can look at the subject in a different way, make connections to things that I already understand, and see where the parallels are. I’ve found that this is one of the most effective ways to learn something. Find the logic behind it, then think of a way to represent that logic as something familiar. And with that said, it’s time for a story.

I took up bouldering about a year and a half ago. I quickly (and gladly) realized that it is not just about strength, but requires balance, flexibility, and problem solving to become good at it. One of the most important aspects that I’ve learned is about how to use your energy. More specifically, how to conserve your energy. Using your muscles takes a lot of effort, so trying to hold yourself up or power through a problem will quickly tire you out. You have to make each move count, using the right combination of strength and movement and leverage to get you to the next hold, and when you get to that hold, you want to stop using your energy. You can let your weight sink into your feet, your arms stretching out so you’re not engaging them as much (think about doing a pull-up — you can let yourself hang at the bottom for much longer than you can hold yourself in the middle).

MbUb6nQ.jpg!web

Extended arms, resting — Photo by yns plt on Unsplash

This is the point you always want to be returning to. It’s mostly trying to be in this relaxed state, with a few bursts of energy at the important parts. And that really reminds me that this post also had a point, which I should probably be returning to as well, before I lose everyone to my rambling about how much I enjoy climbing.

I recently completed the Data Science Immersive program at General Assembly. While it covers many areas of what it means to be a “data scientist”, everything is implemented through coding, mostly in Python. I had some light experience with programming throughout my life, but only knew the basics, and had never built anything significant. So at GA, when I began to really learn how to code, and the fundamentals of what makes good coding, a familiar theme came up. There was an emphasis on building functions that could take complex actions that would be performed often and complete them in a single step. There was a phrase that kept being repeated — “strategic laziness” .

A73AryE.jpg!web

Functions! (Well, methods. The functions of classes!) — Photo by Chris Ried on Unsplash

Are you going to run the same code to collect new data? Make it a function! Are you going to make the same kind of plot, only changing the data going into it? Make it a function! You don’t want to have to type the same thing over and over again. Not only is it an action you’ve already performed, but it can start to take up a lot of time. And the more complex the action, the more time it takes up, and the more chances that you make a mistake in this block. Sure you could copy and paste something many times, but at that point, you begin to take up valuable space in your document, and again with increasing complexity, you begin to start wasting storage space as well. So on one hand, it is being “lazy” to not want to type more than you have to, but it actually ends up helping you down the line — that’s the “strategic” part.

This brings us back to the bouldering. You always have to make sure you’ve seen the full route before you start climbing. Figure out your starting position, know where it ends, and know what your plan is for all the steps in between. Once you get up on that wall (or rock), the clock has started. It’s too late to start thinking about what you’re doing because your energy is already decreasing. This is just as important when coding, especially with data science problems. If you just assume, or don’t even think about the goals, and jump in head-first, you may find yourself halfway through a project and realize that what you’ve constructed wasn’t necessary, or that you easily could have constructed what was necessary, but failed to recognize it. So when I heard about being “strategically lazy”, I could see that it wasn’t about not wanting to do the work, but about conserving your energy, and being efficient with your efforts.

B73MZf2.jpg!web

You could be climbing AND coding! Terrible Wi-Fi though.

So now when I look at a coding goal, I try to think of the process as a bouldering problem — Which parts am I certain I can accomplish easily? Which are the parts that I’m going to struggle with? Where can I see that things might go wrong? Then I can figure out where to put my efforts, knowing the simple parts that can easily be automated, and the difficult parts that will need my full attention and skill. I know it’s not a perfect metaphor, and not everyone else will see it the same way, but it’s something I’m able to use when I’m figuring out a project, or feeling a bit daunted by what’s ahead of me. So go forth, and find your metaphor! Look at things in new and different ways! You might just make some new connections, and start understanding in ways you hadn’t before.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK