Mary Dickson Diaz

Code, Life, Learning

complexity rules everything around me

Hey Wu-team, Mary here, checking in from the Fields of Distractionville. I spent like three whole days this week dreaming of Greek island sunsets and planning an international trip that may or may not come to fruition. I’d be lying if I didn’t share that I’m feeling a bit deterred. Thus, I  don’t have anything new to share this week except for this music video and some hard truths. (Java-javaScript, y’all.)

HARD TRUTH #1: Recursive algorithms: you have to learn them.

Colin is a bad-ass programmer and when I questioned the relevance of this Python McNugget quiz question he shot down my hope that the question was an outlier. You can google for more, and here is Colin’s proof that 43 is the highest possible “non-McNugget number,” if you are interested: click me for McProof.

In a nutshell, recursive algorithms look like this:

def recurPower(base, exp): //this defines a function 'recurPower' that takes in two numbers and returns base^exp
 if exp == 0:
   return 1
 elif exp == 1:
   return base
 else:
   return base * recurPower(base, exp-1)

It’s tricky to conceptualize the idea of using a function *while defining that function* but that’s how recursive algorithms work. This one is about the simplest they get, it’s all downhill from here.

HARD TRUTH #2: Programing == Math.

I will admit to purposefully not turning in this week’s Python assignment about looking at programs and analyzing them for efficiency and efficiency’s opposite, complexity. An example is: how many steps will it take the computer to execute this program? And while it would be lovely to be able to answer “1” or “42,” the answer is usually something more like “5log2(n)+2008.”

Complexity impacts run-time and memory usage, all stuff that programmers need to care about, I suppose. Conceptually, I can understand that a more efficient program is going to mean the difference between your lightning fast web application beating out the slower competition. But as I’m still learning, I skimmed over this lesson thinking: “This is advanced math stuff and it’s tripping me up. I’ll skip this for now. I need to get programs consistently running first, and then I’ll worry about how efficient they are.”

And then look what pops up in the latest Code Fellows lesson:

 

Yeeeah. Hello, complexity. And do you see that lovely red bar of lowest complexity… what does that say? That’s a log function, friends. That’s MATH.

So, ok. Not to worry. One step at a time. The last hard truth is personal to me, but here it is:

HARD TRUTH #3: Do not go gentle down that web development path.

I’ve been wavering a bit on the best course of action for me going forward. After reflection, I think I want to pursue further study in Python with an eye to data science and analytics, what is sometimes referred to as “back-end” programming (systems focused) as opposed to web development which is “front-end” (user focused).  The good news is that Code Fellows has a pathway to making this happen. The bad news is that it’s hard. Like, really hard. And full of math. There is less precedence, programs, and guidance for this path than if I were to pursue web development, and I’ll still have to learn JavaScript to be employable, and I’m ok with that.

So, what now?

Make programs. Get them working. Get registered for the Foundations II Python Course. Make more programs. Make websites. Look at job descriptions and figure out what jobs/skills are connected to programming with Python (learn git), learn those skills and find people in those jobs.

…And plan the honeymoon, because that’s important too. 😀

Programmers: what hard truths did you learn early (or late) in your careers? Share ’em in the comments!

 

1 Comment

  1. Data science – hooray!

Leave a Reply

© 2017 Mary Dickson Diaz

Theme by Anders NorenUp ↑