Yes, I just made that joke. However, I’m in the middle of a Handlebars.js lab so I think it’s fitting.

Handlebars uses the curly brace as a delimiter because if you turn it sideways it looks like a mustache, and Handlebars.js is an extension of the Mustache template language.

Today was a lot of HTML, CSS, and Templating so no new notes on anything. I find that HTML & CSS stick pretty well and until I’m actually using a templating language in a project I won’t take notes just yet. The docs are typically good enough for quick searches through. Like the lab where I had to use Basscss it was easy enough to just use “Find” on the website to get my code to do what I needed.

Spent most of the afternoon at my neighbor’s house for their daughter’s birthday. She’s turning 3 just like my little one will in less than a month.

Time spent today: 5:10
Time spent total: 344:20
Lessons completed today: 13
Lessons completed total: 559

Zero lessons or labs done yesterday. Had an impromptu dinner at the in-laws and when my wife and I got home we decided to spend some time with the neighbors talking. That turned into a great evening or wine, scotch, and conversation until 4am. I did, however, read You Don’t Know JS in the car on the way to and from dinner so I did some learning. I got through the first book, Up & Going, and was able to start the second book, Scope & Closures. If I can keep up the consistent reading I think this book series will really help level up my JS knowledge as I learn and implement things in my learning alongside the book’s teaching. Like, I did Closure labs today and I was reading about Closures in the book. I also decided to read this book series because no matter language I end up being employed to do web development in I’m going to encounter JavaScript. So it makes sense to understand it very well.

I’ve found that I’m moving through JS at a good pace. Things are clicking and I’m not getting too stuck in any one place. We’ll see what happens the first time the “training wheels” come off though. I specifically took notes on two things today.

Arrow Functions

// Arrow Functions
// With multiple arguments
let arrowFunction = (arg1, arg2) => {
  // Do Something
}
// With one argument
let arrowFunction = oneArg => {
  // Do Something
}

// All arrow functions are anonymous
function iHaveAName () {}
> iHaveAName.name
> 'iHaveAName'
// versus
> (() => {}).name
> ''

Object Destructuring

let obj = {a:1, b:2, c:3}
let {a, b, c} = obj

I’m still not 100% on Object Destructuring but that’s why I added it to my notes. It makes sense why it was implemented and seems kind of like mass assignment in Ruby. However, I’m trying not to relate things too much between Ruby and JS because they fundamentally work differently. It’ll just end up causing me confusion in the end.

I’m happy with my progress today. Hopefully, I can make it through another 14 tomorrow and be in a good position to hit the 75% mark before the end of the month. We’ll see.

Time spent today: 8:10
Time spent total: 339:10
Lessons completed today: 14
Lessons completed total: 546

The DOM. Forgot to throw in the main info about the DOM I learned yesterday in last night’s blog:

  • The Document Object Model is a representation of the current view of the browser, and can be manipulated without reloading a page.
  • The HTML is the text in a file first used to display the page.

With Javascript we can (1) view a current representation of our Document Object Model. With Javascript we can also (2) select specific portions of the DOM, and manipulate them, which changes what shows up in a browser window.

This small portion of text cleared up what the DOM is after a long time of not truly knowing.

I didn’t get as much done tonight as I had wanted. I started late and didn’t stay focused so it’s all my fault. I spent too much time messing with how my terminal/editor looks. I decided on using zsh with Oh My Zsh and a Powerlevel9k theme. It’s pretty sweet. All sourced from this post I saw on Reddit. Now that I have a solid config at some point I’m sure I’ll mess with it more to make it more custom to me. However, I’ve already done a few minor things like changing the ArchLinux logo and text to Ubuntu. It’s pretty cool though. I can see what branch I’m working on if there are uncommitted files if there are committed files waiting to be pushed, the time, the battery left on my laptop. I can extend these features more too, which I’m sure I’ll do someday.

I also spent a bunch of time implementing “proper” linting for JavaScript. There are so many style guides out there I struggled figuring out what to set up and use. I ended up deciding on an ESLint implementation using JavaScript Standard Style. Turns out WebStorm supports Standard by default these days so it was easy to set up. However, I had to get it installed which was easy. The hard part was finding where the node_modules folder for global installs was on my computer. I ended up running across it as a comment on a Stack Overflow post.

I also got my invite to Cypress today. I have it installed but haven’t done any work with it yet. I think I’ll use it to set up tests for my Rails Portfolio Project. Check it out. It’s definitely slick. I also started reading You Don’t Know JS as I’ve been looking for something to do outside of my computer screen to continue my knowledge expansion. Knowing that I’ll encounter JavaScript no matter what language I end up working in makes me feel like diving deeper into my knowledge of it will help no matter what. I really do enjoy Ruby but I might end up not working in it so yeah.

Time spent today: 1:59
Time spent total: 331:00
Lessons completed today: 3
Lessons completed total: 532

Today I spent 30 mins pairing with one of the Learn instructors trying to work through some issues my Rails portfolio project has. Something I found out is that the project requirement to use a custom attribute writer instead of has_nested_attributes actually removes some functionality from the final app. Because of this lack of Rails magic, one of my problems is harder to fix than expected. The other one is just a more simple if...else statement.

JavaScript is coming along and I’m happy it’s clicking more and more each day. It was definitely frustrating to have a rather solid grasp on a workflow, resources, and a knowledge base and then go back to almost nothing. I haven’t dove back into the Mozilla Developer Network (MDN for short) docs but I know it’s coming soon.

Something that I ran across today in my IDE was a linting error from JSLint stating Missing "use strict" pragma on one of my functions. So, like a good dev, I Googled this (well DuckDuckGo’ed this). I came to a great post and discussion about this on Stack Overflow. My takeaways were that using 'use strict'; enforces things that JavaScript allows to happen or will throw silent errors for. So, it basically forces a person to write their code correctly. However, this can be dangerous in legacy code. A great answer contained this gem IMO:

Where should I use ‘use strict’;?

  • In my new JavaScript application: Absolutely! Strict mode can be used as a whistleblower when you are doing something stupid with your code.
  • In my existing JavaScript code: Probably not! If your existing JavaScript code has statements that are prohibited in strict-mode, the application will simply break. If you want strict mode, you should be prepared to debug and correct your existing code. This is why using 'use strict'; does not suddenly make your code better.

I plan to add 'use strict'; to the top of every new JavaScript file I work on. I see no reason not to at this point in time and it’ll only enforce me writing better code in the end.

What do you think about 'use strict';? Leave it in the comments for me.

I also found out tonight from my Free Code Camp Nashville Co-Organizer Dave that he scored us a table at Music City Code 2017 which is pretty sweet. Not sure what we’re going to do with our table just yet so if you have ideas please let me know!

Time spent today: 3:07
Time spent total: 329:01
Lessons completed today: 5
Lessons completed total: 529

JavaScript is coming back to me more and more as I’m getting back into it. I have to say it’s a bit frustrating at times but that’s fine. I look back at how Ruby was frustrating when I started and how I enjoy it so much now (most of the time). Okay. I’m beat. It was a long day. I don’t think I’ll even publish this tonight because it’s not even a full paragraph. Just wanted to get it down on the screen for now.

Actually, I’ll publish this. I just won’t mirror it over to Medium tonight.

Time spent today: 2:27
Time spent total: 325:55
Lessons completed today: 5
Lessons completed total: 524

So I’m back in JavaScript world again. Since I had done a lot of the intro stuff during my Bootcamp Prep work I spent tonight mostly skimming over everything I already had done to remind my mind how to think JS. I have to say, it didn’t come back quickly when I was reading it. The first lab I worked on, well the only lab I worked on, was slow. However, the functions and syntax came quickly. I feel good now that I’m done for the night. Like my brain is back to JS somewhat. I didn’t get the lab completed which was a bummer. I can look at how simple it is and know that I would have finished it in the same amount of time in Ruby but that’s fine. It’ll come quickly. The biggest thing is I know how to solve these problems better now. I just need to find equivalent functions in JS to get done what I need.

One thing I spent some time on was figuring out how to access a local “JS playground” in the terminal. It’s just easier to hit a key combo and pop into the terminal in my IDE and test than to switch over to the browser. It took asking and some searching but I finally came up with running node to bring up a repl (pretty sure I can’t explain this so read the Wikipedia and be more confused). Also, to exit out of it process.exit() is used. This was a nice find because I was spoiled by IRB, Pry, byebug and such in Ruby.

I didn’t technically finish any lessons tonight but I felt like I got a lot done.

Time spent today: 2:23
Time spent total: 323:28
Lessons completed today: 0
Lessons completed total: 519

I tidied up my app today. I decided to scrub the DB and run a new set of seeds then test everything as best I could. This is where I see automated testing is very useful. I really want to get better acquainted with writing tests. However, I also want to finish this curriculum so I can stop paying tuition. I’m slowly building out my testing resources to take a deeper dive into that once I’m done with Flatiron. I think having high code coverage for my projects will make them more impressive to employers. I know TDD is a key thing being done these days so demonstrating I understand how to do it will be a nice touch.

So I just spent about an hour integrating Travis CI and Coveralls into my app. I’m not really sure how Coveralls decides the coverage but apparently, I have 90% coverage with only 4 tests lol. I bet I can get that up higher. I DO want to finish writing tests for my models at least. I don’t think I’ll delve into Capybara testing at all for this. I think some comprehensive model tests will be a good start. I asked in NashDev #javascript about JS testing tools and a lot of people mentioned Jest although it doesn’t do browser testing. Cypress.io was mentioned favorably as well although it appears to be in closed beta. This looked really interesting to me. Also for browser testing Selenium and TestCafe were thrown into the conversation. TestCafe looks cool but It’s also $500 so it better be good haha. I applied to get early access to Cypress so we’ll see how that goes.

Take a look at my app here and leave a comment with bugs, comments or suggestions, please.

Time spent today: 3:57
Time spent total: 321:05
Lessons completed today: 1
Lessons completed total: 519