Basti Ortiz

Basti Ortiz @somedood

About: Web developer. Open-source contributor. Learner. Writer. Mentor. Leader.

Location:
Philippines
Joined:
Oct 19, 2018

Basti Ortiz
articles - 45 total

You're slicing your architecture wrong!

For the longest time, the separation of concerns has been the ultimate guiding principle of software engineering. This eventually gave rise to the ubiquitous MVC architecture. But, in this article, we'll explore a better way to structure a codebase using a vertically sliced architecture.

Learn More 79 25May 15

Beware the Global Const

It is common wisdom in the programming world to discourage the use of global variables. I've recently come across a bug that humbled and reminded me about these pitfalls. Let me tell you a cautionary tale about global configuration objects.

Learn More 1 5Apr 19

The Curse of Verbosity and Indirection

I've dealt with a wide spectrum of programming languages over the years. One common theme that I've observed is that object-oriented programming patterns tend to yield the most verbose and indirect abstractions. In this article, we explore how pure object-oriented code necessarily leads to more verbose code and more opaque indirections.

Learn More 0 0Mar 23

I was wrong about array methods and generators...

For the longest time, I've always thought that JavaScript generators perform better than chained array methods in terms of execution time. But are generators actually faster than chained array methods? It's finally time to put that to the test—with statistical rigor of course!

Learn More 2 1Sep 9 '24

A Compelling Case for the Comma Operator

The comma operator is one of the lesser-known operators in C-like languages such as JavaScript and C++. Essentially, it delimits a sequence of expressions and only returns the result of the final one. So why would this ever be useful? In this article, I present a compelling case—perhaps the only one frankly speaking—for the comma operator.

Learn More 83 24Sep 6 '24

Bitmasks are not so esoteric and impractical after all...

So one of my articles from my naive 2018 self finally bit me in the back side. Six years and one computer science degree later, I have vastly changed my perspective on bitmasks. In this article, we will discuss why bitmasks are not so esoteric and impractical after all.

Learn More 45 3Jul 20 '24

JavaScript First, Then TypeScript

A recent trend has shaken up the JavaScript-TypeScript community: the anti-build-step movement. In this article, however, I will not argue whether TypeScript is still relevant today. Instead, I reflect on my own journey of stepping away from TypeScript—but for a completely different reason: consumer semantics!

Learn More 67 68Oct 15 '23

🤖 Svelte Reviewed: A Masterclass on Empowerment 🤖

Cybernetically enhanced web apps: Svelte is Stack Overflow's most admired JavaScript UI framework in 2023. In this article, we review the merits of the Svelte framework and its wider ecosystem.

Learn More 53 12Sep 11 '23

Please don't write confusing conditionals

Have you ever spent more than a few seconds staring at the same line of code? How often did you find conditionals that were tricky to parse? In this article, we discuss how confusing conditionals manifest in our code. Along the way, we also explore different refactoring techniques for improving the readability of conditional control flows.

Learn More 129 20Jul 12 '23

Moving Fast: A Retrospective on Trunk-based Development

In this article, I reflect on my experiences with trunk-based development as the project lead for DocTrack, my undergraduate project that rewrites the University of the Philippines' document tracking system as a progressive web app.

Learn More 27 7Jul 5 '23

Promises and Events: Some Pitfalls and Workarounds

More often than not, we find that promises and events have fundamental incompatibilities that make them difficult to interleave. Ultimately, can promises and events coexist? In this article, we explore this question and propose a neat solution.

Learn More 20 1Aug 4 '22

Dipping Toes into Unsafe Code

In this article, we implement a safe implementation of a direct-address table using unsafe code in Rust. In doing so, we explore the mindset and thought processes involved when upholding safety.

Learn More 26 0Jul 21 '22

How Rust helped me power through my C assignments

After an entire semester of C assignments, I share how Rust patterns and idioms helped me power through it all.

Learn More 54 7Jan 29 '22

Optimizing Immutable Strings in Rust

If there's anything about Rust that Rustaceans have a particular aversion to, it would most certainly be cloning and heap allocations. In this article, we will explore how taking advantage of immutability allows us to optimize memory usage.

Learn More 56 3Aug 22 '21

The Proper Way to Write Async Constructors in JavaScript

At the moment, there is no standardized way to write asynchronous constructors in JavaScript. However, this does not mean there aren't any workarounds! In this article, we will discuss the various ways to emulate `async` in `constructor`. Most of them are not-so-ideal, but in the end, I will demonstrate the proper way.

Learn More 150 56Aug 18 '21

Generic `impl` blocks are kinda like macros...

As strange as it may seem, generic `impl` blocks actually have macro-like capabilities. When coupled with the trait system, Rust offers a powerful mental framework for composition-based polymorphism. In this article, we will explore how treating generic `impl` blocks like macros can be an insightful shift in perspective when dealing with generics and trait bounds.

Learn More 50 2Feb 27 '21

🦀 Rust Reviewed: Is the hype justified? 🦀

The Rust programming language has steadily been on the rise in terms of adoption and popularity. But is all the hype justified? In this article, I reflect on my experience with Rust in the past year, tackling the golden moments as well as the pain points.

Learn More 189 36Dec 22 '20

The Future of "View Page Source"

The modern Web boasts leaps and bounds of progress in recent years. The Web has truly become a capable, reliable, scalable, and viable platform for modern applications. However, with all of these fancy features comes the cost of complexity. Build systems rendering the Web as a compilation target have become a common trend among production-grade applications. For new aspiring developers (such as ourselves back then), is this really the best path forward?

Learn More 99 33Jul 31 '20

Best Practices for ES2017 Asynchronous Functions (`async`/`await`)

In the previous article, I discussed the best practices for ES6 promises. Picking up from where we left off, I extend the discussion to ES2017 asynchronous functions, which happen to just be "syntactic sugar" over promises.

Learn More 84 4Jul 29 '20

Best Practices for ES6 Promises

ES6 promises are great! Yet... they are still quite painful to deal with. In this article, I share the best practices I have learned over the years that helped me make the most out of asynchronous JavaScript.

Learn More 65 10Jul 22 '20

18 Essential Videos That Fundamentally Shaped My Understanding of JavaScript

Learning JavaScript is a wild, tempestuous journey. With so much to learn, it is difficult to keep up with the times. Here are 18 videos I consider to be "essential" in learning JavaScript at a deeper level. Each of these videos once sparked a "eureka moment" within me that ultimately helped in piecing together the JavaScript puzzle.

Learn More 161 12Jul 8 '20

The Key to Effective Learning is "Constructive Stupidity"

Setting aside harsh connotations for now, "constructive stupidity" plays a major role in one's motivation to learn. In this article, I illustrate how a shift in mindset (on "stupidity") can foster a healthy, constructive attitude towards learning.

Learn More 17 2Jun 19 '20

Ciphers and Hashes Explained

Cryptography is the fundamental lifeblood of computer security. Unfortunately, with all the hardcore theory and mathematics, it has become one of the least approachable topics in computer science. In this article, as part of our exploration into the essence of cryptography, we will look into the difference between ciphers and hashes.

Learn More 37 0Jun 16 '20

JavaScript Concurrency: Avoiding the Sequential Trap

Idle code is the antithesis of efficiency. In this article, we will look into various ways to reduce a program's idle time during asynchronous operations. From concepts such as concurrency and proper I/O scheduling, this is the beginning of a series that explores the world of asynchronous JavaScript.

Learn More 127 2Jun 14 '20

An Introduction to the Server and the Client

In a world that heavily depends on the Internet, we often don't think about the marvelous engineering that makes the modern lifestyle possible. In the first installment of "The Internet in a Nutshell" series, we will explore how the Internet works from a high-level point of view. Throughout this series, we will explore the incredible technologies, infrastructures, and concepts of the Internet that we may have taken for granted in today's time.

Learn More 51 4Apr 27 '20

Please don't nest promises

As we accustom ourselves with the magical world of promises and asynchronous functions, JavaScript has truly become more than _just_ a "single-threaded language". But nevertheless, there is a great responsibility that comes with these modern features. In this article, I shed light on an often overlooked code smell of asynchronous operations: nested promises.

Learn More 120 6Jan 6 '20

The Semantics of Falsy Values

More often than not, we confuse and interchange the many falsy values in the JavaScript language: `false`, `0`, `null`, and `undefined` among others. In this article, I explain the semantics behind these values so that we can be better informed about their proper usage. By knowing when to use the appropriate falsy value, we can write more readable, maintainable, and semantically correct code.

Learn More 49 15Aug 31 '19

Please don't forget to write the changelog

Changelogs, release notes, and patch notes all have a common objective: to inform readers of recent changes. However, it is unfortunate to know that some still consider the humble changelog as an "optional" stage in the development cycle. In this article, by citing various software changelogs as examples, I discuss how good, clear, and informative changelogs (1) improve overall user experience and (2) establish brand identity and "hype".

Learn More 73 10Aug 29 '19

A Grammar-Based Naming Convention

A programming _language_ is called a _language_ for a reason. In this article, I share with you the grammar-based naming convention I follow for all of my projects. It is indeed a common naming convention, but I hope this article serves as a useful reference for those just beginning their programming journey.

Learn More 169 28May 7 '19

Thank you to byte-sized integers

With the ubiquity of high-level, dynamically-typed languages, we have lost control over the memory allocations of our numbers. In this article, I take the time to give thanks to the unsung heroes of memory optimization: unsigned integer types.

Learn More 24 9May 1 '19