---
title: "Henrique Barcelos (@hbarcelos) | Hashnode"
description: "Software Engineer | Software Architect | Blockchain Enthusiast. Read the latest articles by Henrique Barcelos on Hashnode."
url: "https://hashnode.com/@hbarcelos"
---

@hbarcelos

# Henrique Barcelos

@hbarcelos · Planet Earth, Milky Way · Joined June 2019

Software Engineer | Software Architect | Blockchain Enthusiast

[Website](https://blog.hbarcelos.dev/)

## Comments

[I have heard of createAsyncThunk, but didn't have a chance to play with it yet. As soon as I got some spare time I'll do that. Thanks. I use selectors for anything I might want to use in a component. Sometimes I want to provide feedback to the user about an action that failed, even if I need to embellish it first. For that reason, I need to extract the error from the store, therefore the selector.](https://hashnode.com/posts/a-better-approach-for-testing-your-redux-code/5ddb17a11d03daa468a991fc/comment/5e85d92907bee7152c3e2900#reply-5ea02ed612892a3c760b379f)

Reply · Article · Apr 22, 2020 · [A better approach for testing your Redux code](https://hashnode.com/posts/a-better-approach-for-testing-your-redux-code/5ddb17a11d03daa468a991fc)

[Promises are not cancellable. You can use Promise.race() to get the fastest one, but you can't prevent the others from being settled eventually. Their resolving/rejected values will eventually be freed up by the garbage collector, so this is not much of a problem.](https://hashnode.com/forums/thread/how-will-you-return-the-promise-which-will-resolve-earlier-than-others-in-an-array-of-promises-and-cancel-others-which-are-pending/comment/5ddef90cf1234a2f712634cd)

Comment · Thread · Nov 27, 2019 · [How will you return the promise which will resolve earlier than others in an array of promises and cancel others which are pending?](https://hashnode.com/forums/thread/how-will-you-return-the-promise-which-will-resolve-earlier-than-others-in-an-array-of-promises-and-cancel-others-which-are-pending)

[I think the main issue is that people don't know JavaScript very well. JavaScript itself is sort of a Frankenstein. Non-technical people tend to think it is somewhat similar to Java, which couldn't be further from the truth. What Brendan Eich wanted to do back in the time while he was designing the the first version of JS was something like Scheme in the browser. He was "forced" by non-tech stakeholders at Netscape to make it look and feel like Java, because of its popularity back in the day. So JavaScript has an identity problem. While at the surface it resembles Java, on the one hand because of the name and the other because some constructing blocks and its syntax, it is very (very!) different from it. For starters, JavaScript is not a traditional OOP language. Despite the last years effort of making it more familiar to OOP developers with the introduction of keywords like class and all that comes with it, under the hood it is still 100% prototype chaining. And that's what almost everyone that writes JavaScript doesn't understand. I've been JavaScript'ing for about 10 years now and I can count in my hands the number of people I've crossed paths with which truly understood the nature of JavaScript prototype model. I believe the recent wave of Functional JavaScript probably made Brendan Eich happy, because it is much closer to what he envisioned there than the persisting OOP-dominant view we had so far. While not a full-fledged functional programming like Haskell, OCaml, F# and others, FP just seems way more natural to JavaScript constructs than OOP. In fact, most of the clumsy stuff in JS is related to how it treats objects. It took me years to understand this properly and if I'm not paying attention, I can do something wrong with it even nowadays. Another reason why I love JS (well, most of the time at least) and probably why many people hate it is the degree of freedom it offers. I think the only other language I know that won't get in your way even if you are doing stupid things is PHP. JavaScript lets you free to do whatever you want, but freedom always come with responsibility. It can be burdening having to think about every detail on how to architecture your app, what should be the folder structure, which framework to use. People tend to suffer from analysis paralysis. I myself suffered from this. But then I learnt to embrace this freedom. Every time I start a new project, I get to experiment new patterns, new structures, take some concept borrowed from a language I'm just learning. Sometimes very good things are born from that. Sometimes I fail spectacularly. And that's ok! People who tell that JS doesn't scale probably forgot to tell that to Paypal, Netflix and many other big companies out there. Here ns Brazil there is big bank whose API layer is (or was about 3 years ago) entirely written in Node.js. Even Microsoft has embraced it. "Oh, but without type safety, if you change X in Y place, you can break something somewhere in Z". Sure. This also happen in more strict languages, you just discover that earlier. Usually this is a symptom of a much deeper problem: you are not setting the boundaries correctly in your application. There is too much coupling. And if you really really need that compiler telling you you are a moron, that's what TypeScript is for. And guess what, TypeScript is just JavaScript with some sugar on top of it. The programming model is still the same, the constructs are mostly the same, the syntax is very similar as well. In the end, it all comes around to that old saying: There are only 2 types of programming languages: the ones people complain about and the ones nobody uses.](https://hashnode.com/forums/thread/opinion-why-is-javascript-so-unpopular/comment/5dde8c9c70ff51347196a763)

Comment · Thread · Nov 27, 2019 · [\[Opinion\] Why is JavaScript so unpopular?](https://hashnode.com/forums/thread/opinion-why-is-javascript-so-unpopular)

[Hi y'all! I'm Henrique, a software engineer from Brazil. I've been working with web stack applications for 4.5 years now, mostly with the Javascript/Node.js ecosystem. I'm a VImer. Not a purist though. Lots (LOTS!) of plugins. Here's my vimrc if someone's interested. I use Linux as my main OS. Started with Ubuntu, went to Debian and Mint, but they weren't good enough for me. Then I discovered Arch based distros; started with Arch itself, but who's got the time to install it ¯\_(ツ)\_/¯? Eventually I settled for Manjaro with Cinnamon. I know my ways through the CLI as well. Professionally I try to excel for software engineering and architecture best practices. I have always being some kind of (sometimes heated) advocate for them. What I enjoy the most are architectural discussions, but I try hard to avoid that leading to a BDUF (Big Design Up Front). I'm also into functional programming, just getting passed the basic stuff and starting to go more deeply into Category Theory (wish me luck). My algorithmic skills are not so great currently, mostly because I forgot all that stuff I saw in college (dynamic programming is something that for unknown reasons have been completely wiped out from my memory) and my work have never included solving this kind of problems. <rant-mode on> This gives me a hard time on white-boarding interviews or even LeetCode/HackerRank tasks if we're talking about complex algorithms, which ends up being a no go for many nice companies out there, even though I have a B. Sc. of Computer Engineering and proven experience on the field. </rant-mode> I've been JavaScripting for about 10 years now. HTML and CSS go as much as long. I started with PHP, but eventually migrated to Node.js. I've used MySQL, MongoDB, Redis, DynamoDB during these years. I had an immersion on AWS a few years ago and can get myself around with it pretty well (EC2, ElasticBeanstalk, S3, SQS, Route53, CloudFront, CloudWatch, Kinseis, VPC, IAM, Lambda, CloudFormation). I've been using React professionally for about 1.5 years now, it's amazing. Next on my pipe I have: Go, Rust, Haskell, Vue.js and Kubernetes (not necessarily in that order). I'm currently trying to shift my career towards blockchain, crypto and their applications, but feeling a little bit overwhelmed by how much this scene has changed since the last time I was looking into this from a professional perspective, which was on early 2016. Let's see what play out. I'm not a traditional geek, in the sense I'm not really into comics, anime, games, RPG or any formely-geek-turned-mainstream stuff. I just happen to like building things and the way I chose to do so was through code. Aside from software engineering and architecture, I'm into: Martial Arts/Self-Defense: I did some Karate as a kid, now I'm 2.5 years into Krav Maga (the original one), an Israeli self-defense technique. Currently I wield the orange belt. Photography: mostly amateur. I've been postponing being more serious about it for quite sometime now, part due time constraints, part due equipment being ridiculously expensive in Brazil. I do what I can with my phone camera. Sometimes I can get some really nice shots , but currently is more about luck than skill. Music: I used to play the guitar. I'm organizing myself to get back to it eventually. I've always dreamed about having a band, nothing serious, just for fun. Maybe that will come true someday. I'm mostly into Rock 'n Roll and Heavy Metal, but I also like some Brazilian rhythms known as Forró and Moda de Viola. Humanities: I'm mostly into Economics and Politics. I'm a hard core libertarian (no, I don't want to sell your kids in the black market), suspicious of any kind of government or government sponsored/protected corporations (which means pretty much any company of considerable size), no matter what the political view they claim to have. I believe in a world where all today considered to be state attributions can be provided by private institutions in a (real) competitive free market (yes, even free basic services for very poor people). Beer: I like experimenting local branded beers in every place I visit. I don't know exactly what is my favorite kind of beer (it's probably one between IPA, Witbier and Tripel), but I definitely don't like the black ones (like Bock or Stout). Lucky me Brazil has had a beer-craft explosion the past few years, so it's really easy to find good beers at a relatively good price here (would be even cheaper if it there wasn't a ~51% tax on alcoholic drinks). I currently live in a (very) small apartment, but as soon as I move to a house with a proper garden I might start my own amateur beer-craft.](https://hashnode.com/forums/thread/introduce-yourself-to-the-hashnode-community/comment/5d13b15f010eab90353d3832)

Comment · Thread · Jun 26, 2019 · [Introduce yourself to the Hashnode community! 👋](https://hashnode.com/forums/thread/introduce-yourself-to-the-hashnode-community)
