Posts

Showing posts with the label oop

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...

Elegant Objects

Image
Elegant Objects is a book written by Yegor Bugayenko  published in 2020. This book call my attention immediately. I've been working with software for +20 years, and in the past, there were many more Object Oriented books(Head First, Design Patterns, Effective Java, and many more), so the very first thing that call my attention was that "WOW feeling" I thought: "OH! An OOP Design Book was written in 2020?" I need to check this out.  Disclaimer : This is not a Rant. This is not a severe critique of the book; this is my toughs. I highly recommend you buy the book and have your own thoughts. I'm avoiding putting code samples here to keep you curious and read the book and also respect the author's work. Maybe read this post again after you finish reading the book. Maybe create your own blog and share your ideas. The book is well-written, concise and goes straight to the point. I saw a commentary on Amazon from a guy complaining that the book is too opinionat...

Add trait in Rust

Image
Rust has this interesting trait called Add  which allows us to use the + operator and add 2 structs together. This is very useful for numeric types but also for engineering productivity lets say you are building a DSL for instance or an internal DSL. So I made some implementation and a video - Let's get started!

Iterator

Image
Trade-offs are super interesting and excellent exercises you can do to have better design and better coding. Let's say we want to do some simple algorithms that return vols from a String. So how many different implementations can we have? So easily we can think about some sort of Utils or generic function that can do the work for us. What if we cant to be Lazy or Early loading or be able to abstract the process? Well and Iterator is an interesting pattern that we can use to help us to abstract state and have more functionality around the data structure. So because there is the Pattern Iterator you might think that there is just one possible implementation right? Actually, there are several different implementations we can do and we can play with different trade-offs. So today I made 2 java videos to co trought this pattern and show some practicality in code. I hope you guys like it, let's get started. 

Java Object Creation Patterns

Image
Java is an old language. 25 years now. Java has several limitations and issues however java is the robust and pretty well-stablished solution for backend, databases, Caches, Search Engineers,  IoT, and much more. Today I want to share some patterns about object creation. I highly recommend you read Effective Java book, which was a huge inspiration for this blog post. So I want to show you guys some useful patterns like Static Factories, Builder, Singletons and Immutable Objects.  So I made a quick video with code, let's get started. 

Internal System Design: The Forgotten Discipline

Image
Several years ago it was impossible to think about software development without having at least a business specification(usually in a word document) and a bunch of UML diagrams like package, class and sequence diagram. That was a pre-agile era where process and formality ruled the IT software development industry(yes folks, yes I'm old). Back on that time software engineering was pretty much conceived as "process".  Now we live in a more civilized era, however, back on that time, there were some interesting and valuable things(tools, techniques, principles and even practices).  Like the English expression, you need throw bath water but keeping the baby. I was wondering why these phenomena happened and still happen today. First of all, we are SOCIAL animals we tend to have some kind of "fashion" behavior where we follow the "flow". Needless to say that UML and Software internal design is not quite popular today with the new kids. I don't miss the...

Feeling OOP in C

Image
C language is old(since 1972 to be precise) but still kicks ass. Some folks consider C too low level. IMHO is not that low level, actually, there are some abstractions and syntactical sugars I miss in C but IMHO is something you can leave without since you are befiniting from better performance. Many developers care too much about syntax today and not many care about performance. It really depends on what you are doing and what kind of company you are. There are languages that are more productive than C for sure, however, once you get how to do things properly is not bad at all actually is quite good.  Most of the big languages like Java, C#, python, ruby are actually based on C. C often is a language the most of people fear it. Maybe because we got used to much with languages that do a lot of things for us. IMHO is not that hard, it's just a matter of taste, after some time I learn to enjoy working with C professionally and today I like it a lot. But this really depends...