DEV Community

Tami Schultz
Tami Schultz

Posted on

Knowing Which approach to take to Complete a Task...Keeping track of Similar Functionality

Hello everyone!

One of the things that makes it hard to truly master any language/functionality is the fact there are usually multiple ways to accomplish any given task.

Call me old-fashioned, but when I learn, I like to know all the different ways to accomplish the same task so that I can choose the best way for a situation. The problem is, in coding, presenting all those ways at the same time is confusing and overwhelming to the coder. Thus, you get different approaches in a piecemeal, often random fashion. And you typically only get the syntax, and not necessarily the logic, behind each approach.

It can be confusing to remember all the different ways you might choose, so unfortunately you fall into patterns of using only a few ways you're comfortable with - even though there may be newer or more efficient ways to do the task. Many times this happens because you have no organized listing of those different ways.

I've finally reached the point where I feel I can handle the full list of some kinds of tasks, at least in vanilla JS...like looping.

So I'm now on the lookout for articles which compile **in one spot **such multiple methods for various tasks. Thus, I'm building out a reference library that minimizes my search time. Below are links that I've found so far. Hope this helps you out!

CSS Centering: How to Center a Div with CSS – 10 Different Ways
https://www.freecodecamp.org/news/how-to-center-a-div-with-css-10-different-ways/

Javascript:

  1. 15 Common Operations on Arrays in JavaScript (Cheatsheet) https://dmitripavlutin.com/operations-on-arrays-javascript/

2.All you need to know about arrays in JavaScript (Thank you, MAYANK TYAGI)
https://dev.to/tmayank860/all-you-need-to-know-about-arrays-in-javascript-1nb7

  1. Learn JavaScript Loops 101
    https://blog.teamtreehouse.com/javascript-loops-101

  2. The Comprehensive List of JavaScript String Methods (Part 1)
    https://betterprogramming.pub/full-list-of-javascript-string-methods-part-1-ddad113de018

  3. The Comprehensive List of JavaScript String Methods (Part 2)
    https://levelup.gitconnected.com/full-list-of-javascript-string-methods-part-2-259b70ccc7e7

Top comments (0)