How to do algorithm scripting

Hello everyone,

I am curious about how to write a better script.
This might sound like a dumb question because everywhere I see online is “practice makes perfect”…
But I do want to know how experienced developers solve algorithm scripting challenges? (like what’s in your head?)
How do you break down the process step by step?
How to know which one is the best tool to use instead of another one to write better code?
Any tips are welcome!

Thank you!

Not an experienced developer yet but, for me, it helps to use the magic tool of pen and paper. Write it out how you want it to work. I often tend to come up with a quick solution that actually isn’t always the best option to solve the problem. Writing it out helps also with that since I am able to capture my ideas and move on. Another thing I do is taking the code step by step and check if I understand it all.

I think this might be an interesting read for you: https://www.freecodecamp.org/news/lessons-learned-from-my-journey-as-a-self-taught-developer/

1 Like

Well, I’m not an experienced programmer, but I know my way around JavaScript. When writing algorithms, I always try to brainstorm, what methods and functions I want to use. Then I try to simulate it myself, in my mind how it would work. Then I try to implement it slowly, and the most important part is that console.log(); is YOUR BEST FRIEND. If I want to know what’s going to be passed on, I used console.log();, It’s just a standard you have to know. If I have a problem, I start to Google the certain method and how it works, NOT how to make one, I usually think of a method, then Google how the method truly works. Then try to implement it. I usually use either MDN or DevDocs for Web Development resources.

1 Like