The COMPLETE Liskov Substitution Principle

LSP (short for Liskov Substitution Principle, not for Language Server Protocol) is probably one of the least understood concept of the SOLID principles. So in this post, I want to actually address the complete principle, not just what people know.

Because of the “typed” nature of the LSP, I’ll try to use a language that people are familiar with, and that I can show in a playground somewhere: Typescript. Truth to be told, I am not a Typescript developer (nor do I actually like the language) so my code might be a little weird. Anyway, moving on:

What people know

The actual text is

Let Φ(x) be a property provable about objects x of type T. Then Φ(y) should be true for objects y of type S where S is a subtype of T.

This is actually hard to read, so people simplify, usually, with:

Objects of a superclass shall be replaceable with objects of its subclasses without changing behavior

Which is correct, but incomplete.
(more…)

Last open-source improvements

For the last two months, I have been busy searching for a new job, unfortunately. But also, because of this, I was able to evolve on lots of projects that I have been working in a while. So in this quick post I want to explain a little bit what I did, what is happening, and hopefully somebody might be interested in some very interesting improvements.

First thins, I already wrote about Chlorine in my last post. This week I was able to remove all the dead code that I had in the previous version, and I’m closer than ever to publish a new version of that I will call “Version 2.0”. Unfortunately, this version will be lacking some features that the previous version had, and I’m not really sure if I’m going to add this back or not.

But the thing is, because the new Chlorine is more configurable and the config file is easier to write, I hope people can add these features in user-space, so I can decide later if I’ll re-include them or not (it’s always easier to add stuff than remove what people already depend on).
(more…)

A new Chlorine is almost done!

For the last few months, I’ve been working on a new version of Chlorine (now that Pulsar is on a good track). Here I want to share what to expect of this new version.

For a quick TL;DR; it’ll have better ClojureScript (shadow-cljs) support, fix some bugs related to evaluating code and the REPL being “locked” without returning the results or evaluating new commands, and have better configurable parameters. Things will probably break a little bit – it’s not a non-breaking-change, unfortunately – but hopefully it’s good enough that people will want to migrate to the new version.
(more…)

How to NOT make a RPG history

So, recently, I decided to try Zelda – Tears of The Kingdom. While the game is visually beautiful, it lacks something, and I wasn’t sure what it is, until I found a gameplay of the whole game (and experienced parts of it myself) so I will try to summarize my discomfort with it.

Obviously, this post is full of spoilers for both Tears of the Kingdom and Zelda – a Link to the Past (the SNES game) so if you didn’t play them and intend to do, then don’t read more. But if you’re not interested in playing any of them (especially if you don’t intend to play A Link to the Past, because in my opinion it is a better game) and you’re interested in having my thoughts (which, obviously, are mine only, and only my personal opinions of course) then…
(more…)

My problem with Microsoft products

If you follow my blog for a while, you know I hate Microsoft. That’s a fact. But in this post, I will do a different take – a look at their products instead of the practices.

So, recently I had the experience of having to use Microsoft for business. This means… well, honestly, I don’t know what that means – and that is part of the problem. Am I using Office 365? No, it doesn’t seem so. So is it a Microsoft account? Again, no – logging in to it says that my account doesn’t exist. Is it Hotmail? No. Is it Outlook? Well, kinda – I do use outlook on this account, but if I go to outlook.com and try to login, it redirects me to login.live.com. So, my business account is a Microsoft Live account, right?

Well, no. Of course, not.
(more…)

Eventually, all unicorns turn to be just slim Rhinoceros

For people that are not aware of the term (a term that I actually don’t like that much), “unicorn companies” or “unicorn startups” are companies that basically get hyper-funded and gets a lot of investments in a period of time: the idea is basically that a company (or startup) have such a wonderful idea, or a wonderful execution of that idea, that people want to put money on it, to the point of millions (or even billions) of USD, on the hope that the company will revolutionize the market. Nubank is an example; Twitter’s probably another one; and there were a lot of companies (specially startups) that are trended as “unicorns”.

For me, there is a real problem with the term – it uses a mythological animal to explain the company. Unicorns don’t exist, which basically mean that the “money” an Unicorn Company make also… don’t exist. At least, not for now; there’s a promise that it will be profitable in the future. Considering we’re talking about literally millions of USD, these want to probably get thousands of millions in return. So they start by making less than zero to the point of trying to reach eight zeroes to the right of some number, at least. They also don’t need to be sustainable, or sometimes even have good code, in the beginning – what matters is the idea, and that they somehow get founded by a group of investors.

And that’s where the problem comes in. I worked at some of these companies in the past, but up to that point I never knew what it means to have such a big money invested. The thing is, good practices in both product and code were present, for sure. But the focus was on delivering – so everything goes to the drain if you’re not delivering fast enough – you always have to deliver something new, something that the users will like, and it have to make to production really to see if that idea will make sense or not.

Which is good enough, but there’s a problem. Your products will always get worse.
(more…)

We were always this bad.

One point that I keep hearing is how internet made us all worse. In a way, it seems to be true; but let me tell a story first.

When I was young, there was no internet. I think I connected to the internet for the first time in my life when I was 15 years old, and it was way different than things are today – I remember that Google didn’t exist, or it was too slow to run on my very slow modem.

I also have to make a disclaimer: when I was young, like 15 or 16 years old, I did not see too much malice in the world. I could not understand the whole idea of prejudice for example – the single idea that one could hate others for their skin color or for the place they were born was alien to me… until I met someone that, indeed had this mentality. But again, I didn’t think too much about it – that person was not really a good person, and while I did associate with they (I was a nerd boy with no friends, a teenager already makes stupid choices by design, this was only an amplifier) when that person left my life it indeed felt that things were going to be better.

Well, fast-forward to some years, comes the first social networks. And then, I met a whole new group of idiots in 9gag, Facebook, the old Orkut… it was hell, but I made my decision to quit all of these networks, and I felt things, again, were better. After all, the internet gives voice to idiots, that eventually find other idiots, and these make a group that would never act like that in public, right?

Right?

Well, I was already quite old when a very close family member asked me if the relationship that I was starting with the one that eventually became my wife was going well – after all, she’s protestant-ish, and I am catholic (spoiler alert – I am not. But again, that person was already quite old and they never really approved the fact that I didn’t go to church), so the relationship is bound to have problems, right? I dismissed the person, without giving too much though about it.

Until the moment my SO and I got into a crisis, and spent a whole year distant; the moment when I heard the words “it’s weird for you to be with a black woman”.
(more…)

Bun is released – let’s jump the hype (NO)!

Bun 1.0 was released. And again, the JS ecosystem did what they do best – fell up into hype.

I actually have no idea why this happens so much in JS world; maybe it’s a lack of maturity (I mean, Ruby also did the same in the past, then they figured out it’s not always a good idea to throw away everything when a new stuff appears), maybe it’s something else; maybe people are just desperate to have something better in the JS world – who knows?

Anyway, I decided to do some benchmark tests. I was already not impressed, because I did test Bun in the past, but let’s see what happens with this new version:
(more…)

They locked us outside of freedom

Recently, I saw myself forced to use a Mac. And then, finally things became clear: why I don’t like macs, and why people do like it, and why Linux is not popular.

It is quite simple, honestly – closed-source software works incredibly well with other closed-source software, and incredibly bad with any open standard.

It’s the equivalent of creating a comfortable city, with filtered air and water, but that somehow makes you allergic to natural air and water. And then, they convince you that natural air is bad for you.

So, let’s dive a little on my experience with Mac – remember, I use Linux most of the time, my wife also uses Linux (by choice, by the way, although basically nobody believe me when I say that, and no, she’s doesn’t work with computers), so my whole life is somehow based on open standards. So, the first thing I tried on my Mac was to start some open standard services – OpenSSH, VNC, for remote access…
(more…)

CommonJS is not a problem – the Javascript ecosystem is

Recently I came across this post saying that CommonJS is hurting the JavaScript world. And while I do agree that the CommonJS specification was not a good one, I also disagree a lot with the article. As someone who have strong opinions about the subject, I decided to write a post about it.

So, here’s the problem: supposing that you have a legacy system that’s years old, and that basically is modular, meaning that people write extensions, or libraries, to that. Like for example, NodeJS’ CommonJS. Now, here’s the problem: if that legacy system is flawed, and you need to change somehow, and your solution is “let’s do something that is better in any way than the older model, it’s faster, etc, but also completely incompatible with the old stuff” – meaning that we have to rewrite everything to be able to be used on this new format – then you’re doing it wrong.
(more…)