Skip to content

Instantly share code, notes, and snippets.

@maresThere
Last active March 21, 2017 16:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maresThere/afeac16a730a735764fbad74a83d7594 to your computer and use it in GitHub Desktop.
Save maresThere/afeac16a730a735764fbad74a83d7594 to your computer and use it in GitHub Desktop.
Essay on first Javascript assignment

I have always been intrigued by programming. I always thought it was only for very smart people, and I was not one of them. I knew this because I had taken a couple of programming classes years ago and I was lost on day one. Several years later when the internet was gaining speed, I learned HTML and enjoyed the design aspect of it. It was also much less intimidating than “for loops” and “if else statements.”

As my patience in my almost 20 year career in property management was wearing thin, I was on the hunt for a change. My first attempt was Interior Design school where I learned the fundamentals of design. Interior Design also teaches the value of aesthetics and functionality. The idea of creating a space that is visually pleasing and everything in this has a practical use very much appealed to me.

This idea transfers beautifully to Web Design and Development. Websites today have to be functional and visually appealing for the user. Pretty efficiency excites me. When I go to a website I am always critiquing the layout and the path to complete tasks. Details are important in Web design as well as development. Just as a missing space character can cause an application to break, a sloppy design can cause a user to leave the page and never come back.

Doing the Fizzbuzz exercise as my first class assignment, I was reminded about how important details are. My first attempt had sloppy syntax and got me nowhere. Once I got the syntax down I had some success at the task. I was stuck on the last instruction to print “Fizzbuzz.” I was sure I made the statement correctly but it would not print. I tried combining the numbers(after I googled) and that didn’t work. I thought about the order of the statements and considered that if a number passed the test on the first instruction then it might not make it to the next instruction for testing. I decided to try my theory and change the order of the statements. I was correct! Once I understood that the order mattered, I adjusted my “Fizzbuzz” instruction to match the assigned language.

_First try after getting the first 2 instructions to work  but not  the third with an && statement_ 
console.log(“hello") **Just to see if it sees me**
for (let i = 1; i <= 100; i++) {
  if (i % 3 == 0) {
    console.log("fizz")
  } else if
    (i % 5 == 0) {
      console.log("buzz")
    } else if
    (i == 15) {         **Tried 15 based on a hint I grabbed from the Googles**
      console.log("fizzbuzz")
    }
    else {
     console.log(i)
   }
}


_Still not working so I changed the order_    
<script>
for (let i = 1; i <= 100; i++) {
  if (i % 15 == 0) {
    console.log("fizzbuzz")
  } else if
    (i % 3 == 0) {
      console.log("fizz")
    } else if
    (i == 5) {
      console.log("buzz")
    }
    else {
     console.log(i)
   }
}
</script>

_Aha! The order mattered. Changed back to the && statement.
<script>
for (let i = 1; i <= 100; i++) {
  if (i % 3 == 0 && i % 5 == 0) {
    console.log("fizzbuzz")
  } else if
    (i % 3 == 0) {
      console.log("fizz")
    } else if
    (i == 5) {
      console.log("buzz")
    }
    else {
     console.log(i)
   }
}
</script>

Learning Javascript means I can be a programmer. It also means I can make websites with function. Could I be a really smart person?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment