Learn Blog


Learning to Code

Big ONotation & Time Complexity


The Future of jQuery


Selecting a Database - MongoDB

Throughout the Flatiron program I primarily used SQLite as my database, as it is the default database for rails and it is a lightweight server-less database that is great for development and testing. I have yet to use MongoDB, but I am excited to use it as the database for my next project.


JavaScript Testing with Mocha

Going through the Flatiron program, I spent a whole lot of time reading and inspecting tests as I debugged each lab; however, I spent very little time writing tests myself. I mostly debugged with other tools (i.e. since reaching JavaScript, I used console.log and the Chrome Developer Tools like the debugger and the React and Redux tools). It is not a complicated topic, so it is understandable that there is just a quick section in the Flatiron program that covers writing tests (while the concept of TDD was heavily discussed). While writing tests is not a difficult concept to understand, like anything, it is much easier to do with practice. As I prepare to enter the workforce, I am frequently seeing job descriptions with requirements in writing your own tests so I decided to get some practice with JavaScript testing. I decided to add in a Mocha testing framework to the React project that I have been working on for fun. Mocha is a JavaScript test framework that works great with React and is pretty simple to use. Mocha is very popular and it can be found in many of the Flatiron labs, but there are many other testing resources you can use so do not feel like you have to use Mocha. To start, you will just need to install Mocha onto your computer (or you can just add it as a dependency in your project). I installed it onto my computer via npm install. Then, I made a directory in the frontend of my project called ‘tests.’ As Mocha will automatically look for a file directory called ‘tests’ (pretty intuititive). Next, I was ready to create a file and start writing my Mocha tests. When writing tests, it is easiest to start out writing what you want in plain English and then formatting your function to do exactly what you want. Each test will have an expectation (what you WANT to happen/what you are EXPECTING your program to do) and then you can throw in an error statement to help you along in figuring out the type of error faster. Mocha is great in that you can use if for asynchronous testing. You can use async/await as the second testing argument (after your it function). You can also use Hooks like before or after to check for functionality as certain points. Because testing your code is so important along the way (and afterwards as you revise and refactor your program), writing good tests is extremely important, and I am excited to incorporate this into my daily practice.


What is Kubernetes?

I have been hearing a lot about Kubernetes (k8s). It has become very popular since its release in 2014. Kubernetes was created to manage large complex container based applications (container orchestration). Building applications using containers or microservices is becoming very popular, and for good reason, but it has also created new challenges and complexities. Kubernetes is an open-source software system that was created by Google and allows you to manage and deploy these containers at large. The creators said they selected the name Kubernetes based on the Greek word for helmsman or captain. It is portable, scalable, and easily extended. It utilizes a cluster orchestration system that will allow your program to still run even if one node fails (i.e. a cluster of nodes, so if one fails, you will still have a number of other working nodes receiving information). We are moving away from companies issuing one huge release after working on a project for a year or more and then dealing with all of the errors and problems that arise (that were not found during testing). Instead we are moving towards a more agile future with small, targeted releases and upgrades with DevOps teams and systems like Kubernetes that allow our agile container based applications to function at a high level - continuous integration and continuous deployment. The Kubernetes production cluster manages this workflow beautifully. Kubernetes is just one of the elements, albeit an important one, of the future of software development where development is more flexible and fluid.