Getting back to basics

One of my biggest disappointments with coding bootcamp is the scant amount of time we spent with vanilla JavaScript – only one week! By week four we were into Webpack and then React and Angular came quickly after. And while I was glad to get experience in those technologies, I set a goal in January of 2017 to practice a lot of vanilla JS. I stuck with it for a month but then I got a job and it required learning SQL and then a couple months later that job got crazy and it required learning C# and then I realized hey that language is fun and I even asked for (and got!) this book for my birthday and that ended up being a three-month side trip and then I had an idea to build an app for work and I thought hey I should use all these things I want to know in it! – so then came postgreSQL, graphQL, node, express, and vue and then October showed up and I was asked to help out with the local FreeCodeCamp chapter and I looked at all those algorithms in the course which I had never finished and always wanted to and I was sad and I also looked back on the goals I had set at the beginning of the year because fall is a great time to evaluate one’s life and I saw the ‘get super comfy with vanilla JS’ goal and I was disappointed in myself as usual but I was also really enjoying getting familiar with TDD because I think it makes me a better developer and I didn’t want to stop doing that and then Eureka! I decided this was the perfect chance to combine vanilla JS and TDD and put everything else on the back-burner for three months.

It’s terribly easy to get distracted by the shiny new thing in programming. I thought I would be better at not being drawn in because I’m that person who maps out annual and quarterly goals and checks in on the progress weekly but no – turns out, I’m only human! So this is me recommitting, in public view so I feel held accountable, to studying vanilla JS, to finishing these algorithms, and to learning TDD at the same time. You can check up on my progress here. I’m going to try my damnedest to not let anything get in my way, and soon it will be a year since I said I wanted something and we’ll see if I’ve accomplished it. BOOM.

No time to write

Fascinating blog post title, right? Well, it’s 5:30am on the kids’ first day of school and it’s all I can come up with. And it’s the truth.

I’m seven months into my first developer job and I haven’t had time to write about any of it, which is very disheartening. Every day is an adventure of learning and I want to document it all, but when the workday is over, there’s just enough time to hit the gym, bury my eyes in icepacks, hang out with my family, and hit the sack. Which means mornings and weekends are generally reserved for the extra studying I’m doing on my own. Which means writing falls by the wayside. And I hate it. But priorities are priorities.

So yes, I’m still here and yes, I’m still loving being a developer. My team is amazing and makes every day a blast. I am realizing the appeal of a job where I’d get to use all the latest and greatest tools/frameworks/libs – then I wouldn’t have to spend tons of my time outside of work learning them. But I cannot believe the rate at which I’m learning JavaScript, SQL, and C# – sometimes I feel like that Matrix download thing is happening. It’s the learning that makes everything worth it!

TDD with JavaScript

Do you love books? I LOVE BOOKS. I just got this one in the mail and I can’t wait to spend my evenings with it for the next few months!

A book written by Christian Johansen
Time for some fun!

Do I sound nerdy to you? (It’s because I am.) I can never get enough of learning. This has been a really difficult part of being a developer for me, because I’m interested in so many things, plus I have zero patience, so I try to study multiple things at once. You can imagine how this works out for someone with unmedicated ADD. After months of trying to balance learning a new language at work with studying other things in my ‘spare’ time (hardee har har), I decided to take a couple of weeks off and see if there was one thing that would rise to the top – one thing I wanted to learn more than the others.

Now, take note of that word, ‘wanted.’ This is another difficult thing for me, because I like to make the practical decision, the responsible decision, the decision that will lead to better employment/more money/good stability for my family. Often this does not correlate with what I actually want to do. All you adults out there feel me. But over the last few months I’ve realized that if I’m going to find the motivation or energy for extra learning after a full day of work, it’s got to be something I actually want to know more about. Enter this book.

Here’s what I know about TDD:

1) TDD is something that needs to be done, should be done, and often isn’t done.

2) Every time I’ve paired with someone on it, I’ve felt so clueless I wanted to cry.

3) Every time I’ve paired with someone on it, I’ve thought, “This stuff makes me a better developer.”

That’s about it. So TDD it is. I’d like to commit myself to a post a week about what I learn, but I’m already overextended so nah. (But maybe.)

I’ve been a developer for six weeks. Here are the code school skills I actually use.

In December 2016 I finished the Front-End Engineering program at The Iron Yard in Salt Lake City. In January I was offered a job and in February I started that job. So what did I learn in bootcamp that’s helped me daily?

How to read code

I used to beat myself up constantly for being able to read code and understand what it’s doing, but not being able to write it myself. And then I got a job at a place with multiple giant codebases and it turns out that reading code and understanding it is the more important thing (at least right now – I was here four weeks before I needed to write anything from scratch). Every week I’m introduced to a new thing at work, and lo and behold, all that practice I got reading code during school comes in handy again.

How to focus among a gazillion distractions

Write/read/test code while groups chat and laugh five feet away and there are Nerf gun torpedoes being shot at my head and some delicious smell is coming from the nearby kitchen? Yes, yes I can. In school we were encouraged to spend our afternoon lab time together, so I quickly developed the ability to be in a small area with a bunch of people and a lot of talking and interruptions, and still stay on task. At my previous job, I often had to use earbuds and brown noise to block everything out – now I don’t even notice it.

How to learn

I’ve always been a capable student and never had a problem learning things. But with bootcamps, it’s a firehose of information, and this job has been no different – learning in this kind of environment is a beast. The brain has to quickly filter through the hundreds of things being thrown at it, decide what’s most important and useful, grab onto those varying pieces of information, and then plug them in where needed hours or days or weeks later. I was able to practice this at The Iron Yard for twelve straight weeks and it has paid off immensely.

How to ask questions

Part of our pre-bootcamp coursework was to watch this talk on getting technical help. You should definitely check it out. Asking for help is complicated in our field. Knowing what information I need to convey to my team and how to communicate it succinctly, quickly, and in a way that gets the most helpful answer is something I work on daily – if I hadn’t spent so much time practicing it at The Iron Yard, my first weeks here would have been much worse.

How to ride the emotional rollercoaster of dev work

You caught that, right? What I said about it being worse? It implies those first weeks on the job were bad, and they were. If you’ve read my posts, you know that I almost quit in week 3 of bootcamp. Every week was so full of ups and downs that I could oscillate between wanting to quit and knowing I’d made the right career change decision four times a day! And so when I wanted to walk out of this job in week three and never return, I knew enough to ride it out. When I’m feeling especially stupid (happens often), I know that I just need to give it time and I’ll get it.

How to talk to complete strangers

Not only were we encouraged to go to meetups all over Salt Lake City, we were often thrown into on-campus networking events with little notice, or required to pair with people we didn’t know at all. The result? I can approach anyone at my job or at meetups, and I can successfully pair with any teammate. I know this isn’t a big deal to plenty of folks, but this was a skill I did not have before The Iron Yard, and it’s been huge for me.

* * * * *

I can’t be the only bootcamp grad whose first job uses a different language than the one studied in school, and I’m so glad I can still get some ROI for my $25,000 (tuition plus three months of not working). So, my advice to anyone attending or considering code school — spend as much time focusing on the soft skills as you do on the actual code. It’ll pay off.

Console.log is my friend (yours, too)

I don’t get to use a lot of JavaScript at this point in my new job, so to keep up on my JS skillz I spend some of my weekend time practicing old things or learning new things. Right now I’m learning Node. And while reading some code for a basic Express server, I was reminded of the lovely thing that is console.log.

Here’s the code:


var express = require('express')
var app = express()

var jsonData = {count: 12, message: 'hey'}

app.get('/', function(req, res){
  res.sendFile(__dirname + '/index.html', function(err) {
    if (err) {
      res.status(500).send(err)
    }
  })
})

app.get('/data', function(req, res) {
  res.json(jsonData)
});

var port = 3000
app.listen(port, function(){
  console.log('listening on http://localhost:', port)
})

I can see the code is pulling in Express, that it’s declaring a jsonData variable and assigning an object to it, that the get method will call one of two functions depending on the path that’s being requested, and that the listen method will show me what’s happening on my localhost:3000. And I can see those two get functions are going to use req and res, and I can see what happens with res…but what about req? I figure it’s the request coming in, but I have this need to know what all parts of all things look like, so how do I find out? Put a console.log in those functions, of course! It’s about a gazillion lines of data so I won’t repost it all here but at the very bottom, I see something like this for the first get function when I ask for the root path(‘/’):


route: Route { path: '/', stack: [ [Object] ], methods: { get: true } } }

And something like this for the second get function when I ask for the data path (‘/data’):


route: Route { path: '/data', stack: [ [Object] ], methods: { get: true } } }

Doing things like this helps the code make more sense in my brain. While I understood that the functions were taking in requests and returning responses, now I can see what the requests actually look like and I can see how the functions are seeing the path. Yay!

Flex-basis, flex-grow, & flex-shrink

Flex-basis, flex-grow, and flex-shrink are three Flexbox properties that can make things easier when dealing with responsive design. So what’s the difference between them? Let’s take a look at some code and find out!

Flex-basis is how much space we want our element taking up in an ideal world, before we start addressing extra space or less space. So in this instance, we want each of these divs to be 100px wide.

.div1 {
  flex-basis: 100px;
}

.div2 {
  flex-basis: 100px;
}

Now, when we’re viewing these two divs in any browser wider than 200px, there’s going to be some leftover whitespace. Flex-grow helps us decide how we want to divvy up any extra whitespace between our elements. So, as whitespace expands, div1 will take up twice as much of it as div2:

.div1 {
  flex-basis: 100px;
  flex-grow: 2;
}

.div2 {
  flex-basis: 100px;
  flex-grow: 1;
}

Flex-shrink helps us decide how we want our elements to behave as space decreases. In this case, we want div2 to shrink twice as much as div1:

.div1 {
  flex-basis: 100px;
  flex-grow: 2;
  flex-shrink: 1;
}

.div2 {
  flex-basis: 100px;
  flex-grow: 1;
  flex-shrink: 2;
}

To make it much more concise, we can re-write our code like this:

.div1 {
  flex: 2 1 100px;
}

.div2 {
  flex: 1 2 100px;
}

I hope that helps make sense of these three properties. If you want to learn more about Flexbox, you can’t go wrong with Wes Bos’ free series.

On object manipulation in JavaScript

Honesty is important to me, even when it means coming clean about things I struggle with. Today, I confess that I struggle with comprehending object manipulation in JavaScript. Earlier this morning I was pairing with a friend on some katas in Code Wars, and I was struggling to understand what was happening with this code:

let staff = {
  tim: 'finance',
  jim: 'accounts',
  randy: 'canteen'
}

function boredom(staff) {
  var map = {
    accounts: 1,
    finance: 2,
    canteen: 10
 }

  var score = Object.keys(staff).reduce((a, b) => {
    return a + map[staff[b]]
  }, 0)

  return score <= 13 ? 'kill me now' : 'party time!!'
}

As you can see, boredom is taking in the staff object, where it wants to match up the staff values with the corresponding numbers in the map object, then tally the numbers to produce a score and return that score’s relevant string. So theoretically I understood all that, but not this specific part:

map[staff[b]]

My brain was reading it like this…

map.staff.b

…which is sort of right, but also why I was getting confused.
I mean, map and staff are two separate objects, not connected in any way, so how is that working? Let’s walk through it! And by let’s I mean me, so I can solidify my understanding 🙂

Alright, so the first time through, a is 0 and b is ‘tim.’ Which means map[staff[b]] is basically map['tim']. And what’s Tim’s value? It’s finance. Since Tim’s value is ‘finance,’ map['tim'] is basically map.finance. And what is map.finance? That’s right, it’s 2! So the first time through, 2 gets added to 0, and on the next time through 2 becomes a, and b is now ‘jim,’ and on and on until the numbers are reduced down and boredom spits out how you feel about your office’s fun level.

Check out the reduce method on MDN.

Find out more about objects in Eloquent JavaScript.

And don’t forget, you can walk through code step-by-step on this site.

Thoughts from week 5 of coding bootcamp

Early in week 4 I’d wanted to quit for at least the 10th time; things got better after that. I don’t think it was because the material became easier or my brain suddenly understood everything – rather, I finally realized I am doing all I am capable of and there’s little sense in beating myself up over incomplete or not-up-to-my-standards homework. There is literally nothing more I can do. I barely see my family, my TV time is limited to Sunday evening’s Westworld, I haven’t gone to a movie or out with friends in who knows how long, I’m not doing the cleaning or the laundry or the cooking or the grocery shopping – all I am doing is bootcamp stuff!

And while my brain isn’t necessarily understanding things completely, it is beginning to grasp how all the pieces fit together and that’s making me feel a little less like drowning and more like (mostly) keeping my head (halfway) out of the water. I am still struggling with the execution of JavaScript itself, but conceptually I’m having no difficulties comprehending things like this, objects, constructors, or prototypes. We’re also dealing with Webpack this week and that’s been fun and interesting. If given the chance, I will still spend 10 hours of an assignment on the logic itself and maybe a half hour on styling and I don’t expect that to change anytime soon. JavaScript is just too interesting 🙂

Let’s learn about objects and this

No really, let’s. Because I’ve learned this already, but I need all the reviewing I can get. This should take 6-8 hours.

First, watch these videos by one of my very favorite JS resources, Mattias P. Johansson. (And later on, find time to watch all his other videos – he’s highly entertaining, very human, and also super nice on social media.) No need to code along.

Then read chapters 1 and 2 of this book by another one of my favorites, Kyle Simpson. You may, like me, feel both dumber and smarter after reading Kyle’s material, but that’s okay – he knows his stuff and it’ll be worth it. I like to code along with the examples Kyle provides, but you don’t have to.

Now, code along with Mary while she makes a fun little game. She moves fast and you may have to stop the video every few minutes to catch up. After you’ve got all your code written and working, watch the video again while adding comments to your code about what every single thing is and what it’s doing. You’ll learn more in this second run-through than you could catch in the first, trust me.

There, now you’re an expert! Okay, not really – but you learned some stuff, right? BOOM.

Thoughts from week 4 of coding bootcamp

Oof. Week 4 of bootcamp was tough. Tuesday morning found me feeling very down on the way to school. I wanted to quit. The day before, we’d been given an assignment using APIs, and I couldn’t get one small part of mine figured out. The issue wasn’t even getting the Ajax call to work – it was getting down into the right level of each object as I pushed them to the DOM in a table. This is the story of my JavaScripting life: knowing conceptually what I need to do and knowing how to do it, but missing one tiny piece of the puzzle. Terribly frustrating! But by Tuesday afternoon I’d solved my problem and was feeling good about the world. This lasted until Saturday, when I went to my third meetup of the week, and it all came crashing down again.

I’d wanted to quit in week 3, too. Actually, if I don’t want to quit at least 3 times in a week, I consider it a good week. Before bootcamp started, I had naive worries about the schedule, my class, the location. I never suspected the real battle would be convincing myself to keep going back. Every. Single. Day. Don’t get me wrong – I absolutely adore my classmates, our instructor, the campus director…everything about The Iron Yard, really – but it is hard to get a third of the way into this and still feel like I know basically nothing. Every day I feel like I am repeatedly throwing myself against a brick wall, with naught to show for it but a mutilated sense of self-worth.

(Pretty dramatic, right? I know.)

I’m trying to trust that this isn’t reality. That my brain is absorbing the things it needs to, and it’s all going to come together eventually. I asked a local Iron Yard alumni if she ever stopped feeling like she didn’t know anything, and she said it was in week 11 of 12. 7 weeks away. If you find yourself experiencing this during coding bootcamp, you’ll want to know how to hang on until then. Here’s what’s working for me so far.

Trust your instructor. So many times I’ve felt behind and didn’t want to do the morning exercises from our instructor; I’d want to read up on things to fill in the holes in my learning. But two days later, I would find myself relying on what I had learned during the morning exercises. Even when it’s frustrating, go with it!

Look back over your notes from previous weeks of class. Do you need those notes anymore? No, because you know that stuff by heart now. Tell yourself that in the future you won’t need the notes you’re relying on today. You will make progress!

Immerse yourself! You might as well, right? Read a JS book on the train, listen to a JS podcast on the walk, read JS blog posts in the morning with your coffee. Right before I go to bed, I like to give my brain one last concept to play with while I’m sleeping. The JS dreams are getting exhausting, it’s true – but if it helps me learn, I’m willing to deal with it.

Go to meetups for rejuvenation and inspiration!! I’ve mentioned that I’m terrified of meetups, but I go anyway – because no matter how bad my day has been, I always come away feeling amazing. Even the meetup on Saturday, which I felt woefully unprepared for and almost walked out of halfway through, reminded me that hey, I may not know anything yet, but JavaScript is still completely fascinating to me and I am on the right path.

It is so much info. Your brain is processing it whether you realize it or not. Hang in there. You can do it!