day 227 — code 365

Thu 28 Jul 2016

A long hard day working on creating new React components and linking them to Redux and APIs. After realising that I was writing a lot of lines of boilerplate HTML, I decided that it would be useful to create some reusable components. This was a lot harder than I had anticipated, mainly in the logic of passing data to the parent container — figuring out whether to use the global store, refs, state — ended up using a regular vanilla callback that referenced this in a function handed down as a prop…

I then ran into problems trying to clean up code in an associated component that was the lead-in component — decided that it was more important to get the final API call working first, and then go back and figure out how to optimise my code.

I’m realising the wisdom in something that our CTO told us — if you come across a blocker, PARK IT — you’ll achieve more working on other outstanding things. Besides, the solution may come to you via your subconscious working on the problem behind the scenes! This reminds me of the advice the MPJ gave to seek help after getting stuck for 15 minutes (as a rough guideline) — because that usually means you’ll end up being stuck for hours if you persist at it.