Code Organization in Functional Programming vs Object Oriented Programming

Introduction

A co-worker asked about code organization in Functional Programming. He’s working with a bunch of Java developers in Node for a single AWS Lambda, and they’re using the same style of classes, various design patterns, and other Object Oriented Programming ways of organizing code. He wondered if they used Functional Programming via just pure functions, how would they organize it?

Continue reading “Code Organization in Functional Programming vs Object Oriented Programming”

Functional Programming Unit Testing in Node – Part 5

Noops, Stub Soup, and Mountebank

Welcome to Part 5 where we cover more about noops with a utility to test them, the “stub soup” that can happen if you don’t create small pure functions, and how we can utilize stubs instead of mocks to unit test larger functions. The most important part, though, is setting up Mountebank to show how integration tests can show problems in your unit tests despite 100% coverage. We use wrapping class instances as an example to show you the pitfalls Object Oriented Programming code can make for you.
Continue reading “Functional Programming Unit Testing in Node – Part 5”