Skip to main content

A players by Steve Jobs

· 2 min read
Pere Pages
Software Engineer
A players

Steve Jobs famously spoke about the concept of "A players" in the context of building effective teams. His philosophy was centered on the idea that the best employees, the "A players," are not just marginally better than average employees, but exponentially better. He believed that A players are more creative, productive, and capable of working at a pace and quality level that far exceeds others.

A history about Mixins

· 6 min read
Pere Pages
Software Engineer
Developer with bricks

Mixins are a concept in object-oriented programming where a class can include the properties and methods of another class without extending it. Essentially, it's a way to add functionality to a class from multiple sources.

Important

Especially working with modern JavaScript or TypeScript, you might encounter mixins in legacy code or specific libraries but will likely use more contemporary patterns for code reuse and composition.

Exploring a Layered Architecture Approach in React Applications

· 5 min read
Pere Pages
Software Engineer
Developer with blackboard

Recently, we had an in-depth discussion on structuring React applications using a layered architectural approach. This method aligns with fundamental software architecture principles such as the Single Responsibility Principle (SRP) and the Single Source of Truth (SSoT). It shares similarities with Clean Architecture and Layered Architecture and, interestingly, shows parallels with the Model-View-Controller (MVC) pattern in some respects. We are also applying Dependency Inversion principle (DIP), depending on abstractions rather than concrete implementations of lower-level modules.

TL;DR
  • Benefits: The architecture offers clear separation of concerns, encapsulation, reusability, and scalability.
  • Considerations: Potential complexity, performance implications of using Redux, and the learning curve associated with Redux and thunks.

Deploying SPAs on Github Pages: Solving direct url challenges

· 5 min read
Pere Pages
Software Engineer
Developer using github pages

Deploying single-page applications (SPAs) on platforms like GitHub Pages presents unique challenges, especially when it comes to handling direct URL access. In this post, we delve into the intricacies of setting up a Preact SPA on GitHub Pages, exploring solutions to common routing issues and discussing the broader implications for various SPA technologies.

Monads: Either or Result

· 8 min read
Pere Pages
Software Engineer

functional

Both Result and Either types are considered monads in functional programming. They are commonly used for error handling and control flow in languages that support functional programming paradigms, such as Haskell, Scala, and even in TypeScript with certain libraries.

Both Result and Either are monads because they implement the monadic interface, specifically the bind (or flatMap, andThen) function, and satisfy the monad laws (Identity and Associativity).

These types are powerful abstractions for dealing with computations that might fail, providing a way to sequence operations while propagating errors in a clean, functional way.

Tree shaking, an example with barrels

· 5 min read
Pere Pages
Software Engineer
Tree shake
Tree shaking

Tree shaking is a term used in the context of web development, particularly with JavaScript and modern front-end build tools, to describe the process of removing unused code from your final bundle. It's like shaking a tree to let the dead leaves (unused code) fall off, so you end up with a lighter, more efficient bundle that only includes the code that's actually used in your application.

This concept became particularly relevant with the rise of module bundlers like Webpack, Rollup, and tools like Parcel, which analyze your import and export statements to determine which parts of a module are used by your application. If a function, class, or variable from a module is never used, the bundler can exclude it from the output bundle, reducing the size of your application and improving load times for your users.

Factors that impact quality code

· 15 min read
Pere Pages
Software Engineer
Factors that impact quality code

"Quality code" is one of those phrases everyone agrees on and nobody defines the same way. It's tempting to reduce it to clean formatting or clever one-liners, but the factors that actually move the needle operate at a much higher level: the people, the design, the process, and the feedback loops around the code.

Below is my personal ranking of the factors that impact code quality, ordered from greatest to lowest impact. The ordering is deliberate — fixing a poor team or a broken architecture will do far more for quality than tightening up naming conventions ever could.