Oops, an error occurred.

console.log

February 16, 20201 min read

Software development is hard.

Especially considering that we’re using tools we usually have only limited knowledge or consuming APIs we mostly know how they behave before everything turns grey.

It gets even harder as we keep building more blocks on top of the blueprint relies on some other stuff which relies on more other stuff.

Luckily, we have more working systems than the broken ones but it comes with a cost: we all suffer from exceptions on our way to the stability (I’m glad we do, otherwise it’d be just boring).

Being a little bit, even %0.30000000000000004 more pessimistic helps us to be more confident to ship products to the consumers compared to being ignorantly optimistic. At least it raises some awareness and of course, it doesn’t only apply to software, probably everything.

However, I mostly talk about software and I know quite a little about it. As the kickstart for this blog, I’ll try to share my suffering and the thoughts helping me to relieve the pain. Mostly for myself so I don’t forget.

The first one is fairly easy to read, maybe a bit contradictory but it’s something I had to write black on white (or reverse if you’re on dark mode 🌚) to internalize.

Here it comes:

Handling errors by only logging them to the console doesn’t help anybody, including you.

I have no doubt you already know.

try {
  doSomeStuff()
} catch (error) {
  console.log(error)
}

If you have a piece of code that looks like this and is used by anyone other than you, no matter the size, load or type of the project, you should know that it’ll hunt you someday.

I didn’t 🤷🏻‍♂️