Failing, Passing, Refactoring

Florence Mnyazi
Jul 20, 2017 · 3 min read

I always like it when I’m not the smartest person in the room. I realize that this may not be an appealing concept to most but trust me, there is nothing better you can do for yourself than interacting with people who are five skill-sets or even a hundred better than you. I have experienced this first hand in the last few days and thinking about it almost makes me delete the first sentence in this post.

You see, you need a thick skin to interact with what you may perceive to be better than you are. It can be nerve-wrecking and intimidating. You will question your intelligence(and why your brain is not working hard enough), you will beat yourself up and be extremely hard on yourself, you will start second-guessing every little thing you do, you will feel like you have nothing to offer. And if you’re like me, you may got into panic, try to work and your brain completely refuses to co-operate. Talk about having a catch-22 situation, needing your brain to work and it refusing to co-operate.

I write all this from experience and I can guarantee that doing all these things will do you more harm than good. It is better to at any one given time resist the urge to compare yourself to others but rather learn from them and work on yourself. Someone said comparison is the thief of joy…and forgot to add that it is the mother of depression.

When learning, someone will always be and do better than you. You will fail at times, and this is where you check where your failed, pass the test the next time and keep on working to pass other tests.

Talking of testing, it is only right to share what I’ve learned about Test Driven Development or TDD.

TDD is a way of writing and implementing code that helps one think and anticipate the problems your code is going to solve before you write the code itself. How do you do this; well, write a failing test, make the test pass, write a new test, write code, run tests and re-factors. Its basically a cycle..and a very important one when developing.

The TDD cycle.

Some things to check when your test fails are;

  • Check the error shown on the terminal
  • Check which test is failing
  • Check the place in your test code that kicked off the failure

These concepts can be applied in real life(in a way) when dealing with learning and failure or rather failure when learning a new thing; Check the failure , check why you failed , check what could change to correct the failure and re-factor (makes sense, right?!)

)
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade