DEV Community

orlando ramirez
orlando ramirez

Posted on

2

Know your tools

Yesterday I was doing some challenges in codewars and I got a challenge where I had to “Create a function with two arguments that will return an array of the first n multiples of x.” At first I did what I usually do in these cases, break down the problem into simple steps to solve it easier.
The thing is even broken down I had to do a lot of steps including using a loop that I knew it will be using a lot of resources. If it is the only way and you can't avoid it then do it that way. But then I thought each database administrator or database system has its functions and different ways to get the job done.

Thinking lady meme

That’s when I got the idea. Codewars uses PostgreSQL as their database system for these challenges, and then I started searching for functions that could help me with this in particular, finally after some research, I found the generate series function that lets you create a series from a number or timestamp, the function accepts an start number a finish number and a step, that’s when a really difficult problem became a really easy one.

That’s why it’s important to know your tool and, think about which is the best tool for the problem that you have.
Maybe if you are using the wrong tool for a problem you can make it even bigger or time / money consuming, or if you don't research on the tool that you are already using, maybe there’s a more easy way to solve the thing that you are facing.
Practicing, learning and continuously improving will make yours and your teammates life easier, so my advice to you is to constantly read and keet up with the new features and advances that are happening in your tools.

So, tell me do you do some katas in codewars to practice?

Did you face a problem like I did?

Tell me if you have any other stories like mine with another language.

Billboard image

Monitoring as code

With Checkly, you can use Playwright tests and Javascript to monitor end-to-end scenarios in your NextJS, Astro, Remix, or other application.

Get started now!

Top comments (2)

Collapse
 
carmen_hidalgo_6b1c16a71d profile image
Carmen Hidalgo

Great Job my friend

Collapse
 
jose_meneses_ad1f398dc949 profile image
Jose Meneses

🔥🎉

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay