The Issue With Default in Switch Statements with Enums

Reading the coding standards at a company I recently joined revealed to me the issue with default label within the switch statement and why it’s prohibitted when its being used to enumerate through an enum. default label is convenient to handle any edge cases and it’s often used to handle errors. However, when working with enums, it is often the case that the prpogrammer intends to handle all possible values in the enum. To catch this mishap, programmers would enable -Wswitch or -Werror=switch to their compiler. For instance, let’s suppose I have an enum named Suit to represent the different suits in a deck of cards.

Read More

MicroBlog 2024 Edition

In 2023, I was fascinated in learning about a revival of the old internet where chaos and nostalgia ensues in neocities which is an attempt to recreate the community of the old internet that geocities provided in the past. However, I never progressed much aside from creating an initial introduction page. Almost a year after in the summer of August 2024, I decided to take advantage of the amount of free time I have rececntly due to taking a break from school to start posting shorter content as a way to write something quick and potentially more personal as this blog site has become more of a technical blog rather than a personal blog. Though that doesn’t mean I won’t post random odd blog posts that aren’t technical nor do I guarantee any professional (it is the internet and a blog site that I maintain without any sponsorship nor earn anything monetary). Though any potential chaos or out of context content I may post in the future will be contained in my neocities site while it lasts which should spare this blog site from any weird oddities for the time being.

Read More