Code Quality Challenge - Week 1

Senior Full-Stack Developer with over 20 years of experience building web applications for startups, government, and higher education.
Search for a command to run...

Senior Full-Stack Developer with over 20 years of experience building web applications for startups, government, and higher education.
No comments yet. Be the first to comment.
Journal of my [Code quality challenge](https://justinramel.com/im-taking-the-code-quality-challenge)
Into the second week of the Code Quality Challenge, we're not counting the weekend days, so we jump to Day 8. Day 8 - Extract a compound conditional This is best explained in a live-coding, video format. Fortunately, I have just the thing! Please wa...
Writing this up so I have somewhere to quickly grab basic Jest setup. This information is copied from the Jest Documentation Site compressed into just the parts I'm interested in. Create folders mkdir -p <project>/src cd <project> Install and init n...

In this blog post, we'll explore the process of setting up and configuring a Postgres database using Docker and seeding it with test data. This approach can be used for a variety of apps and can be easily adapted for your own needs. We'll cover all t...

Continuing from last time, we will explore the concepts behind Create and Update functionality and provide a step-by-step guide on how to implement it in your SvelteKit application. Let's get started! Server & Client Code In SvelteKit, the server-sid...

Introduction In this post, I will explore how to create a REST API using Spring Boot and Kotlin. We will dive into the fundamentals of Spring Boot and Kotlin, explain how to set up the project, and guide you through the process of building the API st...

Introduction Welcome to the latest post in my series of Koan Battles using Kotlin and TypeScript. In this series, we'll complete a Koan in both languages and then discuss the differences between the two solutions. My goal is to help you gain a deeper...

Week 1 journal of the Code Quality Challenge.
Free swag! Ben Orenstein is very kindly offering free stuff for all participants:
For a little extra motivation, I am offering a free swag item from Tuple to all participants who complete the challenge!
As well as the offer of free swag, there are some great tips to help complete the challenge:
My personal favourite is time boxing 20 minutes. I find time boxing to be a great way to get things done, especially mini tasks like these daily challenges. My plan here is to setup a Pomodoro timer for the daily challenges.
Spend 20 minutes improving your README.
My project README was more or less the stock generated file by Create React App. I updated the README with build, test and deploy instructions. This felt like a worth while challenge and great way to kick off the week ๐
The challenge today is to remove any TODO comments in the code base.
Why do this? Because code is a lousy place to track todos. When a todo lives in your code, it can't be prioritized or scheduled, and tends to get forgotten.
I agree with Ben Orenstein here, there really are better places to track TODO's, your backlog for instance?
I found two TODO comments in the code base, the first outdated and was a simple delete. The second required a small code update that was quicker to fix than add to the backlog.
Thankfully the code base was not full of TODO comments so easy challenge today ๐
Today's exercise: get rid of a warning you've gotten used to ignoring.
Easy challenge today, I have a very low tolerance for warning messages, I like to clean them up as I go. The only warning I could find (it was more of an information message) was that a newer version of Storybook was available. I upgraded to the latest version and no conflicts. Happy days.
Let's track down some code that's not actually in use (and delete it, naturally).
I see dead code! I'm using Typescript so my editor is pretty good at highlighting dead code, so not a lot of dead code to be found. I did find the odd unused reference and type so still a useful challenge. Deleting code is so satisfying even if its not as much code as I would like ๐
The challenge today is to clean up old tracking branches that have been left in your local git repo.
You can list old branches with:
git branch -r
You can then delete the old branches with:
git remote prune origin --dry-run
If you're happy with the results remove the --dry-run switch to run the actual delete.
I found this to be a useful challenge, I hadn't realised how many old branches I had lying around. It's much easier now to list and switch between branches.
It's been a useful week of mini challenges and a great way to start the day. I've found all the challenges useful but my favourite was Day 3 - Get rid of a warning, I do enjoy deleting code.
Looking forward to next week, see you then!