TDD - What a difference a week makes!


So I'm finding out that CodeClan Instructors are pretty sneaky!  You think you've got everything straight in your head then they throw in something else that you've not seen before!  Today it was Testing.  Lesson learnt, don't let on that you've finished the lab with 40 minutes still to go - you'll get a made up on the spot extension (thanks Hannah!) Yep, go and write some more methods and then write your own code to test them to make sure they work!  Yep, no problem!

The second last sentence that I wrote there actually brings me back to the title of this weeks blog.  For my non coding friends TDD stands for Test Driven Development.  What Hannah had actually asked us to do was write the test code first THEN write our methods. Why?  Good question!  And one that I was struggling to get my head round.  Surely I should write my method first my brain was telling me - THEN check it works?  NO! If we write our test code first it helps us to plan and write the best code we can in our programme.  Everyone on the course will tell you that I was struggling with this concept...until John gave us a practical input showing him writing TDD to create a programme for the game FizzBuzz.  I had a Eureka moment!  This is totally the right way to write code!  Thinking about what tests you need to write to check your code is running properly means that you fully plan out your code first and think about every possible outcome, which then means you can write code which covers all those outcomes!  It's so easy to write code that will work in one scenario if you jump straight in but forget about what will happen in every other scenario.  






Imposter Syndrome


Wednesday this week was our first all day lab.  I really enjoyed it..until it came to presenting our code and I realised how different ours was to the other groups and then I had a complete crisis of confidence.  I believe this was one of the points of the lab though, giving a group of people the same brief and then standing back to see how completely differently all these brains interpreted and solved the problem!  So I stood back and took a deep breath and realised that we had written test driven code and it had passed, we had succeeded in our task and should be proud of ourselves!  Easier said that done but this too I am told is a huge part of the journey, beating yourself up that you're not good enough, then realising that a week and a half ago we would have had no idea what we were looking at never mind being able to write it all ourselves from scratch!  So....deep breath...I'm proud of myself - I did that!


Staying Alive!


So one of my biggest worries embarking on this course was how I was going to keep everyone alive!  Sounds dramatic I know but the kids have been used to having me at their beck and call and the two hairy babies are used to getting attention whenever they demand it! Suddenly I wasn't going to be there when the kids got in from school and as soon as I finished up for the day they were going to be expecting their tea!  Then there was all the usual housework etc to fit in too!  I sat down with the other half and we worked out a new routine that seems to be working (well everyone is wearing clean pants and has been fed!)  Getting set up for the day, washing on, dogs walked, tea in the slow cooker before our morning stand up means that I can forget about all the household tasks and my head is clear for learning.  I think this is particularly important when we're learning from home and it's much harder to segregate your physical and mental space.


Self Care


This is a phrase that we have heard repeatedly since we started the course, and for good reason! Our brains need the downtime to consolidate what we've learned during the day and to make sure we don't burn out from the intensity of the course. I wrote in last weeks blog about how important our family evening walks are to me, so I thought I'd share a cute photo of the hairy babies with you all, I'm sure you'll agree that watching them running about having a great time is good for the soul.




We had a great lunchtime talk on Thursday from Laura Wilson from Edinburgh Community Yoga.  She really went into the science of stress and how your body identifies it and responds to it.  She gave us some helpful tools to 'fool' our bodies when we feel our stress levels are rising, I suspect that these will be getting utilised frequently over the coming weeks!

It felt fitting after all the talk about self care that I had booked myself a massage for this evening, being our one evening with no homework (yay!) I cannot recommend (or thank!) the lovely Jayne from Olive Tree Lifestyle enough, tonights massage was just what I needed to relax and head into Friday and the weekend homework in the right frame of mind.  It would be rude not to mention that Jayne also hand pours the most amazing candles (also a huge part of my evening self care routine) so far I have tried the Jasmine & Cedarwood and Pomegranate Noir and can't wait for this months scent Winterflower Nectar!

Comments

Popular posts from this blog