DEV Community

orlando ramirez
orlando ramirez

Posted on

3

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.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (3)

Collapse
 
carmen_hidalgo_6b1c16a71d profile image
Carmen Hidalgo

Great Job my friend

Collapse
 
oramirezperera profile image
orlando ramirez

Thanks! :D

Collapse
 
jose_meneses_ad1f398dc949 profile image
Jose Meneses

🔥🎉

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay