Charles Yost is currently the Vision Agent Team Lead and a Security Developer at Binary Defense in Stow Ohio. He has worked in the IT industry for over a decade in a wide variety of languages including (but not limited to) VB6, VB.Net, C#, F#, Python, and C/C++. Throughout life, his number one passion has been learning new skills, which lends itself nicely to technology (a field known for its fast pace of change and evolution). Charles enjoys teaching and talking to others about technology. He is a member of NEOISF, and attends as many conferences as he can justify with his wife.
Binary Defense
Binary Defense Systems is a local Managed Security Service Provider. We provide a full range of MSSP services including: monitoring, consulting, threat intelligence, and incident response. We also are the creators of Vision, a real-time software solution which gives organizations immediate visibility into the latest attack vectors. Contact us at https://binarydefense.com/
This means the language supports passing functions as arguments to other functions, returning them as the values from other functions, and assigning them to variables or storing them in data structures
Tail-call optimization is where you are able to avoid allocating a new stack frame for a function because the calling function will simply return the value that it gets from the called function. The most common use is tail-recursion, where a recursive function written to take advantage of tail-call optimization can use constant stack space.
Functional programming can be considered the opposite of object-oriented programming.
What is it?
Functional programming decomposes a problem into a set of functions. Ideally, functions only take inputs and produce outputs, and don’t have any internal state that affects the output produced for a given input.
Native Python Functional Affordances
(batteries included doesn't just apply to system calls)
functions are first class objects
boolean expressions are short-circuited
enumerate
any
all
Native Python Functional Affordances
iterators
generators
itertools
functools
map / filter / reduce
dataclasses (with frozen=True for immutability)
named tuples (which are immutable by nature)
Lambda
Drawbacks
(specifically when using Functional concepts in Python)
Tail Call Optimization (recursion limit)
Pattern Matching
Automatic Currying
Pipeline Syntax
Clean Algebraic Data Types
Clean Function Composition
Benefits
Modularity
Composability
Optimization
Testing
Modularity
Small pieces (functions) that are composed and applied to a model allows for reusibility.
Composability
Instead of trying to write W.E.T. functions, or putting them into odd places, composability allows you to build small pieces that you can fit in your head.
Optimization
These small pieces of functionality lend themselves to inspection, and therefore easy optimization.
Testing
Similar to what may be said about optimization, testing is easy with Functional Programming.