Posts

Showing posts with the label functional

Functional Programming

Image
There are many programming languages. Most of them are based on C. However, there are a few different schools of thought. There are imperative, object-oriented, and functional schools and a couple of branches and variations, but that's the mainstream of languages you will see in production in big companies. Programming languages is how we express our intents and turn that intent into value for people. Usually, people are concerned about how other engineers would read the code, make sense of it, and be able to effectively maintain it. System programming languages like C and Zig tend to focus more on performance over abstractions (which always have a cost). Object-oriented programming languages like Java focus more on structure and how to abstract things. Abstractions are not necessarily bad if done right. They have a cost and impact on the people who maintain them. Having more abstractions on the SDK or standard library is a good thing for mantainance and increases people's kno...

Closures in Rust

Image
Rust allows us to do functional programming. One important thing in FP is being also to pass functions as parameters and also return functions which are also called high Order Functions. Today I want to share 2 videos and 2 pocs showing how we can do High Order Functions in Rust also you will get currying for free :-). I also will show how we can do closures using traits as well. So Let's get started!

Functional Programming in Kotlin

Image
Kotlin is an interesting JVM language. Today I want to show some capabilities Kotlin has around Functional Programing. FP is a very interesting way to think and create safe programs. Today we will cover High Orde Functions, Lambdas, and also Class extensions. So today I made a simple video and code POC. Let's get started! The Video The Code https://github.com/diegopacheco/kotlin-playground/tree/master/kotlin-fp-fun Cheers, Diego Pacheco

Code for Reliability

Image
It's normal to talk about failure when we talk about cloud-native architectures. Pretty much anything that runs on the cloud(data center) means more distribution(networking). Distributed Systems tend to fail all time. Chaos Engineering is great, however, it's for the infrastructure, therefore focused on the big picture. When I say big picture I mean outside of a microservice. Reliability is not just for the outside boundary or infrastructure but also for Inside a service or inside the system. Reliability Inside the system might have many names such as(very popular in Brazil during 2k years) Defensive Programming .  There are lots of synergy between reliability , defensive programming, anti-fragility and Efficient Internal System design. Efficient design it's not only about making your system efficient in sense of economics(code, readability, reduce maintained cost) but also reliability. Today I want to share some internal system design way of think in order to ach...

SOA has Roots in Agile and Functional Programming

Image
SOA it`s about software architecture so its about an overall solutions for a business.  Thats what the 'A' stands for. Behind this we got Service Orientation as the main paradigm of doing some, its a way of thinking and it has principles like OOP, FP and Agile. SOA got popular around 2k years when business was moving to more complex functionality and more and more data. Them it came several buzzwords and vendor-like things, but soa was never about technology was always about principles and a specific way to think, see and build things, the service orientation. To capture this view a group of awesome people created the soa manifesto .

Consumers and Suppliers on Java 8

Image
I worked with Scala since 2011. Its awesome, its clear to me java 8 copies several ideias from scala but thats fine, i think java 8 is not scala but is cool and its something we can take benefit as jvm users no matter if is coding on java or scala or groovy or jython or jruby. Java 8 finally bring some functional programming ideias into the JVM. Java 8 its hybrid part OO part functional. Java does functional programming using the constructs and the metaphor around the JVM so they sicked to the current design flow, what it make sense on the jvm design philosophy. (They copy some ideias from Scala, sure). Right the idea of this posts is talk a little bit on the @FunctionalInterface annotation and some Consumer and Supplier java.util.function.* functions, thats enable us do functional programming in java. Functional programming is java 8 required structure you cannot just start coding things like you do in clojrue or even scala. Some stuff on the JDK is already ported to @Function...