Recently out of a bootcamp, the world opens up to you, which can be incredibly daunting. What do you focus on… on one hand you start looking at job postings and see all these other languages you don’t know much about, on the other hand you have a skillset most likely in a couple of languages that you want to develop further now that you have bloodied yourself in the world of making something from imagination to fruition….Why not just keep building on these skills and stay within the first comfortable boundary you have found since starting coding.
My choice. I wanted to learn testing. Why? Because it covered so much of the above for me and more.
Having just finished the bootcamp and currently going through the stages of preparing my online presence and CV for job hunting. I have been browsing all the job sites, just getting a feel for what companies look for, maybe a language that really stands out besides the languages I learnt at the bootcamp.
But I thought, why learn a new language, when I could strengthen the current languages I have just learnt. Why not become better at writing them, be able to write cleaner and smarter code. I knew from my projects (especially my final project that was a booking system), code can grow rapidly. You become lost in the moment of getting everything working, knowing that you will have to come back to refactoring it later.
That’s when I realised Testing had to be the next thing to learn.
I needed to learn to write cleaner code. Yes, my projects were fully functional, but they could have been cleaner, more concise, maybe even thought through a little better. Testing covers this.
Firstly, if you write via test-driven-development(TDD) you really have to think about why you are writing this test, what are you trying to create and how should it work. Immediately, you’re refining your idea. What am I trying to create? What test do I need to write that will allow me to create this concept. You follow the red, green, refactor mentality. You write a test that will fail because the code it would test has not been written yet. Next, you write the bare minimum code to make that test pass. Finally, you then refactor the code, making sure the tests do not break.
This was perfect, something that would stop me charging head on into a project without really diving into the building blocks of it. Testing, would make me write cleaner, more efficient code.
Not only that, it would help improve my design, reducing any unnecessary code, make me refactor my code and besides…. testing gives you green ticks. “Who doesn’t love that dopamine fix?” As one of my lecturers used to say.
It felt like a good middle ground between learning a new language and sticking within the safety of the ones I know, which in a rapidly changing market is never the best idea. Testing would allow me to stick to syntax and concepts that I would understand or.. maybe I wouldn’t know them but I would be able to follow them. It would teach me something new, whilst also strengthening the languages I was already learning.
Now, some people may say. Testing makes you code slower, it’s time consuming etc. That’s not necessarily a bad thing, thinking about what you are about to write is incredibly important. Yes, it is slower, but I have been reading that after a couple of years, not only does your test writing suddenly speed up, so does your efficient code writing. I will admit that fixing a bug does give you a sense of achievement, however, some are incredibly infuriating and besides, you aren’t paid to create bugs!
The next blog will be on some basic testing I have learnt so far with RSpec and Ruby, the basic concepts and how to get started. However, if you’re interested in Front-end and want a good testing library for React. I’m fully intending to dive into Jest at some point soon as well!