• backend,  Programming,  reusability

    Creating reusable components using function wrappers (with Javascript)

    Creating reusable code is hard. I know, you have crappy deadlines coming up and you just need that feature today. But, before you go ahead and just dial in that feature, consider the future implications of it. Your code doesn’t die tomorrow, it doesn’t die next week, your code lives as long as the product does. Keeping that code base small and understandable is what ensures that working on the project remains as maintainable as possible. That’s the real reason why reusability is so important. However, that’s a discussion for another day. Today I’m covering one part of the puzzle, which is integrating wrapper functions. If you want to look…

  • Martial Arts,  Programming,  Self Improvement

    How Martial Arts Helped My Programming

    Need a new hobby? Like programming? Great! You should learn a martial art. Any martial art. It really doesn’t matter what it is. I personally like boxing, BJJ, and fencing but as long as you’re learning a system, and exercising that system with someone else, this article will give you some insight into how learning martial arts helped me and may help you as a developer. A New Way to Think About Systems If you’re developing software, you’re probably a bright baby. Good on you! You can construct the universe in your brain using binary lambda calculus. To me though, that’s just the start. You should start challenging that meat…

  • backend,  Programming

    Organizing your next NodeJS+MongoDB App – Part 1

    When dealing with a project of any real substance, one needs to plan (what a thought!). Often this takes place at the diagram level and perhaps even at a technology selection level. In this multi-part post, I wanted to share my method of organizing my app’s backend. In this portion, I’ll be discussing the general layout of our app and explain what each subfolder will hold. Once we’ve established that, in the next post I’ll be going into the nitty-gritty of how some of these bits fit together Why Read This Post? You Want Easier To Maintain Files You don’t want your projects to become 2,000 line monster files. A…

  • backend,  Programming

    Adding custom validators in MongoDB+Mongoose

    Today we’re going to add custom validators to some of our documents in Mongoose. Things you’ll have to be familiar with for this article MongoDB Mongoose Nodejs Why make custom validators? When dealing with data sent over the web we often find that the inputs we are given tend to be suboptimal. We need some way of relaying to our end users that they’re not meeting our input needs. This is where validators come in. We can define a function that will arbitrate what is and isn’t an acceptable input for a given field. To get started properly let’s define a model and give it a few fields. Now that…

  • Programming

    Consuming Axios in a Vue + Vuex project

    This tutorial focus will show you how to assimilate Axios into your tool belt for use in future projects to help save you time and headache. Prereqs: Basic knowledge of Vue.Js Vuex Axios A preexisting Vuejs app with Vuex What are we doing and why? We are taking the Axios plugin for Vuejs and baking it into our own custom GET, POST, PUT and DELETE functions for future projects in a scalable, reusable manner, that will help stop some bad smells from appearing in your code. Getting Started Make a new file called “CRUD.js” This is where we will store all of our CRUD functions. let’s create a basic “GET”…