Sunday, May 19, 2013

"So one way to solve it is to have a big, complicated, nested if-statement.."

Hooray for Udacity! Boo for me not paying attention last time I learned Python.. I never *fully* understood the return statement.

I was watching an explanation to one of the exercises which I thought was very simple.. I'm way beyond this content, right? This is n00b stuff. I'm no n00b!


...what? No, no no.. stupid teacher man. CLEARLY since the "return False" isn't in an if statement, it will execute no matter what happens in those if statements. But, why doesn't it?

Oh....
.......yup, I'm a n00b.

I don't know why something as important as the return statement didn't stick into my brain. A way to completely end a function, in the middle of the body?! I put that knowledge to work on the next task and was almost surprised when my simple few lines of code did the trick for something that I would have made such a convoluted block of code for.

And then he said it. Right then and there. "So one way to solve it is to have a big, complicated, nested if-statement..." and my mouth kinda gaped open for a second.



I remember Mr Dan looking at some code of mine and being like "What the hell why are there so many if statements" and me being CONVINCED that I had tried alternatives and they weren't working. I probably could have made things a lot easier for myself. I've probably been building a bench with wood, nails, and no hammer.

Thanks Udacity, for reminding me that I am a n00bc0d3r. You're lucky I like you, because usually I would vow to destroy you for humiliating me, once I enslave all computers.

No comments:

Post a Comment