Software engineering and returning to my roots

My decision to take up a programming job – returning to software engineering – and start climbing the more typical career path for a computer science graduate has been met with an understandable amount of scepticism and confusion from friends and acquaintances who know me.

I was always vocal about my desire to pursue education and academia; from my extensive volunteer and activist acumen developed throughout my time as a student to my eventual enrolment and the recent completion of a PGCE teaching qualification and acceptance onto a PhD programme within the past year. With all that in mind, why the sudden change of heart? How on Earth was I satisfied with a junior position?

Life as an unpaid trainee teacher

It’s complex. From September to December of last year, I was still teaching at Arden. At my own expense. Despite needing to work an extra semester in the wake of nationwide school closures caused by COVID-19, there was no additional government or university financing available to me which placed me under serious financial hardship. Given the hours I was at my placement, it was also impractical to find part-time work. Despite the placement itself being fulfilling and my colleagues being unbelievably fun to work with, I can’t stress how difficult this period was.

Nevertheless, I managed to drag myself through it and hey, I’m a qualified teacher now. Neat!

All the while, I was planning my next steps. I secured a PhD position at the University of Portsmouth, but I wouldn’t be able to start that until at least September because it was self-funded and I needed a chance to put together some cash. Furthermore, computer science teaching positions, especially those in Further and Higher Education were scarce. I knew that I had to rethink my options and that I had to start looking for jobs in the field that I am good at – software engineering.

I was approached by a developer friend about interviewing to join their company in January as a PHP developer – my programming language and ecosystem of choice – and I was immediately interested. Though it would be remote, they have an office in my hometown. The salary and perks are good. There’s plenty of room for learning and progression, and most importantly from my perspective, there’s a warm and close-knit culture that values you. The caveat? I would be entering as a junior.

Don’t think for a minute I got in effortlessly though. I still had to pass a programming challenge and technical interview, both of which went well.

Impostor syndrome or a dose of reality

Was this an absolute deal-breaker for me? Not really. Despite my academic credentials, I know I damn well didn’t have any software engineering experience outside of education, in my six months at Amadeus, or in my personal projects. To me, coming in as a junior is a chance to reacquaint myself with programming on a deeper level. To finally apply the mountains of software engineering literature I had previously endured; all within a safe and risk-free environment.

It didn’t bother me knowing that there are plenty of self-taught, degree-less developers with junior positions such as mine, all the while I have the shiny (and expensive) accomplishments earned during my time in Aberystwyth. Chances are, they will remain in said positions until they have developed the experience, confidence, and programming knowledge to ascend further. By the way, even though this can take a while, you know it’s natural and totally fine. In any case, I knew that I would not be a junior for long. It would be just enough time to sharpen myself into form once again after spending so long cutting the grass.

Now that I’m over four months into my time at Stickee, where do I think that I’m at? Hand on heart, I think that both my technical skills and my more soft skills have skyrocketed, and it’s thanks largely due to the support of my more senior developers who have helped me at each stepping stone. There’s still always so much to learn, and that’s okay. We’re not encyclopaedias. We’ll learn what we need as we go, and whatever is super important will undoubtedly stick around.

So did you meander for no reason?

Learning to teach has been incredibly meaningful and enriching and I don’t regret it for a minute. I learned a great deal about the science of learning and of pedagogy and the impact of these skills is evident in numerous aspects of my work, no doubt. The students were 100% the most rewarding part and I would do it all again.

I understand why many of my friends and acquaintances criticise me for “postponing” just getting a software engineering job instead of spending more time in the Ivory Tower, but I did it for myself. It’s what I wanted to do. There’s so much pressure on graduates to race head-first into their careers. Many of whom spend months, if not years preparing all whilst completing their studies. I wanted to do these things now whilst I’m still young, full of energy, and with a head full of malleable brain matter.

Some quick-fire, tl;dr questions and answers

  • Will you return to teaching/academia/research?
    • Maybe when the time’s right. I love education and teaching, so I won’t rule it out altogether. Not in the foreseeable future though.
  • Do you regret your Master’s degree?
    • Yes and no. Was it challenging and a positive experience? Yes! Was it basically worth it and outvalued by a year or two of real-world experience? Yes again. Unless you’re specialising in something like AI or pursuing academia, I probably wouldn’t bother.
  • What’s it like working at Stickee?
    • Seriously great. No, I’m not at gunpoint! I’ll write a more general blog post soon about my first few months there.
  • What are your ambitions now?
    • Senior code monkey! In all seriousness, I look forward to being experienced and knowledgeable enough to be a senior or lead programmer within software engineering or nearby fields. After that? Who knows.
  • I’m a former student of yours and I’m lurking your website. Do you miss us?
    • Immensely! You’re all incredible and I know you’re capable of anything you set your mind to. Once you’ve finished school, by all means, get in touch.

Conclusions

From programmer, to teacher, to programmer once more, it has been quite the journey. Frankly, I can’t wait for the next chapters and I hope to document them here on my blog.

In case you’re wondering, I migrated back to WordPress from Hashnode (though if you haven’t seen my neat PHP API, go take a look) after being dissatisfied with the platform – it always felt more of a circlejerk of the same authors and I couldn’t be bothered with that anyway.

Thanks for reading, and until next time.

Introducing a PHP library for the Hashnode API

When I heard about the Hashnode Christmas Hackathon, I immediately began brainstorming ideas to develop something that members of the community might find useful, but would also be a great learning experience for me. After all, learning is at the heart of Hashnode.

In any case, after numerous scrapped ideas and half-baked prototypes (that I’ll talk about in an upcoming article!) I decided that I would go in the direction of building a library – something that I have never done before, and using PHP, a programming language that I’m quite familiar with. By working on this project, it was my ambition to learn more about GraphQL, the technology that Hashnode’s API (Application Programming Interface) utilises, and something I previously knew nothing about!

Enter, an unofficial PHP library for interacting with the Hashnode API in PHP.

How can I use it?

Visit the GitHub Repository

Update: The library is installable via Composer.

composer require oliverearl/php-hashnode

In your own code, you can instantiate a client instance and a root query object like this:

$client = new Hashnode();

$query = new RootQuery();

You can also specify a custom endpoint, or your Hashnode API token by adding it as a parameter to the Hashnode constructor:

$client = new Hashnode('https://some-other-endpoint.hashnode.com', [
  'Authorization' => 'token-goes-here'
]);

For more information on how to use the library, including how to retrieve data from the API, I strongly encourage you to view the repository’s README! I hope to write more in-depth documentation soon as it’s on the development roadmap!

You do need PHP 7.4 (or above) for the time being. Sorry about that!

Is it complete?

Almost. I really wanted to have it completely done before New Year’s Day, but truth be told I have had other responsibilities and familial commitments throughout the winter break that limited my free time. I hope you can understand!

However, all functionality to retrieve information from Hashnode is complete!

The development process

Originally, I wanted to develop something that was similar to how Laravel works with its models, where you could say $post->get(); and retrieve something, but this is currently out-of-my-depth and is something I’m hoping to be able to do in the future with more learning. I used a GraphQL client library for PHP and attempted to use the repository pattern to build ways of wrapping queries in method calls, but I realised that it would be impossible to build flexible GraphQL queries in the way that I wanted.

My gripes with GraphQL

One of the things I found most frustrating with GraphQL as part of its inherent design.

You only get what you request.

This wasn’t like what I was used to when working with RESTful APIs where I could retrieve everything that I wanted by accessing the appropriate endpoint. Instead, there was one endpoint, and I had to build the appropriate query. I was immensely frustrated at my lack of knowledge and knew I had to find another way.

I remember getting so angry that I accused GraphQL of being ‘rehashed SOAP with JSON’ and retiring to bed. After a good night’s sleep, I realised that I was just ignorant of what I didn’t fully understand – and that’s okay. So I got back to work on the project, but knew I needed a new approach.

Enter the GraphQL OQM library.

After a bit of research, I found the author of the GraphQL library had also developed another library for working with objects mapped to queries, or OQM (Object-Query Mapping). With this library, I was able to generate and map queries and arguments into classes of their own. Whilst this sounds straightforward, I spent a lot of time rewriting the code into PHP 7.4 typed code and organising things into a structure that was easy to work with for someone who is relatively new to object-oriented PHP.

Without discipline, agile methodologies can collapse

One of the most important things I learned while studying software engineering is that successful software projects require a careful balance of discipline and agility.

Without agility, you’re basically working to a methodology like Waterfall where the process is too rigid.

Without discipline, you’re just hacking code together and abandoning the process and any kind of planning. Mistakes and problems can then creep in.

I try to use Test-Driven Development (TDD) in all of my projects, where I will write tests and then get them to pass by implementing the required behaviour. By the time I went back to the drawing board and started again from scratch using the OQM library, I was writing and modifying code without testing it properly, so I had to go back and write tests afterwards. This is less than ideal, and I’m hoping to have more thorough test coverage and integration tests going forward. But since I was working solo, it wasn’t a fatal mistake to make.

What remains and how you can get involved

This project is something that I want to keep working on in the future! There is still some work to be done (a full list is available on the repository readme) and there are undoubtedly areas where the code can be improved, or maybe there are bugs.

If you want to get involved, some key areas that need implementing are:

  • Documentation! I haven’t had the time to write a great deal of documentation, but if you’re a keen writer, this would be a great place to help out.
  • Integration tests – while a (semi-complete) suite of unit tests exists, more elaborate tests that test against full queries need to be orchestrated.
  • Implementation of code that performs server-side mutation – in other words, we can currently retrieve data, but updating, deleting, and creating data is yet to be done!
  • Build some single-file examples of the API doing cool things and pull requesting them to join the examples directory!

What I learned

Despite me starting a new PHP software engineering job this January and having confidently worked with PHP and Laravel on a number of projects throughout my career I felt relatively out of my depth this time. I realised that it was okay to not know absolutely everything and that I shouldn’t get too frustrated when I can’t wrap my head around a concept the first time around. Something that I should probably know better by now.

I learned that although I was frustrated with GraphQL for not being able to just retrieve everything that I wanted, I did acknowledge that it’s incredibly efficient as it does just that. Returns what you want.

Conclusions

I hope you enjoyed my little write-up and I hope you enjoy playing with the Hashnode PHP library as much as I did developing it! Of course, it’s not perfect and I’m not the best programmer going, so if you can help me improve it, I would love your help and hope to see you on GitHub!

Thanks again to everyone at Hashnode and I hope that you have had a wonderful holiday season and a merry Christmas to those celebrating. Have a safe and fun New Year’s Eve and I’ll see you in 2021!