From The Challenges - Discord Bot
Exploring the software engineering lessons we can learn from the solutions I've seen.
Hi this is John with this week’s Coding Challenge.
🙏 Thank you for being one of the 80,547 software developers who have subscribed, I’m honoured to have you as a reader. 🎉
If there is a Coding Challenge you’d like to see, please let me know by replying to this email📧
Welcome To Coding Challenges - From The Challenges!
In this Coding Challenges “from the challenges” newsletter I’m sharing some of the common mistakes I see software engineers make when tackling the Coding Challenges.
I’m sharing both the mistakes people make and some thoughts on how you can you avoid making the same mistakes when taking on the coding challenges or when writing software professionally. Sometimes we have to make mistakes to learn from them, somethings we can learn from other people’s mistakes, then make our own new ones! 😀
Recapping The Discord Bot Coding Challenge
In the build your own Discord bot coding challenge the goal was to write bot for Discord.
Discord is an instant messaging and VoIP social platform. You can communicate on it using voice calls, video calls and text messages. It’s divided up into a series of communities know as servers.
Coding Challenges has it’s own server, with several hundred members who are sharing their solutions to the challenges and helping each other out. Come join us! 😀
Discord launched in 2015 and quickly began to replace the use of IRC in some communities - particularly amongst gamers and esport communities. Nowadays it’s widely used for all sorts of communities.
Which makes it an ideal thing to build a bot for. Something that can automate some of the tasks that might be needed on a server, such as welcoming new users.
🐣 EASTER Sale! 20% Off All Courses! 🐣
Happy Easter everyone!
To celebrate I’m offering 20% off all Coding Challenges courses. Pick your course and use the code: EASTER25 to claim it!
Five Common Mistakes Software Engineers Make Solving The Discord Bot Coding Challenge
I’ve pulled together this list of common mistakes from the hundreds of submissions I’ve been sent privately and the many shared in the Coding Challenges Shared Solutions GitHub Repo.
Mistake 1 - Not Deploying It
This is one project everyone should deploy. It’s free to create Discord server and you can easily host a bot on a small server using the AWS / GCP / Azure free offerings. Sure not everyone will deploy their professional software to production - it’s just not possible in all professional environments - but everyone should learn the basics of how to.
Mistake 2 - Handling Command Line Args As A Side Effect
Side effects are usually a bad thing in code. They make it harder to test functions, classes and modules. Please try to avoid them wherever possible.
One of the solutions I saw used them to parse command line arguments. It’s a double whammy in this case as it was also using a language feature that people are usually advised to avoid using.
Mistake 3 - Binary In The Repo
This is a recurring issue across many of the submissions I see for the coding challenges!
Source code repos are for source code. Binaries do not belong in them. It should be possible to re-create the binary from the source code so there is no need for the binary. Equally it’s not obvious from a binary if the current binary is built from the current version of the code or an earlier one. Or even if the binary has been compromised.
Mistake 4 - Not Completing All The Steps
Coding Challenges exist to give you projects to do and learn from. I’ve picked out the steps to maximise the learning from each project. If you skip steps you find hard, you’re depriving yourself of growth opportunities.
Mistake 5 - No Readme
This is the most common mistake that I see in the solutions share with me.
A README in your repo doesn’t have to be long, but it should contain the basics of what tech stack is used, what the project does and how to use it.
An interviewer or hiring manager looking at your work / a take home task they’ve sent you will appreciate it if you do this, so try to make a habit of it.
It really helps if your repo makes it clear either what the tech stack is or how to clone, build (if applicable) and run the repo in clear simple steps. Those steps should not include or reference paths that exist only on your local machine.
Request for Feedback
I’m writing these coding challenges and this new from the challenges series to help you develop your skills as a software engineer based on how I’ve approached my own personal learning and development.
What works for me, might not be the best way for you - so if you have suggestions for how I can make these challenges more useful to you and others, please get in touch and let me know. All feedback greatly appreciated.
You can reach me on Bluesky, LinkedIn or through SubStack
Thanks and happy coding!
John
P.S. If You Enjoy Coding Challenges Here Are Four Ways You Can Help Support It
Refer a friend or colleague to the newsletter. 🙏
Sign up for a paid subscription - think of it as buying me a coffee ☕️ twice a month, with the bonus that you also get 20% off any of my courses.
Buy one of my courses that walk you through a Coding Challenge.
Subscribe to the Coding Challenges YouTube channel!