1. PROMISES Promises A Promise is an object representing the eventual completion or failure of an asynchronous operation. Since most people are consumers of already-created promises, this guide will explain consumption of returned promises before explaining how to create them. Essentially, a promise is a returned object to which you attach callbacks, instead of passing callbacks into a function. A…
Read More1. Intro to spread operator 2. Example 3. Spread Operators for Arrays The core piece to know is the ... syntax. This is the spread operator, and it essentially takes either an array or an object and expands it into its set of items. This lets you do fancy things, so for example if you have the code: The value of array2 will end up being [1, 2, 3, 4]. The spread operator lets you essentially drop…
Read More1. INTRODUCTION Object-oriented programming is a term that, as a developer, you hear a lot and you build into the concept as you write more code and create variables containing properties and/or methods, but it was until recently that I decided to take a deeper dive into really understanding what it is and the greater advantages of exploiting its benefits. Here's a quick example of how an Object…
Read MoreINDEX Understanding statements, identifiers and keywords Variables Primitive data types Operators Implicitly Typed Local Variables Understanding statements, identifiers and keywords Statements A statement is a command that performs and action, such as calculating a value and storing a result or displaying a message to a user. You combine statements to create methods. Statements in C# follow a…
Read MoreINDEX Declaring methods and passing parameters Returning information from a method Calling methods Conclusion Declaring methods and passing parameters A method is a named sequence of statements, it has a name and a body. Following best programming practices, methods should have a meaningful name that indicates the overall purpose of the method. The body contains the actual statements that the…
Read MoreThe Call Stack There are two main types of JavaScript code: global code, placed outside of all functions, and functional code, contained within functions. When code is being executed by the JavaScript Engine, each statement is executed in a certain execution context. Javascript Visualized: The Javascript Engine History on the Javascript Engine Execution Context And just as there's two types of…
Read MoreAutomated testing (Emphasis on Unit Testing) We're starting by defining what automated testing is. Automated testing is the practice of writing code to test your code, and then run those tests in an automated fashion. Test automation can automate some repetitive but necessary tasks in a formalized testing process already in place, or perform additional testing that would be difficult to do…
Read MoreLoosely-coupled Design (Dependency Injection) In Loosely-coupled design you can replace one object with another at run-time. When you are testing a Class that talks to an external resource, you can replace that object with a fake object, we call that a test double. There's three steps you need to follow: Extract the code that uses an external resource into a separate class and isolate it from the…
Read MoreClean Code Principles Right tool for the job Every technology has its place. Developers who've become too fixated on a given tool, pattern, or paradigm are cursed to misuse it. It's common to hard fit solutions into some of our problems, expecting a compliment of how good of a problem solver you might be by using unexpected tool as a work around, like the handle of a big enough screwdriver as a…
Read MoreBuilding Microservicies - PERSONAL NOTES by Sam Newman O'Reilly Publication Preface Microservices are an approach to distributed systems that promote the use of finely grained servicies with their own lifecycles, which collaborate together. 1) Microservices Microservices are small, autonomous servicies that work together. Small, Focused on Doing One Thing Well Cohesion - the drive to have related…
Read More