My freeCodeCamp weekend

This weekend has given me some of the mental highs/lows that I’ve read about for Code Newbies and it has enforced a belief in karma that I never once thought about.

I started the weekend excited to get through as much of the remaining freecodecamp challenges as possible, eyeing up the two first advanced projects on the front-end course.

Javascript calculator

Friday night saw me start FreeCodeCamp’s first advanced project – the javascript calculator.  Quincy Larson warns at the start that this will take some time to grasp what’s going on, and initially I didn’t have this struggle, completing the majority of a basic MVP in a relatively short space of time. Feeling good, I posted as much on my twitter account.

The instant I did this, I went back to my calculator and discovered I couldn’t multiply by anything higher than 9 – my model immediately invoked a calculation on the press of the first number after an operator. This issue took me about an hour to figure out the solution for, and a similarly proportionate amount of motivation with it. I left my project for the night with the aim to solving my clear and decimal point buttons for the morning.

Saturday morning proved to be the main frustrating portion of the weekend. Not fully appreciating the brief of the project, I decided to construct a clear entry button for my calculator. Panic then sets in as think I need to start again from scratch as I try to envisage creating a master array that details every point in the process so that the last entry can be popped off, then having to reduce the array to summarise the calculation.  After a review of the video I realised that both clear buttons had the Clear All functionality, which I had already done. Now…this feels like the cheap and easy way out, and maybe one day I’ll revisit my calculator to incorporate this feature (not likely), but for now, I ploughed on.

For my decimal point I decided include a period as a string first and then calling a Number() method to the string. In hindsight I don’t fully know why I thought this would work – it didn’t. The hardest part was seeing my console display 2.3 while my calculator displayed 23. I felt like Happy Gilmore telling his ball to get in his hole.

Happy-Gilmore-Adam-Sandler

I once saw a TedTalk video that discussed spatial thinking and how a child chess prodigy would walk away from the board, look completely disinterested then come back with an amazing move. Having his brain wander he was able to clear his mind and think more clearly. Well…I went to the shops to buy some toilet roll, came back and solved my issue in 2 mins.  Don’t know how I did it, I think I might have blocked this whole process from my memory, but maybe I should give chess a go???

Rounding it all off, the functionality of my calculator was pretty sound (I hope!) – css still leaves a lot to be desired, so much so that I think I need to do a proper css course soon. How can centering on a page be so difficult?!

Pomodoro Clock

On the crest of a wave I decided to dive headfirst into the pomodoro clock Saturday night, probably to my disadvantage – I tried to plan and scope out exactly how I wanted to approach this but:

  1. I thought it was pretty simple; and
  2. I’m pretty hyped so minimal planning needed, lets crack on!

Yeh, that wasn’t great.  I started really confident, plodding along getting everything sorted, and really got the basic countdown finished, allowing for different states that you may be in (e.g. starting a new timer, starting from paused, finishing the timer). But then I hadn’t allowed for the start of the break period. And this is where my struggles returned.

The more and more I dug into the rabbit hole I realised I was further and further away from the end. In a blind panic I decided to completely rehaul my javascript a good couple of times. How can something so simple be so difficult for me to code? I realised that as I hadn’t planned as much as I should have on this occasion then I just got myself tangled in my old mess of code. So a final restart was needed and this was much better. I realised I wanted to set one timer function which covered both states, rather than creating two separate ones and jumping from the two. This last design was a good one, and my countdown easily flitted between active/resting states. Feeling pretty good…then karma tapped me on the shoulder. As soon as I paused my counter, I get some output that was completely wrong. I started the counter again and more weird output. Apparently this iteration of the paused state didn’t carry over so well.

So here I am. Having seen these ridiculous states I decided to summarise my coding weekend, partly to share my experiences (which overall are very positive) but also, selfishly, in the hope of getting some more grandmaster inspiration.

My weekend has gone and I’ve sat 12inches away from my monitor for the majority of it. But I’ve thoroughly enjoyed every minute and I’m looking forward to next weekends’ challenges already. It’s easy to say this now that most of my problems are resolved – had I written this at the decimal issue this post would be a whole lot bleaker! Over the rest of the evening and this week I hope to finalise my pomodoro clock so that I’m ready for the tic-tac-toe game I hear so many Code Newbies attempt.  That leaves Simon’s game and 3 more algorithm challenges before I complete my front-end certificate.  Looking forward to that day!

Advertisements

3 thoughts on “My freeCodeCamp weekend

    1. Looks awesome! Loving the retro digital look! I just finished tic-tac-toe and I’m gonna write about that this weekend. I’m on the Simon Game now which started off well but I’ve come to a standstill. Hoping that second wind comes soon!

      Keep up the good work!

      Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s