Skip to content

Latest commit

 

History

History
29 lines (15 loc) · 3.08 KB

README.md

File metadata and controls

29 lines (15 loc) · 3.08 KB

My Codewars Repo

codewars badge

A collection of my Codewars challenge solutions. Updated daily.

Codewars profile: (https://www.codewars.com/users/blind_devotion)

How It's Made:

Tech used: mostly JavaScript with some HTML and CSS for browser testing.

My process of solving these coding challenges has changed since I started, but I make sure to complete at least one of the 8kyu challenges every day. Currently, I am using the P.R.E.P. method (Parameters, Result, Example, Pseudocode) to give the solving process more structure and consistency. I also try to add alternate solutions for each completed challenge to cover different approaches to coding such as best practices, concise body, and sometimes just interesting or clever solutions.

Optimizations

After every coding challenge is finished, I save a copy locally that I can go back and refactor for any number of reasons. I am currently in the process of adding the P.R.E.P. method steps to all of my previously completed coding solutions and I will also refactor the finished code to make it more efficient if needed and add alternate solutions as I learn more ways to solve them. I am also in the process of sorting all of these challenges by difficulty and by date so it is easier to search through.

Lessons Learned:

Every completed challenge adds more knowledge to my coding arsenal and allows me to approach the same problem in several different ways. When a coding challenge is completed and submitted on Codewars, you are immediately shown a list of other coders' solutions and often a discussion breaking down how each one was solved. Even if I have solved a specific or similar challenge before, there will always be a new or different way to go about resolving it so I can practice a technique I won't normally use otherwise in the process.

For example, there was an 8kyu challenge involving the evaluation of a string as if it were an expression and returning the result as a number. This was earlier on in my experience with coding challenges so I just came up with a basic solution using the Number() function and various string and array methods to convert everything. After I submitted my solution, I found another coder had answered the same problem using a function I had never tried before: eval(). With a quick glance at the MDN (Mozilla Developer Network) documentation, I was able to find out that eval() evaluates a string as if it were a mathematical expression and then returns the result. I also learned in the same MDN article that eval() should never be used in live code because it poses a potential security risk and can be slower than other alternatives when run in the browser. Keeping the warning in mind, I realized that this function could still be used at least for the coding challenges I was doing, and ended up using it as a shortcut to solve a much more difficult challenge about a month later.

Examples:

Take a look at these examples that I have in my own portfolio:

Codewars: https://github.com/stender11/CodingChallenges