Daily Learning Notes for July 13th, 2017

Today I spent the whole afternoon pair programming with my friend and contributing to the open-source Food Oasis project, even though I was on the verge of falling asleep all day long. But I made it through, and I had fun and learned some new stuff. I also helped host a free film screening of “Hidden Figures” for a Women Who Code meetup, which I really enjoyed!

9:39am: At the usual coworking space, feeling very sleepy because I was up late and up early this morning too. But somehow I’m still starting sort of late today! Not sure what I want to work on. Just trying to stay awake and calm. I’m exhausted and sick of feeling so anxious and uncertain these days, and I just want to feel calm for a change! I just want to feel focused! Anyway, I have a couple ideas for what to work on today: I could start learning about Redux! Or I could work on the mob coding app some more and maybe learn how to use Babel and/or how to organize my code with modules. Yeah, maybe I should start there. Better to pick something at random than to spend too much time agonizing over the decision. OK, I’ll start by learning about Babel!

Notes on learning about Babel

First I’ll take stock of my initial questions, so I know what my starting point is. It’s always interesting to look back on my notes later, because once I know something well, I sometimes forget how it felt to not know it!

Initial questions and assumptions about Babel:

  • Assumption: Babel is a transpiler, basically like a compiler but instead of translating high-level code to low-level code, it translates one type of high-level code to another type of high-level code!

  • Assumption: Babel is just for JavaScript.

  • Does Babel have any competitors? Why is it so popular?

  • How do I actually use it in my projects? Do I include it as a dependency, like an npm package? Is it a command line tool?

  • If I were to compare writing ES5 style JavaScript to Babel-transpiled ES6 or ES7 JavaScript, how much more bloated would the transpiled code be? Is that something I should worry about?

  • Does “learning how to use Babel in my project” actually mean learning how to use a build tool like Webpack or one of those other tools I keep hearing about?

  • How much more complicated will this make my workflow?

OK, that’s a good start! Writing down the first questions that come to mind definitely gives me a better idea of how confused I am (or am not!) and should help guide me in my quest to find the right resources to learn from.

Initial links and notes on Babel:

  • Babeljs.io is the official site, and in big letters it says “Babel is a JavaScript compiler” – that answers that question!

  • “Babel is built out of plugins” and presets. Browsing Babel’s Twitter feed, I found this PHP preset that converts PHP syntax into JavaScript, lol! Of course I had to retweet that.

  • Babel is open-source and it currently has over 20,000 stars on GitHub. Cool!

  • They have an interactive setup guide that I’ll definitely look through, but at first glance, it’s super intimidating because it lists a million tools and frameworks and I don’t know what else!

  • There is a command line interface for Babel “which can be used to compile files from the command line” and they recommend installing it locally for each project, not globally. You can also use the CLI to watch files and compile every time they’re changed.

  • There’s also a .babelrc file that defines presets.

  • According to the caveats page, certain features require polyfills.

  • You can use JavaScript source maps to make it much easier to debug your compiled code!

  • The env preset “automatically determines the Babel plugins you need based on your supported environments” – sounds cool!

10:22am: I’m not really sure what to do next with Babel, but a couple of my friends are coworking here today, and they had some stuff to show me! So I’m definitely going to take a look at that with them and maybe do some pair programming with them today. I just hope I’ll be awake enough today.

Notes from pair programming

I spent the rest of the day pair programming and not taking notes, so here’s a few notes that I remembered later:

  • I worked more on the Food Oasis site with my friend today, this time replacing the old GitHub OAuth flow with an actual GitHub app, so now users can submit locations without needing to log in or create a GitHub account at all! Yay!

  • I finally tried out using the Promise.all method and experimented with accomplishing the same thing with async functions. Cool stuff!

  • I learned about the HTML5 template tag, part of the whole Web Components thing I guess. Really nice!

  • I got to review some more stuff with Node, Express, the request-promise npm package, HTTP requests in general, and other random stuff like using template literals and more!

Wrapping up: Today was a nice surprise! I spent pretty much the whole day pair programming with my friend, contributing to an open source project, and then I helped host a free film screening of “Hidden Figures” at a tech company in Santa Monica and thoroughly enjoyed the film and the free pizza. Plus I met some interesting new people! The only downside is taking the Metro back home takes a while. I just made it onto the train, propping the doors open with a pizza box just as they were closing on me! (I’m tempted to eat all the pizza right now, because I didn’t eat all day.) I never did get to take a proper nap, but then I got a second wind tonight and I still feel OK right now! Honestly, I’m a bit surprised I made it through the day today. I was so sleepy most of the afternoon, I could barely see straight. I was pretty anxious on and off, but I guess overall I should still consider today a win. Every day that I make an effort is a win.