So I built this JavaScript basic calculator a month or two ago.  I have to admit there was a good bit of “reverse engineering” involved but I am still improving it…or so that was the plan.  Between working full-time nights in a non tech related field to support the family, looking for a job IN a tech related field and even  my daughter’s spring break, I haven’t had much time to work on it until today.  That’s when it hit me.  I’ve forgotten things.  Parts that came easy when I was able to work daily on coding became more cumbersome.  Not having the time to spend coding has caused me to forget some of what I’d learned. I’ve still be able to listen to podcasts every night.  I’ve even been working on things related to getting a job like Agile development, Scrum, SASS, RESTful APIs, web services, and more.  But, I haven’t been actively coding.

Now, I can’t say that I’d forgotten everything.  The basics of html, css and javascript are still in my brain somewhere. I just need to find out where.  But, how?  Do I go back to the basics and start learning from scratch again?  That seems like a lot of wasted time as I still know most of the material.  I went back to the basic algorithm scripting problems. I can still reverse a string with split(), reverse() and join().  I can check a string for palindromes by making everything lowercase, getting rid of any punctuation, then loop through the string comparing the first and last letters as I go. Great!  Got that down.

What about Intermediate scripting? I can sum all prime numbers using % (modulus). I can flatten a nested array and I can convert a string to “spinal” case.  I can even validate telephone numbers with regular expressions (which I kind of covered in a previous blog post).

So, what’s wrong?  The obvious answer is to spend more time coding, building, and making things.  Listening to podcasts and courses from Lynda are great but they’re only part of the picture.  I have a limited amount of time in the day and I need to schedule dedicated time to just building a specific project.  I’ve had a tendency to take online classes and it’s mostly stuff I know or can figure out.  These kinds of things give me an immediate reward because I can do them in a reasonable amount of time and I get positive reinforcement right away. I feel good when I solve a problem but in the long run, I’m not getting much further along in putting everything together.

I am going to pick one project like building a tic-tac-toe or simon style game and spend at least one scheduled hour daily working on it.  At night, I’ll still listen to podcasts but when I get computer time it will be to complete one project and not rely on as much “reverse engineering” as I did with the calculator.  I’ll keep you all updated on my progress.  Thanks for reading!

(Now, what editor do I use?  Brackets? Visual Studio? ….)


“If at first you don’t succeed; call it version 1.0”




For those of you hoping for part 2 of the Regular Expression tutorial, I apologize.  I’ve spent the last couple of weeks thinking and this blog has gotten off track from my original intent.  The title is “Adventures of a Coding Noob”, not “Teaching the Coding Noob”. It was supposed to be more about the perils and pitfalls, the successes and elation of what I’ve been learning and not really so much about the nuts and bolts of coding.  I’m sorry if anyone was trying to learn how to code from me but I would rather talk about “how I learn” more than “how to do”.   I hope you’ll stay with me through this reset and I hope you’ll enjoy the new (eg. original) focus!

Ok, with that in mind….

I have been experiencing a major frustration with the teaching site Lynda recently.  I’ve been going through their courses on things like Git, Bootstrap, Angular, and Node.  The tutorials themselves are fine but when I download the tools, I find the Lynda courses are often several versions behind the current downloads.  Sometimes these are minor differences and sometimes, there are MAJOR changes.  Files aren’t available, user interfaces are completely different and sometimes things don’t even seem to work the same!  I have enjoyed the great educational content on things that don’t change much but I’m finding that just going through the documentation on the web has been much more useful. For bootstrap, I downloaded a tool called Prepros and trying to correlate all the files from the Lynda lesson with with was actually available now was getting too cumbersome.  I was wasting more time looking for files than actually creating.

Solution…if you want to learn a tool, I’m finding it’s best to just go with the documentation and samples available directly from the authors.  It would be nearly impossible for any educational website to keep up with the nearly infinite changes occurring daily!  Lynda is great for learning the overarching ideas but for the detail work, they can’t be expected to change their tutorials with every single update!

Also, in my “Adventure” I’ve ramped up the job search, applying to several companies over the last couple of weeks.  So if you have ANY helpful encouragement, hints or leads I would love to hear from you. Check out my Linked-In at and feel free to forward it to all your friends who may be hiring!

I’m not sure what my next post will be about but please keep following and stay tuned to the next chapter of “Adventures of a Coding Noob!”


"Debugging is twice as hard as writing the code in the first place. Therefore, if
 you write the code as cleverly as possible, you are, by definition, 
not smart enough to debug it."

- Brian W. Kernighan.



Express Regularly!

Part 1

One recent lesson involved Regular Expressions or RegEx.  RegEx allows you to quickly scan over text for different properties.  Regular Expressions almost seem like an entire language by itself and is does exist in more than just JavaScript.  The idea has actually been around since the 1950s and you can find it languages like Python and Perl.

Here’s a real quick overview of the basic concepts…

The first, simplest match would be just a character.  Like A,b,z, or 3.  We mark the beginning and end of the RegEx with the forward slash /.  So, say I was looking for the letter “a” so I would use /a/ to look for it.


Cool, so  /a/ matches the “a” in the middle of “cat”…now what?

If we want to look for a range of characters, we can use the “-” to define a range.  If we want to check for a three letter word that starts with “c” we can define the first character with /c/ and the remaining three with ranges [a-z][a-z].


(By the way, the “g” at the end just turns on the “global” feature.  If this were off, it would match the very first word and stop.  This just lets us check the whole list at once.)

Here we match the “c” in “cat” but not the “b” in “bat” and the “c” in “car”.  As long as the last two characters are in the range “a” through “z”, it will match.

You can use the same method to match numbers, BUT…there is one little thing you have to remember.  When using RegEx with numbers, you’re actually looking for the numbers as a text character and not as actual numbers!  If you set up a range like 1 through 10 you’re not actually looking for the numbers 1 to 10.  You’re looking for the characters 1 through 1 and 0!  For example if you search on the range of 1-10 you’ll match all the 1’s and all the 0’s.  You can see below how this matches up to different numbers.


Just remember, you’re searching for the characters, not the numbers!

So, in Code Camp, the first problem to solve with Regular Expressions was to validate US telephone numbers. We’re looking for something that looks like 555-555-5555 or (555)555-5555.  A number like 52-55-8888 should give us an incorrect response.

Using what we know about ranges and how numbers are considered characters, we can first start looking at each number to check if it’s in the right format. (We’re going to ignore the dashes and braces for right now, we’ll address that a little later.)  At first glance, it looks like we have to set up a search for every number individually.  You might be thinking of something like


This method works to look for sets of three numbers in a row but there has to be a better way, right?

Thankfully, yes.  There are shorthand characters we can use instead of typing out every number!  For numbers, we can use the “Digit” shorthand character “\d”. We can use “\d” as shorthand for [1234567890]. This will save us a TON of typing! Now, the RegEx looks something like this.


See how we were able to replace [1234567890] with just a “\d”?  There is also another shortcut we can use here that will (believe it or not) make it even better!  We don’t even have to use “\d” three times!  We can just do it once and then specify we want to repeat it how ever many times we want!


We just use the “\d” and then the “{3}” tells it to look for the digits three more times!

This seems like a good place to stop for the moment.  In my next post, we’ll put all this together to check those US Telephone Numbers!  Thanks for reading!

“My software never has bugs. It just develops random features.”-Unknown



But That’s Not What My Code Looks Like…


After finishing one of my latest algorithm challenges on Free Code Camp, I decided to search the internet for other people’s solutions.  I know that there are multiple ways of solving each problem, each with their own benefits and problems.  But, I had expected to find at least one other person who did it the way I did!  My code does exactly what was asked but in a completely different way than other solutions.

The one I looked up involved DNA Pairing.  Here’s the problem:

  1. The DNA strand is missing the pairing element. Take each character, get its pair, and return the results as a 2d array.
  2. Base pairs are a pair of AT and CG. Match the missing element to the provided character.
  3. Return the provided character as the first element in each array.
  4. For example, for the input GCG, return [[“G”, “C”], [“C”,”G”],[“G”, “C”]]
  5. The character and its pair are paired up in an array, and all the arrays are grouped into one encapsulating array.

To me, the simplest way was to just step through the string one letter at a time and use conditional if’s to just add the correct base pair to an array.  There are only 4 possible combinations so I didn’t think I needed to make anything that could be scaled up.  (I know this would get really bogged down with hundreds of possible combinations) but I was only dealing with 4.

Here’s my code for the solution (you can copy it on Github).


Then, there’s what other people  came up with…


from Rafase282 or a similar solution from DenKozlov


The closest one to my code is the first from Rafase282.  Where he used push to add items to an array, I already had the i counter going so just used that to directly write to each index of the array as I stepped through.

The second solution from DenKozlov goes to the extra step of splitting the string into an array then, looks at each character in that array and pushing the necessary character into that array.  Personally, I feel this takes extra steps and memory that aren’t really necessary.  I would say that Den’s code looks cool but mine is just a functional without all the conversions and pushing.

Rafase282’s code I think is more scalable than mine but the problem involved only 4 options and since DNA doesn’t change, my answer is still effective.

So, as I am still learning to code, I believe my code was just as good as the others out there even though it didn’t do conversions, or use functions.  As I said before, there are many paths to the solution.  As long as the code works, the end user doesn’t really care what the guts look like.  As I become a more proficient coder, my code will get more elegant but, I believe that right now my solutions are just as good as other methods.

When you’re learning, I wouldn’t worry too much about what other people are doing.  If you can solve the problem with what you know, do it!  You’ll eventually learn other ways. Some are good, some add extra unnecessary steps. The most important thing right now is to get functional code, no matter what it looks like!

Good luck and thanks for reading!

“For instance, on the planet Earth, man had always assumed that he was more intelligent than dolphins because he had achieved so much—the wheel, New York, wars and so on—whilst all the dolphins had ever done was muck about in the water having a good time. But conversely, the dolphins had always believed that they were far more intelligent than man—for precisely the same reasons.”
Douglas Adams, The Hitchhiker’s Guide to the Galaxy