<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>creatures.dev</title><description>creatures.dev - a community of developers excited about code</description><link>https://creatures.dev/</link><item><title>Bun: Join the Fast Lane in Runtime</title><link>https://creatures.dev/blog/bun-join-the-fast-lane-in-runtime/</link><guid isPermaLink="true">https://creatures.dev/blog/bun-join-the-fast-lane-in-runtime/</guid><description>Discover how Bun is changing the game for JavaScript developers with its exceptional features, comprehensive docs, and streamlined development experience.</description><pubDate>Tue, 12 Sep 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;The world of JavaScript development is ever-changing, and developers are
continually seeking tools that can simplify their workflows and boost
performance. In this blog post, we&apos;ll take a deep dive into Bun and discover why
it&apos;s poised to become the future of JavaScript development. We&apos;ll explore how
Bun can become an essential part of your toolkit, helping you work smarter, not
harder.&lt;/p&gt;
&lt;h2&gt;Meet Bun&lt;/h2&gt;
&lt;p&gt;Bun isn&apos;t your run-of-the-mill JavaScript runtime and toolkit—it&apos;s a
game-changer for developers. By seamlessly integrating bundling, testing, and
package management capabilities into a single, robust package, Bun eliminates
the need for juggling multiple tools. With Bun by your side, you can streamline
your workflow and accomplish more with fewer headaches. Let&apos;s delve into why Bun
stands out in the JavaScript development landscape.&lt;/p&gt;
&lt;h2&gt;Key Features&lt;/h2&gt;
&lt;p&gt;Bun comes packed with a bunch of game-changing features that will supercharge
your development process, such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Lightning-Fast Performance:&lt;/strong&gt; First things first, Bun is FAST. How fast, you
ask? It&apos;s like strapping a rocket to your code. It taps into the JavaScript
Core engine from Safari, optimized for lightning-quick startup times. And
here&apos;s the kicker—it&apos;s built in Zig, a programming language that knows how to
tackle performance bottlenecks. So your code runs at warp speed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;TypeScript Support Made Easy:&lt;/strong&gt; Tired of wrestling with configurations and
dependencies when working with TypeScript? Bun&apos;s got your back. It&apos;s all about
making your TypeScript journey smooth as butter. Plus, it plays nicely with
JSX and has hot reloading, so you can focus on coding, not setup headaches.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Unified Modules:&lt;/strong&gt; No more module conflicts! With Bun, you can use both
import and require in the same file without causing a ruckus. It&apos;s like the
United Nations for modules, promoting harmony among your Node.js packages.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Native APIs:&lt;/strong&gt; Let&apos;s talk about native APIs. Bun simplifies common tasks
like reading and writing to the file system. You know those tasks that used to
be a chore? With Bun, they&apos;re a breeze. More speed, less effort.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Lightning-Fast Package Manager:&lt;/strong&gt; Wait, there&apos;s more! Bun comes with a
standalone package manager that&apos;s not just fast; it&apos;s up to 25 times faster
than npm. Say goodbye to waiting around for packages to install—Bun gets you
back to coding in no time.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Detailed Documentation&lt;/h2&gt;
&lt;p&gt;One key aspect that sets Bun apart as the future of JavaScript development is
its comprehensive documentation. Unlike many other tools, Bun provides detailed
and user-friendly documentation that can guide developers of all levels through
every aspect of the tool.&lt;/p&gt;
&lt;p&gt;Whether you&apos;re just getting started or looking to explore advanced features, the
&lt;a href=&quot;https://bun.sh/docs&quot;&gt;Bun documentation&lt;/a&gt; is your go-to resource. It covers
everything from installation and setup to in-depth explanations of its features
and usage. With such well-crafted documentation, you&apos;ll never feel lost when
working with Bun.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Bun is poised to redefine the landscape of JavaScript development. With its
exceptional performance, seamless TypeScript support, unified module handling,
native APIs, and blazing-fast package manager, it offers a compelling toolkit
for developers.&lt;/p&gt;
&lt;p&gt;Moreover, Bun&apos;s commitment to providing comprehensive documentation ensures that
developers can easily harness its power to streamline their workflows and boost
productivity.&lt;/p&gt;
&lt;p&gt;Don&apos;t miss out on the future of JavaScript development. Give Bun a try, explore
its capabilities, and witness firsthand how it can enhance your development
process.&lt;/p&gt;
</content:encoded><author>Vasko Pavic</author></item><item><title>CSS Container Queries</title><link>https://creatures.dev/blog/css-container-queries/</link><guid isPermaLink="true">https://creatures.dev/blog/css-container-queries/</guid><description>CSS Container Queries are a new way to write CSS that allow you to scope styles based on the size of a containing element rather than the size of the viewport. In this article we&apos;re going to learn all about container queries.</description><pubDate>Wed, 30 Aug 2023 00:00:00 GMT</pubDate><content:encoded>&lt;iframe
  width=&apos;100%&apos;
  style=&apos;aspect-ratio: 16/9&apos;
  src=&apos;https://www.youtube-nocookie.com/embed/CHKUFsnABw4&apos;
  title=&apos;CSS Container Queries&apos;
  frameborder=&apos;0&apos;
  allow=&apos;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&apos;
  allowfullscreen
&gt;&lt;/iframe&gt;
&lt;p&gt;Unlike Media Queries, which let you apply styles to an element based on the
viewport size, Container Queries let you apply styles to an element based on its
own size. Talk about next level responsive design! And the best thing is, it’s
supported by all modern browsers! Let’s say you want a card’s layout to be
horizontal if it has at least a certain width, and switch to vertical when it
gets narrower. Here’s an example:&lt;/p&gt;
&lt;p class=&quot;codepen&quot; data-height=&quot;600&quot; data-theme-id=&quot;dark&quot; data-default-tab=&quot;css,result&quot; data-slug-hash=&quot;vYvYRWr&quot; data-user=&quot;nikolovlazar&quot; style=&quot;height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;&quot;&gt;
  &lt;span&gt;See the Pen &lt;a href=&quot;https://codepen.io/nikolovlazar/pen/vYvYRWr&quot;&gt;
  CSS Container Queries&lt;/a&gt; by Lazar Nikolov (&lt;a href=&quot;https://codepen.io/nikolovlazar&quot;&gt;@nikolovlazar&lt;/a&gt;)
  on &lt;a href=&quot;https://codepen.io&quot;&gt;CodePen&lt;/a&gt;.&lt;/span&gt;
&lt;/p&gt;
&lt;script async src=&quot;https://cpwebassets.codepen.io/assets/embed/ei.js&quot;&gt;&lt;/script&gt;
&lt;h2&gt;Containment context&lt;/h2&gt;
&lt;p&gt;Looking at the example, we can see that our &lt;code&gt;article.post-card&lt;/code&gt; has a
&lt;code&gt;container&lt;/code&gt; property with a value of &lt;code&gt;post-card / inline-size&lt;/code&gt;. This declares a
containment context on our post card element. The &lt;code&gt;container&lt;/code&gt; is a shorthand
property that sets the &lt;code&gt;container-name&lt;/code&gt; to &lt;code&gt;post-card&lt;/code&gt; and the &lt;code&gt;container-type&lt;/code&gt;
to &lt;code&gt;inline-size&lt;/code&gt;. The &lt;code&gt;inline-size&lt;/code&gt; value declares the containment context on
the inline axis of the container. This means that you can only define styles
based on the width of the container. If you also want to define styles based on
the height, you can use the &lt;code&gt;size&lt;/code&gt; value.&lt;/p&gt;
&lt;p&gt;Bear in mind that when you declare a container to a certain element, &lt;strong&gt;it will
prevent it from being sized based on its contents&lt;/strong&gt;. This goes for both &lt;code&gt;size&lt;/code&gt;
and &lt;code&gt;inline-size&lt;/code&gt;. To provide size to the “containerized” element, you would
need to either define it through its parent (flex and grid stretch by default)
or its display (block also stretches by default), or set its &lt;code&gt;width&lt;/code&gt; or &lt;code&gt;height&lt;/code&gt;
explicitly. Setting the &lt;code&gt;container-type&lt;/code&gt; to &lt;code&gt;size&lt;/code&gt; will collapse its height,
while setting it to &lt;code&gt;inline-size&lt;/code&gt; will collapse its width.&lt;/p&gt;
&lt;p&gt;Another thing to have in mind is that you can’t use an inline element as a
container. If you were to define a &lt;code&gt;span&lt;/code&gt; as a container, you could, but you’d
have to make it a non-inline display. &lt;strong&gt;Rule of thumb: any element that’s not
inline can be made into a container&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;Container query&lt;/h2&gt;
&lt;p&gt;Check out line 40. We set the &lt;code&gt;.content&lt;/code&gt; element’s &lt;code&gt;flex-direction&lt;/code&gt; to column.
On smaller sizes we want the image and text to be one on top of the other, but
if we have enough horizontal space we can actually put them one next to the
other, or set the &lt;code&gt;flex-direction&lt;/code&gt; to row. That’s a use case for a container
query! Scroll down to line 96:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;@container post-card (min-width: 512px) {
  ...
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is how we define a container query. With this line, we’re basically telling
CSS “when the post-card container (not element with class) has at least 768px of
width, apply these styles (…)”. The top level scope is the &lt;code&gt;article.card&lt;/code&gt;
element. We should take that in consideration when writing the selectors. On
line 99 we redefine the &lt;code&gt;.content&lt;/code&gt; element’s &lt;code&gt;flex-direction&lt;/code&gt; to &lt;code&gt;row&lt;/code&gt;. That’ll
make the image and text to flow horizontally, and if we expand the viewport
enough we’ll see that the card’s content changes direction. Notice that if we
change the selector to &lt;code&gt;article.post-card div.content&lt;/code&gt; it won’t work, even
though it’s a perfectly valid selector, because it would expect to find an
&lt;code&gt;article.post-card&lt;/code&gt; inside of the &lt;code&gt;article.post-card&lt;/code&gt; element and we both know
that’s wrong. But following this example, we can redefine any property of any
descendant of our &lt;code&gt;article.post-card&lt;/code&gt;. That’s the beauty of it!&lt;/p&gt;
&lt;h2&gt;Container query units&lt;/h2&gt;
&lt;p&gt;Along with the new &lt;code&gt;@container&lt;/code&gt; syntax, we also get brand new values that are
relative to the container size. Here are they:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;cqw&lt;/code&gt; is 1% of the container’s width&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cqh&lt;/code&gt; is 1% of the container’s height&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cqi&lt;/code&gt; is 1% of the container’s inline size&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cqb&lt;/code&gt; is 1% of the container’s block size&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cqmin&lt;/code&gt; and &lt;code&gt;cqmax&lt;/code&gt; are the smallest and largest (respectfully) value of
either &lt;code&gt;cqi&lt;/code&gt; or &lt;code&gt;cqb&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So, if we wanted to set something to be the 3% of the container’s width for
example, we would set it to &lt;code&gt;3cqw&lt;/code&gt;. Scroll all the way down to line 123, 128 and
133, and you’ll see that the text elements are being set to a certain percentage
of the container’s inline size. Try changing the size of the card and you’ll see
that the font size grows and shrinks with the card. This might not be a
real-world use case, but you get the gist 😁.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;So there you have it! Container Queries! How cool are they? You can use them to
define responsive elements that react not based on the viewport’s size, but
based on the space they’re given, regardless of the viewport size. That means
that you can have two instances of the same component on a page, but because of
the different space they’re given, they’ll appear differently. Check out the
&lt;a href=&quot;https://creatures.dev/blog/all/1/&quot;&gt;creatures.dev blog page&lt;/a&gt;. The featured post
card is the same component as the post cards in the grid below. That card is the
card from this example, but used in production. If you want to see more use
cases, check out
&lt;a href=&quot;https://css-tricks.com/a-few-times-container-size-queries-would-have-helped-me-out/&quot;&gt;this article&lt;/a&gt;
(takes you to CSS Tricks).&lt;/p&gt;
</content:encoded><author>Lazar Nikolov</author></item><item><title>CSS Style Queries</title><link>https://creatures.dev/blog/css-style-queries/</link><guid isPermaLink="true">https://creatures.dev/blog/css-style-queries/</guid><description>CSS Style Queries are a new way to write CSS that allow you to scope styles based on the size of a containing element rather than the size of the viewport. In this article we&apos;re going to learn all about style queries.</description><pubDate>Wed, 30 Aug 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Style Queries is a very cool feature in CSS, and they’re defined by the
containment spec. Aside from being able to query a parent’s inline size (that’s
container queries), the containment spec also includes the ability to query a
parent’s style values (that’s style queries). Even though the container queries
are available in all modern browsers, the style queries aren’t. Chrome and Edge
have it. Opera’s working on it. Firefox and Safari, not so much. If you haven’t
learned about container queries so far, check out our
&lt;a href=&quot;/blog/css-container-queries&quot;&gt;Container Queries&lt;/a&gt; article. Style queries are just
slightly different than container queries, so I’d suggest to learn about
container queries first. Alright, let’s play with some style queries!&lt;/p&gt;
&lt;h2&gt;Syntax&lt;/h2&gt;
&lt;p&gt;Here’s our first example:&lt;/p&gt;
&lt;p class=&quot;codepen&quot; data-height=&quot;600&quot; data-theme-id=&quot;dark&quot; data-default-tab=&quot;css,result&quot; data-slug-hash=&quot;NWeWxov&quot; data-user=&quot;nikolovlazar&quot; style=&quot;height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;&quot;&gt;
  &lt;span&gt;See the Pen &lt;a href=&quot;https://codepen.io/nikolovlazar/pen/NWeWxov&quot;&gt;
  CSS Style Queries (Spotify Daily Mix cards)&lt;/a&gt; by Lazar Nikolov (&lt;a href=&quot;https://codepen.io/nikolovlazar&quot;&gt;@nikolovlazar&lt;/a&gt;)
  on &lt;a href=&quot;https://codepen.io&quot;&gt;CodePen&lt;/a&gt;.&lt;/span&gt;
&lt;/p&gt;
&lt;script async src=&quot;https://cpwebassets.codepen.io/assets/embed/ei.js&quot;&gt;&lt;/script&gt;
&lt;p&gt;The markup is simple. We have a list of collection of cards who have an image, a
title and some text. We can see that the images have an overlay with different
colors. We can call them different variants of the card, and it’s a really good
example for demonstrating style queries. Let’s break down the example. In the
markup, we can see that we’re defining a CSS variable on every &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; element:
&lt;code&gt;style=&apos;--variant: teal&apos;&lt;/code&gt;, and that’s all we need to do in our markup. Then in
our CSS we define a container query, but instead of querying on its size, we’re
querying on its specific style value, which is the variable we defined earlier:
&lt;code&gt;@container style(--variant: teal)&lt;/code&gt;. This creates a containment context on the
element that has the &lt;code&gt;--variant: teal&lt;/code&gt; variable, and that’s the first &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt;
element. Just like the container queries, everything we put inside has to target
a descendant of that &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; element. In our case we’re targeting the &lt;code&gt;.poster&lt;/code&gt;
element, which is the image, and we’re setting its &lt;code&gt;::after&lt;/code&gt; element’s content
to a specific SVG image:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;@container style(--variant: teal) {
	.poster::after {
		content: url(&amp;quot;data:image/svg+xml;base64,PHN2Zy.........)
	}
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can now repeat the same for the other variants &lt;code&gt;cream&lt;/code&gt;, &lt;code&gt;mint&lt;/code&gt;, &lt;code&gt;pink&lt;/code&gt;,
&lt;code&gt;yellow&lt;/code&gt; and &lt;code&gt;sky&lt;/code&gt;, and our card variants will be done!&lt;/p&gt;
&lt;p&gt;You might’ve also noticed that even though the style queries are built on top of
container queries, we didn’t define the &lt;code&gt;container&lt;/code&gt; or &lt;code&gt;container-name&lt;/code&gt;
anywhere. CSS is smart enough to figure it out for you. But what if you have
multiple components that use the &lt;code&gt;--variant&lt;/code&gt; variable? In that case, you can
explicitly define the container name, so your style queries don’t mix:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;li {
  container-name: daily-mix-card;
  /* ... */
}

@container daily-mix-card style(--variant: teal) {
  /* ... */
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Combining multiple styles&lt;/h2&gt;
&lt;p&gt;Let’s see another example:&lt;/p&gt;
&lt;p class=&quot;codepen&quot; data-height=&quot;600&quot; data-theme-id=&quot;dark&quot; data-default-tab=&quot;css,result&quot; data-slug-hash=&quot;LYMYqep&quot; data-user=&quot;nikolovlazar&quot; style=&quot;height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;&quot;&gt;
  &lt;span&gt;See the Pen &lt;a href=&quot;https://codepen.io/nikolovlazar/pen/LYMYqep&quot;&gt;
  CSS Style Queries (Etsy items)&lt;/a&gt; by Lazar Nikolov (&lt;a href=&quot;https://codepen.io/nikolovlazar&quot;&gt;@nikolovlazar&lt;/a&gt;)
  on &lt;a href=&quot;https://codepen.io&quot;&gt;CodePen&lt;/a&gt;.&lt;/span&gt;
&lt;/p&gt;
&lt;script async src=&quot;https://cpwebassets.codepen.io/assets/embed/ei.js&quot;&gt;&lt;/script&gt;
&lt;p&gt;In this example we’re using the variables to indicate whether certain things
should be visible in the card. There are three variables: &lt;code&gt;---star-seller&lt;/code&gt;,
&lt;code&gt;---order-soon&lt;/code&gt;, and &lt;code&gt;---free-delivery&lt;/code&gt;. All of them when set to &lt;code&gt;true&lt;/code&gt; will
make the “✪ Star Seller”, “Only X left - order soon” and “FREE delivery”
(respectfully) elements visible. If you look at line 29 in the HTML you’ll see
that we have two variables defined: &lt;code&gt;--star-seller&lt;/code&gt; and &lt;code&gt;--order-soon&lt;/code&gt;. And if
you look at the “EWB Bench” item, you’ll see that both the purple “Star Seller”
and the red “Only 1 left - order soon” labels are displayed. Or check out the
vintage lamp item with the red border around its image. It has all three styles
set to true. To define a style query that queries on multiple styles, use &lt;code&gt;and&lt;/code&gt;
to combine the &lt;code&gt;style(...)&lt;/code&gt; functions like this:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;@container style(--star-seller: true) and style(--free-delivery: true) and style(--order-soon: true) {
  img {
    border: 3px solid red;
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With this approach, we can create and combine as many styles as we like. The
best thing about it is that everything is controlled just by the &lt;code&gt;style&lt;/code&gt;
attribute of the &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; element. If we want to dynamically control that using
JavaScript, all we need to do is invoke the &lt;code&gt;setProperty&lt;/code&gt; method of the
element’s style property:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;product.style.setProperty(&apos;--star-seller&apos;, true)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Just imagine what you can do with style queries. All that with just pure CSS! No
JavaScript logic to show/hide or conditionally render certain elements. Style
queries allow us to define variants of our components, or toggle the visibility
of certain elements, all just by setting a single CSS variable at the root
element. We can also dynamically add/remove/change the variables with JavaScript
by using the &lt;code&gt;style.setProperty()&lt;/code&gt; method.&lt;/p&gt;
&lt;p&gt;Another benefit of this feature is the separation of data from design. The HTML
and CSS define all the possible varieties, while the JavaScript only toggles
them. And since we’re talking about plain JavaScript, we can use style queries
to define our variants and togglable elements without being constrained to a
specific UI framework! That’s why this CSS feature is a game changer, and I
can’t wait for it to be supported by all modern browsers.&lt;/p&gt;
</content:encoded><author>Lazar Nikolov</author></item><item><title>Environment variables type safety and validation with Zod</title><link>https://creatures.dev/blog/env-type-safety-and-validation/</link><guid isPermaLink="true">https://creatures.dev/blog/env-type-safety-and-validation/</guid><description>Using process.env directly in your project means you&apos;re double or triple checking the names of the environment variables. You can use Zod to validate if all of the environment variables are set, and to automatically get types for them.</description><pubDate>Sun, 07 Jan 2024 00:00:00 GMT</pubDate><content:encoded>&lt;iframe
  width=&apos;100%&apos;
  style=&apos;aspect-ratio: 16/9&apos;
  src=&apos;https://www.youtube-nocookie.com/embed/lVHHpm4kuhc&apos;
  title=&apos;Validate Environment Variables with Zod ✅&apos;
  frameborder=&apos;0&apos;
  allow=&apos;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&apos;
  allowfullscreen
&gt;&lt;/iframe&gt;
&lt;p&gt;Using &lt;code&gt;process.env&lt;/code&gt; directly in your project means you&apos;re double or triple
checking the names of the environment variables every time you access them. You
also need to cast them to their correct type, since &lt;code&gt;process.env&lt;/code&gt; returns all
values as strings. Most environment variables are probably strings, but some can
be numbers as well.&lt;/p&gt;
&lt;p&gt;There&apos;s also the possibility of forgetting to set an environment variable either
in your CI/CD pipeline, Docker container, or deployment platform like Vercel.
Errors caused by a missing environment variable aren&apos;t always straightforward to
debug and understand, so having a way to validate that all of the required
environment variables are set, and lets you know which ones are not is
definitely a good idea.&lt;/p&gt;
&lt;p&gt;You can use &lt;a href=&quot;https://zod.dev&quot;&gt;Zod&lt;/a&gt; to validate if all of the environment
variables are set, and to automatically get types for them. You also get the
benefit of descriptive error messages, and also moving between &lt;code&gt;process.env&lt;/code&gt;and
&lt;code&gt;import.meta.env&lt;/code&gt; involves just a single change. Let&apos;s see how we can achieve
all of that.&lt;/p&gt;
&lt;h2&gt;Introducing Zod&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://zod.dev&quot;&gt;Zod&lt;/a&gt; is a TypeScript-first schema declaration and validation
library. You can use it to define schemas and validate any type of data against
them, like the body of a request, or values of a form.&lt;/p&gt;
&lt;p&gt;Getting started is easy:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Make sure you&apos;re using TypeScript 4.5+&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Make sure that you enable all strict type-checking options:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-typescript&quot;&gt;// tsconfig.json
{
// ...
  &amp;quot;compilerOptions&amp;quot;: {
    // ...
    &amp;quot;strict&amp;quot;: true
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install the package:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;npm install zod       # npm
yarn add zod          # yarn
bun add zod           # bun
pnpm add zod          # pnpm
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Zod exports a named &lt;code&gt;z&lt;/code&gt; object that has a bunch of methods for defining schemas
and validating data against them. Here&apos;s a simple example:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-typescript&quot;&gt;import { z } from &apos;zod&apos;

// The schema is an object
const schema = z.object({
  // that has a name property that&apos;s a string
  name: z.string(),

  // an age property that&apos;s a number
  // and must be 18 or higher
  age: z.number().min(18),

  // and an optional string email property that must be
  // a valid email
  email: z.string().email().optional(),
})

// Validate an object against the schema
schema.parse({
  name: &apos;Timmy&apos;,
  age: 13,
}) // throws an error

// Validate an object against the schema
schema.parse({
  name: &apos;Timmy&apos;,
  age: 23,
  email: &apos;timmy@example.com&apos;,
}) // returns the object
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Validating environment variables&lt;/h2&gt;
&lt;p&gt;Looking at the example above, you can get a pretty good idea of how to use Zod
to validate environment variables. Create an &lt;code&gt;env.ts&lt;/code&gt; file and then modify the
example above to look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-typescript&quot;&gt;// env.ts
import { z } from &apos;zod&apos;

// Define the schema as an object with all of the env
// variables and their types
const envSchema = z.object({
  PORT: z.coerce.number().min(1000),
  SUPABASE_URL: z.string().url(),
  SUPABASE_PUBLIC_ANON_KEY: z.string().min(1),
  ENV: z
    .union([
      z.literal(&apos;development&apos;),
      z.literal(&apos;testing&apos;),
      z.literal(&apos;production&apos;),
    ])
    .default(&apos;development&apos;),
  // ...
})

// Validate `process.env` against our schema
// and return the result
const env = envSchema.parse(process.env)

// Export the result so we can use it in the project
export default env
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;First define the schema as an object, and then define all of the environment
variables and their types. Some can be numbers, some can be strings, some can be
optional, or have a specific value out of set of values. To see all of the
validation methods, check out the
&lt;a href=&quot;https://zod.dev/?id=basic-usage&quot;&gt;Zod documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Then validate &lt;code&gt;process.env&lt;/code&gt; against the schema, and export the result so you can
use it in the project. &lt;strong&gt;This line will throw an error if there&apos;s a missing
environment variable, or if its value is invalid&lt;/strong&gt;. If you&apos;re using a Vite-based
framework, swapping &lt;code&gt;process.env&lt;/code&gt; with &lt;code&gt;import.meta.env&lt;/code&gt; is all you need to do
to make it work.&lt;/p&gt;
&lt;p&gt;Now import &lt;code&gt;env&lt;/code&gt; from your &lt;code&gt;env.ts&lt;/code&gt; file and you got access to all of the
environment variables and correct types for them:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/env-validation-types.png&quot; alt=&quot;Environment Variable types&quot;&gt;&lt;/p&gt;
&lt;h2&gt;Exposing the Environment type&lt;/h2&gt;
&lt;p&gt;It&apos;s also possible to export the environment as a type. You can use Zod&apos;s
&lt;code&gt;infer&lt;/code&gt; method to convert your schema into a type:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-typescript&quot;&gt;export type Environment = z.infer&amp;lt;typeof envSchema&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;An example usage of the Environment type would be &lt;a href=&quot;https://hono.dev&quot;&gt;Hono&apos;s&lt;/a&gt;
Cloudflare Workers &lt;a href=&quot;https://hono.dev/api/hono#generics&quot;&gt;environment variables&lt;/a&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-typescript&quot;&gt;// env.ts
export type Environment = {
  Bindings: z.infer&amp;lt;typeof envSchema&amp;gt;
}

// index.ts
import type { Environment } from &apos;./env&apos;

const app = new Hono&amp;lt;Environment&amp;gt;()
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Extending the global &lt;code&gt;ProcessEnv&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;You could even take things further by extending the global &lt;code&gt;ProcessEnv&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-typescript&quot;&gt;declare global {
  namespace NodeJS {
    interface ProcessEnv extends z.infer&amp;lt;typeof envSchema&amp;gt; {}
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will extend the global &lt;code&gt;process.env&lt;/code&gt; object with your own &lt;code&gt;envSchema&lt;/code&gt; so
you can access the variables directly through &lt;code&gt;process.env&lt;/code&gt; instead of importing
the &lt;code&gt;env.ts&lt;/code&gt;, file. But, there&apos;s a downside to this - &lt;code&gt;process.env&lt;/code&gt; always
returns &lt;code&gt;string&lt;/code&gt;, even though your &lt;code&gt;PORT&lt;/code&gt; variable is defined as a &lt;code&gt;number&lt;/code&gt;. At
dev time TypeScript will tell you that the type of &lt;code&gt;process.env.PORT&lt;/code&gt; is
&lt;code&gt;number&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/env-validation-port-type-devtime.png&quot; alt=&quot;Port environment variable type during dev time&quot;&gt;&lt;/p&gt;
&lt;p&gt;But if you log out the type at runtime you actually get a string:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/env-validation-port-type-runtime.png&quot; alt=&quot;Port environment variable type during runtime&quot;&gt;&lt;/p&gt;
&lt;p&gt;Which, as you can see, even though TypeScript says that it&apos;s a number, &lt;strong&gt;you
can&apos;t actually treat it as a number&lt;/strong&gt;. This can really trip you up, but you
should not have any issues if all of your environment variables are strings.
Have this in mind if you plan on extending &lt;code&gt;process.env&lt;/code&gt; though.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;That&apos;s how you can use Zod to validate your environment variables and how to
infer and export the &amp;quot;Environment&amp;quot; type. You also saw how to use the inferred
type to extend the global &lt;code&gt;process.env&lt;/code&gt; so you can access your variables
directly instead of importing the &lt;code&gt;env.ts&lt;/code&gt; file, but that comes with a drawback.&lt;/p&gt;
&lt;p&gt;These examples validate the environment variables during runtime, but you&apos;re not
limited to just runtime validation. If you want to prevent a deployment if the
environment is not set, you can put &lt;code&gt;schema.parse(...)&lt;/code&gt; in an NPM script or as a
step in your CI/CD workflow, and trigger it during build time, or in your
pipeline, or as part of the build script.&lt;/p&gt;
</content:encoded><author>Lazar Nikolov</author></item><item><title>Find your tribe - why developers need their crew</title><link>https://creatures.dev/blog/find-your-tribe/</link><guid isPermaLink="true">https://creatures.dev/blog/find-your-tribe/</guid><description>On the importance of being part of a community as a developer.</description><pubDate>Thu, 24 Aug 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;i&gt;This article is inspired by a panel I participated in at WeAreDevelopers
World Congress 2023.
&lt;a href=&quot;https://jason.energy/effective-devrel-buffalo-stick/&quot;&gt;A buffalo stick take&lt;/a&gt; on
a panel, if you will.&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;Without getting too heavily into stereotypes, we developers tend towards being
on the &amp;quot;wallflower&amp;quot; side of the spectrum. I&apos;m no exception, even though
&lt;a href=&quot;https://beerjs.mk&quot;&gt;I&apos;m actively taking&lt;/a&gt; &lt;a href=&quot;https://codepub.dev&quot;&gt;part in some&lt;/a&gt;
&lt;a href=&quot;https://deved.mk&quot;&gt;not-so-introverted&lt;/a&gt;
&lt;a href=&quot;https://www.youtube.com/channel/UCtCyVHiEXMOHaVGbnKuU4VA&quot;&gt;activities&lt;/a&gt;. That&apos;s
all good and well, but we are naturally social beings. Especially when it comes
to problem-solving, learning, and sharing knowledge, it stands to reason that by
collaborating with others, we can achieve more than we can on our own. Let&apos;s
dive into why it&apos;s important to be part of a community as a developer.&lt;/p&gt;
&lt;h2&gt;The selfish angle&lt;/h2&gt;
&lt;p&gt;I will try building an answer for this from the &amp;quot;selfish&amp;quot; point of view, i.e.,
what&apos;s in it for you as an individual. To me, the primary value of being a part
of a community is having a network of support and a group to rely on. Let&apos;s
explore what this means in practice.&lt;/p&gt;
&lt;h3&gt;Having a network (of support)&lt;/h3&gt;
&lt;p&gt;The more connections you have, the more opportunities you&apos;ll have. Communities
of like-minded individuals are precisely the place to build these connections.
These opportunities can vary from finding a new job, finding a freelance gig, or
collaborating on something (FOSS or otherwise). Additionally, whenever you get
stuck on a problem or need a second opinion, you can always reach out to the
group for help. If, at any point in this paragraph, you thought, &amp;quot;but this
sounds like a company&amp;quot; - you&apos;re right. A company is also a community in many
senses but with the profit motive added on top. It&apos;s a group of people working
together towards a common goal. The difference is that the goal is not to make
money but to help each other out (even though some collabs can lead to making
money).&lt;/p&gt;
&lt;p&gt;The two primary transactions one can make in a community are sharing what they
know and learning something from the group. Let&apos;s go deeper into each and see
how they can benefit you.&lt;/p&gt;
&lt;h4&gt;Learning from others (and getting info in general)&lt;/h4&gt;
&lt;p&gt;There&apos;s always something new to learn, whether you&apos;re just starting or are
longer in the tooth. While no two people learn the same way, having someone to
ask always helps, or having a group of someones to ask, for that matter.&lt;/p&gt;
&lt;p&gt;When it comes to development, whether you&apos;re starting on a new library/framework
or you&apos;re stuck deep into &lt;a href=&quot;https://en.wikipedia.org/wiki/Heisenbug&quot;&gt;Heisenbug&lt;/a&gt;
land, technical documentation, videos or blogs can only get you so far. At some
point, you&apos;re bound to hit a wall with something ill-documented, maybe a new bug
or something else. You may be on the fence about whether to use a particular
tech. Or you might need a recommendation on what to use for your next app. These
situations are exactly where having a community to ask for help can be a
lifesaver.&lt;/p&gt;
&lt;p&gt;Another point I&apos;d like to make here is the one about getting information in
general, not just for the sake of learning. Most of my freelance gigs, projects,
and employment opportunities have come from people I know professionally. And
most of the people I know professionally are from the communities I&apos;m a part of.
This is not to say you should join a community just to get a job. But it&apos;s a
nice side effect of being a part of one.&lt;/p&gt;
&lt;h4&gt;Sharing your knowledge (and work)&lt;/h4&gt;
&lt;p&gt;One of the easiest ways to get noticed and build a brand for yourself is by
sharing what you know. What you share can be in the form of blog posts, videos,
talks, or even just tweets. The more you share, the more people know about you
and your work. This can lead to more opportunities, as mentioned above. But it
can also lead to more people reaching out to you for help. That is a great way
to build your network and get to know more people. And, as we&apos;ve established,
having a network is a good thing. Online communities are an excellent place to
share your work and knowledge. They&apos;re also a great place to get feedback on
your work and knowledge. This can help you improve and grow as a developer.&lt;/p&gt;
&lt;p&gt;However, it&apos;s important to note that sharing just for the sake of sharing isn&apos;t
too valuable. The content you create, find, curate, and share should be relevant
to the community you choose to be a part of. Otherwise, you&apos;re just spamming.
And nobody likes spam. Put another way, you should share things you would like
to see in the community. Stuff that&apos;s valuable to you and that you think will be
valuable to others. Finding out what that is can be tricky and can take some
time. But it&apos;s worth it. Experiment to see what people react to. Iterate.&lt;/p&gt;
&lt;p&gt;The bottom line is that you can view a community as a &amp;quot;stage&amp;quot; of sorts—a place
where you can share your work, build in public, and build a personal brand. If
you&apos;re uncomfortable with that, you can always just lurk and learn. But I&apos;d
encourage you to try and share something. You&apos;ll be surprised at how much you
can learn from the feedback you get. Additionally, people tend to share what
they like and find value in. So, if you hit that value sweet spot (and that&apos;s a
matter of iteration), you&apos;ll get more people to share your work. This can lead
to more opportunities, as mentioned above.&lt;/p&gt;
&lt;p&gt;Had enough of the &amp;quot;selfish&amp;quot; angle? Let&apos;s look at the other side of the coin.&lt;/p&gt;
&lt;h2&gt;The other side of the coin&lt;/h2&gt;
&lt;p&gt;There are plenty of benefits to being a part of a community as an individual.
But there are also a lot of benefits to the community itself. The point I&apos;d like
to make here is that being an (active) community member is a win-win scenario.
Beyond the &amp;quot;free audience&amp;quot; point we made above, there&apos;s something to be said
about the community as an organism.&lt;/p&gt;
&lt;p&gt;Consider this - if each member started from the &amp;quot;selfish&amp;quot; point of view, this is
still a win-win scenario for everyone involved. None of us know everything
(alone). Those who know a particular thing can share for their benefit and the
&amp;quot;free stage&amp;quot; thing. Those who seek knowledge can learn. It&apos;s a symbiotic system.
And it&apos;s a system that can grow and evolve.&lt;/p&gt;
&lt;h3&gt;The collective consciousness&lt;/h3&gt;
&lt;p&gt;One of the more nuanced perks of being part of a community is the collective
mindset. The insights, the shared experiences, the common challenges - it all
coalesces into a unified understanding of the tech world. When you are part of a
tribe, you aren&apos;t just getting direct feedback or assistance; you&apos;re tapping
into a vast reservoir of collective experiences.&lt;/p&gt;
&lt;p&gt;Have you ever found an obscure forum post from 2006 that somehow solves your
current tech problem? Yep, that&apos;s the power of community memory. Being part of
an active community today means creating the resources that someone might find
invaluable a decade from now.&lt;/p&gt;
&lt;h3&gt;The ripple effect&lt;/h3&gt;
&lt;p&gt;An active contribution to a community sets off a ripple. Share a workaround for
a stubborn glitch today, and you might inspire someone else to create a more
streamlined solution tomorrow. This cyclic inspiration keeps the community
vibrant and progressive.&lt;/p&gt;
&lt;h3&gt;Giving back – the circle of (tech) life&lt;/h3&gt;
&lt;p&gt;Remember that win-win scenario? The community gives, and you benefit. But
there&apos;s another layer to this: when you give back, the cycle continues. Whether
it&apos;s mentoring a newbie, organizing an event, or simply upvoting a helpful
comment – it&apos;s a way of acknowledging the value you&apos;ve derived and ensuring the
community&apos;s heartbeat remains strong.&lt;/p&gt;
&lt;h3&gt;The synergy&lt;/h3&gt;
&lt;p&gt;Perhaps one of the most compelling aspects of being in a community is the
synergy. When developers come together, they don’t just add their expertise –
they multiply it. New collaborations, side projects, or even startups often
emerge from the explosive mix of ideas and aspirations.&lt;/p&gt;
&lt;h2&gt;Experiences from the field&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;#having-a-network-of-support&quot;&gt;In one of the paragraphs above&lt;/a&gt;, I mentioned that
companies are also communities. The same goes for research institutes,
universities, and other organizations. I&apos;ve been a part of a few of these, and
I&apos;ve seen the benefits first-hand. Being a huge fan(boy) of the work of Bell
Labs and the UNIX philosophy, I found that this video by
&lt;a href=&quot;https://en.wikipedia.org/wiki/Richard_Hamming&quot;&gt;Richard Hamming&lt;/a&gt; makes some
great points about the benefits of being a part of a community (and a lot of
other ones too). I&apos;d encourage you to watch it.&lt;/p&gt;
&lt;iframe
  width=&apos;100%&apos;
  style=&apos;aspect-ratio: 16/9&apos;
  src=&apos;https://www.youtube-nocookie.com/embed/a1zDuOPkMSw&apos;
  title=&apos;You and Your research&apos;
  frameborder=&apos;0&apos;
  allow=&apos;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&apos;
  allowfullscreen
&gt;&lt;/iframe&gt;
&lt;p&gt;The two most relevant points to this article are (but seriously, go watch it -
it&apos;s excellent 😁):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Share and Collaborate&lt;/strong&gt;: Hamming stressed that working in isolation limits
potential. Sharing ideas, collaborating with peers, and being open to feedback
can significantly elevate the quality and reach of your work.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Environment Matters&lt;/strong&gt;: Being in the right environment, surrounded by
motivated and intelligent people, can catalyze success. It&apos;s not just about
individual brilliance but also the collective intellect and drive of those
around you.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;While I&apos;ve soloed a part of my career, I&apos;ve done some of my best work when being
a part of a group that shares vision, values, and ideas. I&apos;ve had the fortune of
doing &lt;em&gt;actual&lt;/em&gt; R&amp;amp;D work, where we were given a problem and left to our own
devices to solve it. It wasn&apos;t supposed to be a product, but something that may
eventually become one. While being able to focus on a problem without having
hard time constraints is fantastic, the environment and the people I worked with
made it productive. I firmly believe we got much more done as a group than we
would have individually. And each of us had a video transcoder app/cli/service
to show for it, implemented independently (but that&apos;s an even longer story for
another time). Still, it was because of that environment (and community), that
we were able to solve problems as a relatively small team, that nobody else
wanted to tackle. Some of the stuff we were able to produce: a chromecast clone
(way before chromecast was a thing), a distributed transcoding service, an
embedded video player (html5 video wasn&apos;t a thing back then) using NPAPI, a
peer-to-peer CDN thing based on aria2c using BitTorrent... those were the days.
In many senses, what we did reflected in many ways the freedom described by Bell
Labs folks. To avoid going off on a tangent here, I&apos;ll leave it at this - the
environment and the people you work with matter. A lot. Same goes for
communities and being a part of a community as a developer.&lt;/p&gt;
&lt;p&gt;Back to Bell Labs, it&apos;s hard to find a talk or an interview from anyone who was
part of the golden days of Bell Labs without them mentioning that, in many ways,
the extraordinary work being done there had to do with the environment and being
surrounded by like-minded people. Sounds like a community, doesn&apos;t it? They have
the most Nobel and Turing awards of any company/research institute to date.&lt;/p&gt;
&lt;h2&gt;Wrapping up&lt;/h2&gt;
&lt;p&gt;While the benefits of being part of a developer community are many, the essence
is simple: find your tribe, connect, share, and grow. Remember, tech trends
might come and go, but the relationships you cultivate within your community can
last a lifetime (and come back in unexpected ways to help you produce great
things).&lt;/p&gt;
&lt;p&gt;So, if you&apos;re on the fence about joining one, remember this: every line of code
is a statement, every shared solution a conversation. Why not make it a shared
experience with a tribe that resonates with your vibe? Dive in and embrace the
collective journey.&lt;/p&gt;
&lt;hr&gt;
&lt;h4&gt;PS. A call to action&lt;/h4&gt;
&lt;p&gt;Have some trouble finding the right community for you?&lt;/p&gt;
&lt;p&gt;If you&apos;re looking for an in-person one, do a quick search on Meetup, Facebook,
etc. If you&apos;re into JS land, try finding a local
&lt;a href=&quot;https://github.com/beerjs/meta&quot;&gt;BeerJS branch&lt;/a&gt; or start one yourself (it&apos;s
really fun and easy). &lt;a href=&quot;https://beerjs.mk&quot;&gt;Here&apos;s mine&lt;/a&gt; if you happen to be in my
corner of the planet.&lt;/p&gt;
&lt;p&gt;If you&apos;re into online ones, here&apos;s my favorite -&amp;gt; https://creatures.dev. It&apos;s a
community of curious developers excited about code, but that description doesn&apos;t
do it justice or describe what it&apos;s all about. Join and see for yourself 😎&lt;/p&gt;
</content:encoded><author>Darko Bozhinovski</author></item><item><title>Getting started with CSS Nesting</title><link>https://creatures.dev/blog/getting-started-with-css-nesting/</link><guid isPermaLink="true">https://creatures.dev/blog/getting-started-with-css-nesting/</guid><description>CSS Nesting used to only be possible in CSS preprocessors like Sass and Less. But guess what, it’s now part of Native CSS! Let&apos;s see what&apos;s CSS Nesting and how we can get started using it.</description><pubDate>Sat, 12 Aug 2023 00:00:00 GMT</pubDate><content:encoded>&lt;iframe
  width=&apos;100%&apos;
  style=&apos;aspect-ratio: 16/9&apos;
  src=&apos;https://www.youtube-nocookie.com/embed/dr6UAQUAiu4&apos;
  title=&apos;Getting started with CSS Nesting&apos;
  frameborder=&apos;0&apos;
  allow=&apos;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&apos;
  allowfullscreen
&gt;&lt;/iframe&gt;
&lt;p&gt;CSS Nesting used to only be possible in CSS preprocessors like Sass and Less.
But guess what, it&apos;s now built in native CSS and all modern browsers will
support it after August 29th. Let&apos;s see what&apos;s CSS Nesting and how we can use
it.&lt;/p&gt;
&lt;h2&gt;What is CSS Nesting?&lt;/h2&gt;
&lt;p&gt;CSS Nesting is a new feature that allows you to nest selectors inside other
selectors. Nesting helps by reducing repetition, reducing the file size, better
file organization and easier refactoring. Let&apos;s see an example without nesting:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;/* No nesting */
article.card {
  border: 1px solid lightgrey;
  border-radius: 6px;
  overflow: hidden;
}

article.card header {
  border-bottom: 1px solid lightgrey;
  background: #f1f3f4;
  padding: 16px;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This example can be written with nesting like this:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;/* With nesting */
article.card {
  border: 1px solid lightgrey;
  border-radius: 6px;
  overflow: hidden;

  &amp;amp; header {
    border-bottom: 1px solid lightgrey;
    background: #f1f3f4;
    padding: 16px;
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Nesting examples&lt;/h2&gt;
&lt;p&gt;To get a good feel of how nesting works, let&apos;s see some more examples.&lt;/p&gt;
&lt;p
  class=&apos;codepen&apos;
  data-height=&apos;450&apos;
  data-theme-id=&apos;dark&apos;
  data-default-tab=&apos;css,result&apos;
  data-slug-hash=&apos;poQYdOG&apos;
  data-user=&apos;nikolovlazar&apos;
  style=&apos;height: 450px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;&apos;
&gt;
  All of the examples are from [the CodePen
  above](https://codepen.io/nikolovlazar/pen/poQYdOG).
&lt;/p&gt;
&lt;script async src=&apos;https://cpwebassets.codepen.io/assets/embed/ei.js&apos;&gt;&lt;/script&gt;
&lt;h3&gt;Multi-level nesting&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;article.card {
  border: 1px solid lightgrey;
  border-radius: 6px;
  overflow: hidden;

  &amp;amp; header {
    border-bottom: 1px solid lightgrey;
    background: #f1f3f4;
    padding: 16px;

    &amp;amp; h2 {
      margin: 0;
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this example we can see that we can nest as many levels as we want. The first
level is the &lt;code&gt;article.card&lt;/code&gt; selector, which is the root selector. The second
level is the &lt;code&gt;&amp;amp; header&lt;/code&gt; selector, which is nested inside the root selector. The
header styles will only be applied to &lt;code&gt;header&lt;/code&gt; elements that are children of
&lt;code&gt;article.card&lt;/code&gt; elements.&lt;/p&gt;
&lt;h3&gt;Nesting without the &lt;code&gt;&amp;amp;&lt;/code&gt; symbol&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;article.card {
  border: 1px solid lightgrey;
  border-radius: 6px;
  overflow: hidden;

  .content {
    border-bottom: 1px solid lightgrey;
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We don&apos;t always need to add the &lt;code&gt;&amp;amp;&lt;/code&gt; symbol to indicate nesting. If we don&apos;t add
it, CSS will add &lt;code&gt;&amp;amp;&lt;/code&gt; + &amp;quot; &amp;quot; (space) in front of the nested selector. By
explicitly placing the &lt;code&gt;&amp;amp;&lt;/code&gt; symbol, we can control where the parent selector
should be placed.&lt;/p&gt;
&lt;h3&gt;Nesting pseudo-classes&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;article.card {
  /* ... */

  :is(.content, footer) {
    padding: 16px;
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It&apos;s also possible to nest pseudo-classes like the &lt;code&gt;:is()&lt;/code&gt; in this example. As
we saw in the previous example, if we don&apos;t add the &lt;code&gt;&amp;amp;&lt;/code&gt; symbol CSS is going to
add that for us + an empty space, so this example will target all children of
the &lt;code&gt;article.card&lt;/code&gt; element that are either &lt;code&gt;.content&lt;/code&gt; or &lt;code&gt;footer&lt;/code&gt; elements. The
&amp;quot;compiled&amp;quot; selector will look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;article.card :is(.content, footer): {
  /* ... */
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Nesting pseudo-elements&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;article.card {
  /* ... */

  &amp;amp; footer a {
    /* ... */

    &amp;amp;:hover {
      background: maroon;

      &amp;amp;::after {
        content: &apos;&amp;gt;&apos;;
        margin-left: 12px;
      }
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Just like the pseudo-classes, we can also nest pseudo-elements. In this example
we&apos;re defining hover styles for the &lt;code&gt;a&lt;/code&gt; element that&apos;s a child of the &lt;code&gt;footer&lt;/code&gt;.
We&apos;re also defining styles for the &lt;code&gt;::after&lt;/code&gt; pseudo-element of the &lt;code&gt;a&lt;/code&gt; element
while it&apos;s being hovered. Feel free to play around with the
&lt;a href=&quot;#nesting-examples&quot;&gt;example above&lt;/a&gt; to see the result.&lt;/p&gt;
&lt;h3&gt;Nesting &lt;code&gt;@media&lt;/code&gt; queries&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;article.card {
  /* ... */

  @media (min-width: 768px) {
    /* ... */
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can also nest &lt;code&gt;@media&lt;/code&gt; queries. This is a great way to keep the styles for a
specific breakpoint in one place. This way we can easily find and update them if
needed.&lt;/p&gt;
&lt;h2&gt;The &lt;code&gt;&amp;amp;&lt;/code&gt; symbol&lt;/h2&gt;
&lt;p&gt;As mentioned in the previous examples, the &lt;code&gt;&amp;amp;&lt;/code&gt; symbol is used to indicate where
the parent selector should be placed. This gives us more control over the final
selector, and if needed, we can also completely rearrange the whole context.
Let&apos;s see some examples:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;a {
  &amp;amp;:hover {
    /* a:hover */
  }

  :hover {
    /* a :hover */
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this example we can see the different output when we use the &lt;code&gt;&amp;amp;&lt;/code&gt; symbol and
when we don&apos;t. In cases where we want to define pseudo-classes for the parent
selector, we&apos;d need to use the &lt;code&gt;&amp;amp;&lt;/code&gt; symbol. Otherwise, CSS will add the parent
selector in front of the pseudo-class.&lt;/p&gt;
&lt;p&gt;Since the &lt;code&gt;&amp;amp;&lt;/code&gt; symbol is just a placeholder for the parent selector, we can also
use it multiple times in the same selector, and flip the context completely:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;header {
  &amp;amp; h2 {
    /* header h2 */
  }

  h2 &amp;amp; &amp;amp; &amp;amp; {
    /* h2 header header header */
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Understanding the parser&lt;/h2&gt;
&lt;p&gt;The nesting parser is what&apos;s responsible for parsing the nested selectors. The
way that the parser identifies if the selector is defining a nested style is by
checking whether the selector contains one of the symbols below:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;amp; @ : . &amp;gt; ~ + # [ *
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You might recognize some of these symbols. Some of them are used for selectors,
pseudo-classes and pseudo-elements, combinators, attribute selectors etc...&lt;/p&gt;
&lt;p&gt;If the parser finds a nested selector that doesn&apos;t start with any of these
symbols, it will fail to parse it, which will result in incorrect styles.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Nesting is a great feature that can help us write more maintainable CSS. It can
also help us write less code since we don&apos;t need to repeat the parent selector
over and over again. This is huge for CSS, and I&apos;m excited to see all of the
creative ways developers are going to come up with to use it.&lt;/p&gt;
</content:encoded><author>Lazar Nikolov</author></item><item><title>Infrastructure as Code: Transforming IT Infrastructure Management</title><link>https://creatures.dev/blog/infrastructure-as-code-transforming-it-infrastructure-management/</link><guid isPermaLink="true">https://creatures.dev/blog/infrastructure-as-code-transforming-it-infrastructure-management/</guid><description>Introduction to the concept of Infrastructure as Code. What it is, why it exists and how it revolutionized IT infrastructure management.</description><pubDate>Sun, 24 Sep 2023 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;Wait, what do you mean by “infrastructure”?&lt;/h2&gt;
&lt;p&gt;Before we begin explaining Infrastructure as Code, we first need to define what we mean by infrastructure.&lt;/p&gt;
&lt;p&gt;When we talk about IT infrastructure, we’re talking about interdependent elements which are categorized into two core groups: hardware and software infrastructure elements.&lt;/p&gt;
&lt;p&gt;Hardware components include computers, servers, data centers, routers, switches, etc.&lt;/p&gt;
&lt;p&gt;Software components include operating systems, web servers, firewalls, resource management systems, databases, etc.&lt;/p&gt;
&lt;p&gt;The two primary types of IT infrastructure are traditional and cloud infrastructure.&lt;/p&gt;
&lt;p&gt;I won’t continue into details, as it would escape the scope of this article, however, I’ve linked some resources if you wish to further read up on these concepts at the end of this article.&lt;/p&gt;
&lt;h2&gt;Okay, cool, now what do you mean by “infrastructure as code”?&lt;/h2&gt;
&lt;p&gt;As the name implies, Infrastructure as Code (IaC, a common abbreviation) is the practice of automating and managing IT infrastructure through code, leveraging DevOps and traditional software development principles (like code versioning). It involves using a descriptive coding language to define and provide infrastructure consistently, ensuring rapid development, cost control and reliability, relative to treating infrastructure like standard application code.&lt;/p&gt;
&lt;p&gt;I mentioned it uses a &lt;strong&gt;descriptive&lt;/strong&gt; coding language. This is not always the case, as &lt;strong&gt;imperative&lt;/strong&gt; IaC exists and we’ll quickly discuss that at the end of this article.&lt;/p&gt;
&lt;h2&gt;History&lt;/h2&gt;
&lt;p&gt;I want to take a very short detour to explain the history of deploying and maintaining software infrastructure and why the process of IaC was developed.&lt;/p&gt;
&lt;p&gt;In the era before IaC, setting up and managing infrastructure typically involved several manual tasks and processes, including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Providing physical hardware: This means providing physical (often on-site) servers, switches, routers, storage devices, etc.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Operating system installation and configuration: After the hardware was set up, system administrators had to manually install and configure operating systems on each server.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Deploying the software application: Each application had to be installed and configured individually and manually.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Network configuration: Manual setting up and managing network connections, firewalls, load balancers, and other networking components required manual configurations&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Storage management: Managing storage resources involved creating partitions, configuring RAID arrays, and allocating storage space to different applications and servers manually.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The main downside of manually setting up infrastructure was, well, obviously that we’re doing all of this &lt;strong&gt;manually&lt;/strong&gt;, but also:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Slow deployment&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Error-prone&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Lack of scalability&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Inconsistency&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Difficulty in versioning&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Infrastructure as Code addresses these challenges by automating the provisioning and management of infrastructure using code, enabling rapid, consistent, and error-free deployments while facilitating versioning and scalability. It represents a significant advancement in the field of IT infrastructure management.&lt;/p&gt;
&lt;h2&gt;Other benefits&lt;/h2&gt;
&lt;p&gt;Besides the things we highlighted in the previous section, IaC has other benefits:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Allows a company to more easily enter the cloud computing scene&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Cost reductions&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Increased deployment speeds&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Eliminates configuration drift&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You might be wondering what I mean by configuration drift so here’s a short definition:&lt;/p&gt;
&lt;p&gt;Ad hoc configuration updates and changes can cause a discrepancy between the environments used for development, testing, and deployment, which is known as configuration drift. When designing apps and services that must adhere to stringent regulatory compliance standards, this might lead to problems during deployment, security vulnerabilities, and hazards. By consistently offering the same environment, IaC reduces drift.&lt;/p&gt;
&lt;p&gt;IaC is also crucial for DevOps, as it streamlines the process and CI/CD by automating provisioning. It unifies teams and ensures consistent deployments. IaC&apos;s benefits span all environments, including production. It extends DevOps principles to infrastructure, enabling rigorous testing and version control.&lt;/p&gt;
&lt;h2&gt;Declarative vs. Imperative approach&lt;/h2&gt;
&lt;p&gt;Declarative usually defines “what” we want to happen, while imperative defines “how” we want the thing to happen.&lt;/p&gt;
&lt;p&gt;In most cases, the declarative approach, also known as the functional approach, is preferred. It involves specifying the desired final infrastructure state, with the IaC software handling tasks like VM setup, software installation, and version management. However, it may require skilled administrators to set up and manage.&lt;/p&gt;
&lt;p&gt;On the other hand, the imperative approach, or procedural approach, involves creating automation scripts for each step of infrastructure provisioning. While this may be more manageable for existing staff, it can become complex and costly at scale.&lt;/p&gt;
&lt;p&gt;I’m going to leave you with this fantastic analogy I read on IBM’s website:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Choosing a declarative or imperative approach is analogous to using a GPS or following turn-by-turn instructions. With a GPS, you enter an address and the GPS does the rest, plotting the fastest route and avoiding traffic for you, but you probably need an expert to tell you why it made the choices it made. The turn-by-turn instructions are based on personal experience; the provider knows the route and why he/she chose it, but if you encounter obstacles or want to optimize the route, you have to call for help or do the work yourself.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Hey, you made it to the end! Thanks for reading my article ❤️🙏.&lt;/p&gt;
&lt;p&gt;Infrastructure as Code is a big part of not just DevOps, but the entire software development and maintenance process. It provides codification, versioning, ease of life, and most importantly consistency.&lt;/p&gt;
&lt;p&gt;If you enjoyed this read, the next few articles I’m going to put out are going to be on the same topic so make sure to leave a follow!&lt;/p&gt;
&lt;p&gt;I’m going to leave you with some extra studying materials if you want to dive even deeper into IaC.&lt;/p&gt;
&lt;h2&gt;Extra resources&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=EtEb40LE5zQ&quot;&gt;&amp;quot;Infrastructure as Code - Crash Course&amp;quot; by freecodecamp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.redhat.com/en/topics/automation/what-is-infrastructure-as-code-iac#:~:text=Infrastructure&quot;&gt;Red Hat’s definition of Infrastructure as Code&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.ibm.com/topics/infrastructure-as-code&quot;&gt;IBM’s definition of Infrastructure as Code&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.ibm.com/topics/infrastructure-as-code&quot;&gt;&amp;quot;What is IT Infrastructure?&amp;quot; by IBM&lt;/a&gt;&lt;/p&gt;
</content:encoded><author>Marko Spasenovski</author></item><item><title>Exploring the Temporal Proposal: Modernizing Date and Time Handling in JavaScript</title><link>https://creatures.dev/blog/temporal-stage3-proposal/</link><guid isPermaLink="true">https://creatures.dev/blog/temporal-stage3-proposal/</guid><description>Taking a look at the Temporal proposal, which aims to modernize date and time handling in JavaScript.</description><pubDate>Tue, 19 Sep 2023 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;The handling of dates in ECMAScript has long been a source of frustration for developers. In response to this, the Temporal proposal was born. Temporal is a global object, similar to Math, that introduces a modern date and time API to the ECMAScript language. To dive deeper into the challenges associated with the existing Date object and the motivations behind Temporal, take a look at this informative article: &lt;a href=&quot;https://maggiepint.com/2017/04/11/fixing-javascript-date-web-compatibility-and-reality/&quot;&gt;Fixing JavaScript Date&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;How Temporal Solves Date and Time Challenges&lt;/h2&gt;
&lt;p&gt;Temporal addresses these date and time challenges by offering:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;User-Friendly APIs:&lt;/strong&gt; Temporal provides easy-to-use APIs for various date and time computations, making complex operations more accessible.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Time Zone Support:&lt;/strong&gt; It boasts first-class support for all time zones, including daylight-saving time (DST) adjustments, ensuring accurate and reliable arithmetic across different regions.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Immutability:&lt;/strong&gt; Temporal enforces immutability, meaning that once a date or time object is created, it cannot be altered. This helps prevent bugs stemming from unintended modifications.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Strict String Parsing:&lt;/strong&gt; Temporal allows you to parse date and time strings in a strictly specified format, ensuring consistency in data handling.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Non-Gregorian Calendars:&lt;/strong&gt; Temporal even goes beyond the Gregorian calendar, accommodating different calendar systems, broadening its usability.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Additionally, Temporal introduces separate ECMAScript classes for date-only, time-only, and other specialized use cases. This separation enhances code readability and minimizes errors that often arise from assumptions about time zones or values.&lt;/p&gt;
&lt;h2&gt;Getting Started with Temporal&lt;/h2&gt;
&lt;p&gt;For those eager to embark on their Temporal journey, a cookbook is available to guide you through the fundamentals and intricacies of Temporal. It serves as a valuable resource for developers of all levels, offering practical examples and insights. &lt;a href=&quot;https://tc39.es/proposal-temporal/docs/cookbook.html&quot;&gt;Explore the Temporal Cookbook&lt;/a&gt; to kickstart your Temporal exploration.&lt;/p&gt;
&lt;h2&gt;Understanding Temporal API Documentation&lt;/h2&gt;
&lt;p&gt;The Temporal API follows a consistent naming convention, with types that start with &amp;quot;Plain&amp;quot; (e.g., &lt;code&gt;Temporal.PlainDate&lt;/code&gt;, &lt;code&gt;Temporal.PlainTime&lt;/code&gt;, and &lt;code&gt;Temporal.PlainDateTime&lt;/code&gt;) for objects without an associated time zone. However, converting between these types and exact time types (&lt;code&gt;Temporal.Instant&lt;/code&gt; and &lt;code&gt;Temporal.ZonedDateTime&lt;/code&gt;) can introduce ambiguity due to time zones and DST. Temporal&apos;s API empowers developers to configure how this ambiguity is resolved.&lt;/p&gt;
&lt;p&gt;To delve deeper into essential concepts such as exact time, wall-clock time, time zones, DST, and handling ambiguity, consult the comprehensive &lt;a href=&quot;https://tc39.es/proposal-temporal/docs/index.html&quot;&gt;Temporal API Documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Temporal.Now: Instant Gratification&lt;/h3&gt;
&lt;p&gt;Temporal introduces a powerful feature known as Temporal.Now, offering real-time insights into the current system time and time zone. Developers can leverage this feature to access:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Temporal.Now.instant()&lt;/code&gt;: Retrieve the current system exact time.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Temporal.Now.timeZoneId()&lt;/code&gt;: Obtain the current system time zone.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Temporal.Now.zonedDateTime(calendar)&lt;/code&gt;: Fetch the current date and wall-clock time in the system time zone and a specified calendar.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Temporal.Now.zonedDateTimeISO()&lt;/code&gt;: Access the current date and wall-clock time in the system time zone using the ISO-8601 calendar.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Temporal.Now.plainDate(calendar)&lt;/code&gt;: Obtain the current date in the system time zone and a specified calendar.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Temporal.Now.plainDateISO()&lt;/code&gt;: Retrieve the current date in the system time zone using the ISO-8601 calendar.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Temporal.Now.plainTimeISO()&lt;/code&gt;: Retrieve the current wall-clock time in the system time zone using the ISO-8601 calendar.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Temporal.Now.plainDateTime(calendar)&lt;/code&gt;: Retrieve the current system date/time in the system time zone. Note that the resulting object does not remember its time zone, making it unsuitable for deriving other values in time zones that observe Daylight Saving Time (DST).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here&apos;s a quick example:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;console.log(&apos;Initialization complete&apos;, Temporal.Now.instant());
// Example output:
// Initialization complete 2021-01-13T20:57:01.500944804Z
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Temporal.Instant: Capturing Fixed Points in Time&lt;/h3&gt;
&lt;p&gt;A &lt;code&gt;Temporal.Instant&lt;/code&gt; represents a fixed point in time, devoid of calendar or location considerations. For instance, it can represent a moment like July 20, 1969, at 20:17 UTC. If you need human-readable local calendar dates or clock times, Temporal suggests using a combination of &lt;code&gt;Temporal.TimeZone&lt;/code&gt; and &lt;code&gt;Temporal.Calendar&lt;/code&gt; to obtain a &lt;code&gt;Temporal.ZonedDateTime&lt;/code&gt; or &lt;code&gt;Temporal.PlainDateTime&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const instant = Temporal.Instant.from(&apos;1969-07-20T20:17Z&apos;);
instant.toString(); // =&amp;gt; &apos;1969-07-20T20:17:00Z&apos;
instant.epochMilliseconds; // =&amp;gt; -14182980000
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Temporal.ZonedDateTime: Navigating Time Zones and Calendars&lt;/h3&gt;
&lt;p&gt;A &lt;code&gt;Temporal.ZonedDateTime&lt;/code&gt; is a versatile date/time object that considers time zones and calendars, representing real-world events from the perspective of specific regions on Earth. Whether it&apos;s December 7th, 1995, at 3:24 AM in US Pacific time within the Gregorian calendar, or any other scenario, Temporal.ZonedDateTime has you covered.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const zonedDateTime = Temporal.ZonedDateTime.from({
  timeZone: &apos;America/Los_Angeles&apos;,
  year: 1995,
  month: 12,
  day: 7,
  hour: 3,
  minute: 24,
  second: 30,
  millisecond: 0,
  microsecond: 3,
  nanosecond: 500
}); // =&amp;gt; 1995-12-07T03:24:30.0000035-08:00[America/Los_Angeles]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The broad capabilities of Temporal.ZonedDateTime make it a powerful combination of Temporal.TimeZone, Temporal.Instant, and Temporal.PlainDateTime.&lt;/p&gt;
&lt;h3&gt;Temporal.PlainDate: A Date Without Time or Time Zone&lt;/h3&gt;
&lt;p&gt;A Temporal.PlainDate object encapsulates a calendar date without any association with a specific time or time zone. For example, it can represent August 24th, 2006.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const date = Temporal.PlainDate.from({ year: 2006, month: 8, day: 24 });
date.year; // =&amp;gt; 2006
date.inLeapYear; // =&amp;gt; false
date.toString(); // =&amp;gt; &apos;2006-08-24&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Additionally, &lt;code&gt;Temporal.PlainDate&lt;/code&gt; can be converted to partial dates like &lt;code&gt;Temporal.PlainYearMonth&lt;/code&gt; and &lt;code&gt;Temporal.PlainMonthDay&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;Temporal.PlainTime: Time Without Date or Time Zone&lt;/h3&gt;
&lt;p&gt;A &lt;code&gt;Temporal.PlainTime&lt;/code&gt; object represents a wall-clock time without any connection to a specific date or time zone. Think of it as a way to represent times like 7:39 PM.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const time = Temporal.PlainTime.from({
  hour: 19,
  minute: 39,
  second: 9,
  millisecond: 68,
  microsecond: 346,
  nanosecond: 205
});
time.second; // =&amp;gt; 9
time.toString(); // =&amp;gt; &apos;19:39:09.068346205&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Temporal.PlainDateTime: Date and Time Without Time Zone&lt;/h3&gt;
&lt;p&gt;A &lt;code&gt;Temporal.PlainDateTime&lt;/code&gt; elegantly represents a combination of calendar date and wall-clock time without tying itself to a specific time zone. It&apos;s perfect for scenarios like December 7th, 1995, at 3:00 PM in the Gregorian calendar.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const dateTime = Temporal.PlainDateTime.from({
  year: 1995,
  month: 12,
  day: 7,
  hour: 15
});
const dateTime1 = dateTime.with({
  minute: 17,
  second: 19
});
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;While &lt;code&gt;Temporal.PlainDateTime&lt;/code&gt; is a versatile choice, it&apos;s essential to note that for use cases requiring precise time zone adjustments, especially concerning Daylight Saving Time (DST), consider using &lt;code&gt;Temporal.ZonedDateTime&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;Temporal.PlainYearMonth: Focusing on the Year and Month&lt;/h3&gt;
&lt;p&gt;Sometimes, you need to express a date without specifying the day component. Temporal.PlainYearMonth serves this purpose, making it suitable for scenarios like &amp;quot;the October 2020 meeting.&amp;quot;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const yearMonth = Temporal.PlainYearMonth.from({ year: 2020, month: 10 });
yearMonth.daysInMonth; // =&amp;gt; 31
yearMonth.daysInYear; // =&amp;gt; 366
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Temporal.PlainMonthDay: A Date Without a Year&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;Temporal.PlainMonthDay&lt;/code&gt; represents dates without a year component, making it ideal for expressing events like &amp;quot;Bastille Day is on the 14th of July.&amp;quot;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const monthDay = Temporal.PlainMonthDay.from({ month: 7, day: 14 });
const date = monthDay.toPlainDate({ year: 2030 });
date.dayOfWeek; // =&amp;gt; 7
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Temporal.Duration: Measuring Time Intervals&lt;/h3&gt;
&lt;p&gt;For measuring time intervals, Temporal introduces &lt;code&gt;Temporal.Duration&lt;/code&gt;. It&apos;s the go-to choice when dealing with date/time arithmetic or calculating differences between Temporal objects.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const duration = Temporal.Duration.from({
  hours: 130,
  minutes: 20
});
duration.total({ unit: &apos;second&apos; }); // =&amp;gt; 469200
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Temporal.TimeZone: Managing Time Zone Translations&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;Temporal.TimeZone&lt;/code&gt; is your companion for managing IANA time zones, UTC offsets, and UTC itself. It facilitates the conversion from UTC to local date/time and helps find offsets for specific &lt;code&gt;Temporal.Instant&lt;/code&gt; moments.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const timeZone = Temporal.TimeZone.from(&apos;Africa/Cairo&apos;);
timeZone.getInstantFor(&apos;2000-01-01T00:00&apos;); // =&amp;gt; 1999-12-31T22:00:00Z
timeZone.getPlainDateTimeFor(&apos;2000-01-01T00:00Z&apos;); // =&amp;gt; 2000-01-01T02:00:00
timeZone.getPreviousTransition(Temporal.Now.instant()); // =&amp;gt; 2014-09-25T21:00:00Z
timeZone.getNextTransition(Temporal.Now.instant()); // =&amp;gt; null
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Temporal.Calendar: Embracing Different Calendar Systems&lt;/h3&gt;
&lt;p&gt;While most code aligns with the ISO 8601 calendar, Temporal accommodates various calendar systems. It&apos;s important to note that dates are associated with &lt;code&gt;Temporal.Calendar&lt;/code&gt; objects to perform calendar-related operations.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const cal = Temporal.Calendar.from(&apos;iso8601&apos;);
const date = cal.dateFromFields({ year: 1999, month: 12, day: 31 }, {});
date.monthsInYear; // =&amp;gt; 12
date.daysInYear; // =&amp;gt; 365
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;By navigating the comprehensive documentation and utilizing the powerful features of Temporal, developers can revolutionize their date and time handling in JavaScript. Temporal brings clarity, precision, and reliability to date-related operations, making it an invaluable addition to the ECMAScript ecosystem.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;In conclusion, Temporal represents a significant leap forward in addressing the long-standing date and time challenges in ECMAScript. With its user-friendly APIs, time zone support, immutability, and comprehensive documentation, Temporal equips developers to conquer complex date and time scenarios with confidence. As you explore Temporal&apos;s capabilities and integrate it into your projects, you&apos;ll discover a new level of precision and clarity in date and time handling.&lt;/p&gt;
&lt;h2&gt;References&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/proposal-temporal/docs/index.html&quot;&gt;Temporal Proposal Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/tc39/proposal-temporal&quot;&gt;Temporal GitHub Repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://maggiepint.com/2017/04/11/fixing-javascript-date-web-compatibility-and-reality/&quot;&gt;Fixing JavaScript Date&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
</content:encoded><author>Paul Valladares</author></item><item><title>The importance of Vim keybindings</title><link>https://creatures.dev/blog/the-importance-of-vim-keybindings/</link><guid isPermaLink="true">https://creatures.dev/blog/the-importance-of-vim-keybindings/</guid><description>Vim, the past, the present and the future. How can it help you become more productive and efficient in your day to day life as a developer?</description><pubDate>Mon, 28 Aug 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;You might be wondering if this will be an article where I&apos;ll speak on how you
can flex to your friends and colleagues that you use Vim. Well, you&apos;re wrong.
This article is about the importance of Vim keybindings and how they can help
you become a better programmer and okay, maybe a little bit of flexing.&lt;/p&gt;
&lt;h3&gt;What is Vim?&lt;/h3&gt;
&lt;p&gt;Vim is a text editor. A very old text editor I might say, it was originally
published in 1991 and it was an improvement of Billy Joy&apos;s
&lt;a href=&quot;https://www.cs.colostate.edu/helpdocs/vi.html&quot;&gt;vi&lt;/a&gt; text editor. So after over
30 years, how are we using Vim nowadays? For starters, you can add the Vim
keybindings to your favorite text editor. For example, I use Vim keybindings in
VSCode, and I can tell you that it has improved my workflow a lot. But, why is
that? Why are Vim keybindings so important? Let&apos;s find out.&lt;/p&gt;
&lt;h3&gt;Why are Vim keybindings so important?&lt;/h3&gt;
&lt;p&gt;Vim keybindings are important because they allow you to edit text with a
precision and speed that traditional editors struggle to match. The efficiency
gains from Vim&apos;s keybindings translate into saved time and enhanced
productivity. While the learning curve might be steep, the benefits are
undeniable, making the journey towards mastering Vim&apos;s keybindings an endeavor
well worth the effort.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const myFunction = ({ data: { code: string } }) =&amp;gt; {
  console.log(&apos;Hello World&apos;)
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If I want to remove the arguments to the function, you can do it by &lt;code&gt;di(&lt;/code&gt; which
means delete inside &lt;code&gt;(&lt;/code&gt;. So, the result would be:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const myFunction = () =&amp;gt; {
  console.log(&apos;Hello World&apos;)
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As you can see, it&apos;s a very simple and fast process. But, how does it work?
Let&apos;s find out.&lt;/p&gt;
&lt;h3&gt;How do Vim keybindings work?&lt;/h3&gt;
&lt;p&gt;Vim keybindings are based on the concept of modal editing. This means that the
editor has different modes, and each mode has a different purpose. For example,
the default mode is the normal mode, and it&apos;s used for navigation and editing.
The insert mode is used for inserting text, and the visual mode is used for
selecting text. You can switch between modes by pressing the &lt;code&gt;Esc&lt;/code&gt; key.&lt;/p&gt;
&lt;h3&gt;How to use Vim keybindings in VSCode?&lt;/h3&gt;
&lt;p&gt;To use Vim keybindings in VSCode, you need to install the
&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=vscodevim.vim&quot;&gt;Vim extension&lt;/a&gt;.
You can do this by going to the extensions tab and searching for Vim. Once
you&apos;ve installed the extension, you can enable it by going to the settings tab
and searching for Vim. Then, you need to check the box that says &amp;quot;Enable Vim&amp;quot;.
After that, you can start using Vim keybindings in VSCode.&lt;/p&gt;
&lt;h3&gt;Neovim, the future of Vim&lt;/h3&gt;
&lt;p&gt;Neovim is a fork of Vim that aims to improve the extensibility and
maintainability of Vim. Neovim is written in C and Lua. It is available for
Linux, macOS, and Windows.&lt;/p&gt;
&lt;h3&gt;Improvements over Vim&lt;/h3&gt;
&lt;p&gt;Neovim has several improvements over Vim, including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Better plugin architecture:&lt;/code&gt; Neovim has a better plugin architecture than
Vim. This allows developers to create plugins that are more powerful and
easier to maintain.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Ecosystem:&lt;/code&gt; Neovim has a larger ecosystem than Vim. This means that there are
more plugins available for Neovim than for Vim.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Lua instead of Vimscript:&lt;/code&gt; Neovim uses Lua instead of Vimscript. This allows
developers to create plugins that are more powerful and easier to maintain.
Lua is super fast and easy to learn, so it&apos;s a great choice for a scripting
language.&lt;/li&gt;
&lt;li&gt;And many more...&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;How to get started with Neovim?&lt;/h3&gt;
&lt;p&gt;To get started with Neovim, you need to install it on your machine. You can do
this by following the instructions on the &lt;a href=&quot;https://neovim.io/&quot;&gt;Neovim website&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Or if you&apos;re like me and you prefer to watch videos, you can watch this
&lt;a href=&quot;https://www.youtube.com/watch?v=w7i4amO_zaE&quot;&gt;video&lt;/a&gt; by ThePrimeagen on how to
setup Neovim.&lt;/p&gt;
&lt;p&gt;When it comes to Neovim, I would suggest you not to re-create VSCode in Neovim.
You can get lost in the rabbit hole of plugins and configurations. Instead, I
would suggest you to start with the basics and then slowly add plugins and
configurations as you need them.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Simple is better than complex.&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;Vim keybindings that you should know&lt;/h3&gt;
&lt;p&gt;There are a lot of Vim keybindings that you can use to improve your workflow.
Instead of me going through each keybind, I&apos;ll share this cheat sheet that you
can use as a reference. You can also print it out and put it on your desk so
that you can look at it whenever you need to.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://vim.rtorr.com&quot;&gt;https://vim.rtorr.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It might seem a little overwhelming, but remember:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Rome wasn&apos;t built in a day.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So, take your time and learn one keybinding at a time. You&apos;ll be surprised by
how much you can improve your workflow by learning just a few keybindings.&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;Resources to learn more about Vim&lt;/h3&gt;
&lt;p&gt;You can use this or any blog post as a reference however the best way to learn
Vim is by using it. So, I recommend starting with the VSCode extension and then
moving to Neovim. If you want to learn more about Vim, here are some resources
that you can use:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://vim-adventures.com/&quot;&gt;Vim Adventures&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.openvim.com/&quot;&gt;OpenVim&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/playlist?list=PLm323Lc7iSW_wuxqmKx_xxNtJC_hJbQ7R&quot;&gt;ThePrimeagen&apos;s Vim As Your Editor&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;At the end of the day you don&apos;t have to use Vim if it&apos;s not your cup of tea.
However we can&apos;t deny the importance of it and at the end of the day, you will
at least be able to work on a server and modify files without too much hassle.&lt;/p&gt;
&lt;p&gt;However, if you do decide to take on the Vim adventure, one thing to keep in
mind is that you should create an environment in which your mind works best.&lt;/p&gt;
&lt;p&gt;The Vim keybinds are made to make sense and be easy to remember. Vim is a
pattern based editor, so once you learn the patterns, you&apos;ll be able to use Vim
without thinking about it.&lt;/p&gt;
&lt;p&gt;And to finish this article with a joke:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Vim is not just a text editor, it&apos;s a way of life. It&apos;s a philosophy. It&apos;s a
way of thinking. It&apos;s a way of being.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Thanks for reading and I hope you learned something new today. If you have any
questions or comments, feel free to ask me on my socials. I&apos;ll be happy to
answer them.&lt;/p&gt;
</content:encoded><author>Andrej Acevski</author></item><item><title>The Jokers in a Deck of cards - on the ever-evolving Generalist Role</title><link>https://creatures.dev/blog/the-jokers-in-a-deck-of-cards/</link><guid isPermaLink="true">https://creatures.dev/blog/the-jokers-in-a-deck-of-cards/</guid><description>On the ever-evolving generalist/full-stack role and to what extent does it make sense to broaden your skillset.</description><pubDate>Wed, 01 Nov 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;In our industry, some don&apos;t fit into a single box. Being one of those people,
I&apos;ve felt somewhat constrained when hired for a &amp;quot;front-end&amp;quot; or a &amp;quot;back-end&amp;quot;
role. I&apos;ve felt more at home in the very vaguely defined &amp;quot;full-stack&amp;quot; role, but
those roles can sometimes get a bit overwhelming. While I do enjoy the challenge
of learning new things, infra and cloud stuff makes me want to cry. It&apos;s me,
AWS; it&apos;s not you.&lt;/p&gt;
&lt;p&gt;Now, the benefits of doing the cloudy stuff aren&apos;t lost on me - but I prefer
setting my own application server, HTTP servers, etc. I don&apos;t dislike
automation, but I like understanding what&apos;s going on &amp;quot;under the hood&amp;quot; without
having to wade through pages of (usually not great) documentation or getting
consultants that point me towards one of the thousand available methods to
load-balance something. Okay, rant over, back to the topic at hand.&lt;/p&gt;
&lt;h2&gt;The conversation that sparked this post&lt;/h2&gt;
&lt;p&gt;What really inspired me to write this post is the following
&lt;a href=&quot;https://www.linkedin.com/feed/update/urn:li:activity:7117142861547999232/&quot;&gt;LinkedIn exchange&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/li-post-darko.png&quot; alt=&quot;My Post&quot;&gt;&lt;/p&gt;
&lt;p&gt;And the comment that followed:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/li-post-bojan.png&quot; alt=&quot;Bojan&apos;s post&quot;&gt;&lt;/p&gt;
&lt;p&gt;Bojan&apos;s analogy is good and spot-on for multiple reasons. Having a flexible
skillset does make you more valuable in the sense that you can jump in at any
end of the proverbial stack and fill a role. Does that come with monetary
benefits? It&apos;s debatable, but in my experience, it doesn&apos;t make that much of a
difference. Should it? I could argue that it should, but that&apos;s a topic for
another post.&lt;/p&gt;
&lt;p&gt;&amp;quot;Jokers&amp;quot; is an accurate analogy to what the generalist role usually is - a
placeholder card, maybe a trump card, depending on the game. This is exactly
what a generalist does - fill in a need or provide insights/big-picture ideas
for a project.&lt;/p&gt;
&lt;p&gt;Being in such a role comes with tradeoffs - some great, some not so much. Let&apos;s
dig deeper into those.&lt;/p&gt;
&lt;h2&gt;The full-stack developer of yore&lt;/h2&gt;
&lt;p&gt;In the olden days, there was no such thing as stacks. I remember a time when
front-end amounted to negotiating with the browser (I haven&apos;t forgiven you IE)
not to screw up the HTML, CSS and maybe some JS that you neatly packaged into a
page via a templating engine. People who called themselves front-end developers
invoked a very different set of ideas about what they did than what we do today.
More often than not, there were expectations that you&apos;d be able to do some
design work, often using Photoshop - we used to have people that did
&lt;a href=&quot;https://en.wikipedia.org/wiki/Slicing_(interface_design)&quot;&gt;&amp;quot;slicing&amp;quot;&lt;/a&gt;. It
totally made sense, though. The web was a very different place than what it is
today, tech-wise. So, if you were into web development, you were called a web
developer. No front-end or back-end about it, let alone full-stack.&lt;/p&gt;
&lt;p&gt;But a chain of events happened that caused two important things: JavaScript got
better as a language, and the Web Platform got decent to work with. Naturally,
people started doing more and more stuff in the browser - there&apos;s no need to
ignore the processing power of an entire machine just because you&apos;re used to
sending stuff from the server. So the front-end started taking on a different
meaning than what we previously thought. Consequently, the role of a front-end
developer started being a thing.&lt;/p&gt;
&lt;p&gt;Naturally, those who were into web development but still disliked JavaScript
(which, frankly, was often the default) stuck to the back-end. In effect, the
classical web developer turned into what we nowadays think of as a back-end
developer. This is, of course, simplified and probably biased, but to me, it
feels like a good approximation of the evolution of the web developer role.&lt;/p&gt;
&lt;p&gt;That leaves us weirdos who liked both sides of the coin. I grew to love
JavaScript and the Web Platform a lot, but I still enjoyed doing back-end stuff.
Those lucky few of us who loved going back and forth the stack came to be known
as &amp;quot;full-stack developers&amp;quot;.&lt;/p&gt;
&lt;p&gt;So naturally, when full-stack started being a role companies hired for, the job
descriptions were far from standardized (in many ways, they still are). One
company may have expected hard-core Ruby-on-Rails skills with a dash of
front-end knowledge. Another would expect somebody to write a Backbone.js
application and a couple of REST routes in PHP. The job descriptions got broader
with the advent of React and modern front-end frameworks in general. This was
yet another evolution driven by the modernization of the Web Platform and the
rise of JavaScript as a language. With more and more complexity thrown on top of
an already complex system, naturally, web development got more challenging to
get into and more difficult to master.&lt;/p&gt;
&lt;p&gt;Being spread across the stack got even more complicated as a result. Considering
the speed at which the front-end changes, plus having to stay on top of your
back-end skills, it indeed requires a lot of effort to stay sharp and
employable.&lt;/p&gt;
&lt;p&gt;As always, things got more complicated. Enter the cloud.&lt;/p&gt;
&lt;h2&gt;And then, the &amp;quot;cloud&amp;quot; happened&lt;/h2&gt;
&lt;p&gt;Since everything has to be
&lt;a href=&quot;https://www.reddit.com/r/ProgrammerHumor/comments/62rsd0/mongodb_is_web_scale/&quot;&gt;wEb ScAle&lt;/a&gt;
these days, and herding servers isn&apos;t the most fun experience in the world, we
invented this magical thing known as the
&lt;a href=&quot;https://en.wikipedia.org/wiki/Cloud_computing&quot;&gt;cloud&lt;/a&gt;. Now, I&apos;m not a cloud
skeptic. It has its uses, but it&apos;s not the silver bullet that it&apos;s often made
out to be. It&apos;s a tool, and like any tool, it has its upsides and drawbacks. But
I digress.&lt;/p&gt;
&lt;p&gt;On top of having to know your way across the front and back-end, often there
were expectations of full-stack devs who knew their way around the cloud. As a
sidebar, we also evolved sysadmins to DevOps, SREs, and infra people due to the
advent of the cloud. So, we do have specialized or intersectional roles that
deal with the cloud. Regardless, the expectation, explicit or otherwise, is
often there - a full-stack person should know cloud stuff on top of an already
diverse skillset.&lt;/p&gt;
&lt;p&gt;Personally, I never liked the idea of having to deal with the cloud. I can and
like setting my apps and servers on bare-metal or on VPSs. Yes, it&apos;s not
super-scalable, but the real question is: does it need to be cloud-scale? Quite
often, investing in cloud stuff early in a product&apos;s lifecycle just adds
complexity on top. But I digress again.&lt;/p&gt;
&lt;p&gt;My point is - the full-stack role and the expectations around it got even more
complicated.&lt;/p&gt;
&lt;h2&gt;The generalist role today and tomorrow&lt;/h2&gt;
&lt;p&gt;So, what does that all mean for the generalist full-stacker today? Depends on
the company, but I feel the expectations are broader than ever. With no sign of
slowing down. While I feel like we need to redefine what the full-stack means,
really, one key thing is that it&apos;s a role that&apos;s constantly evolving. That
constant evolution means that we, as generalists, must remain flexible and open
to learning new things. Personally, I feel like that&apos;s a good thing - you never
really run the risk of getting bored with your &amp;quot;toys&amp;quot;. We all have our limits
and ranges of interests (I&apos;m looking at you, cloud). Still, the flexibility and
the ability to jump up and down the stack will remain essential for the
generalist of today and tomorrow.&lt;/p&gt;
&lt;h2&gt;The elephant in the room - time and focus shifts&lt;/h2&gt;
&lt;p&gt;My previous points may paint an interesting picture, but we all suffer from one
key constraint - time and, more importantly, the time we dedicate to being
focused on one single task. No matter how flexible of a skillset you possess,
you still have the same hours in a day as your more specialized counterparts.
Shifting your focus from writing CSS to imagining a new feature to writing a
REST endpoint has a time overhead -
&lt;a href=&quot;https://ics.uci.edu/~gmark/chi08-mark.pdf&quot;&gt;23 minutes, to be exact&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;On top of that, your energy stores aren&apos;t infinite. I don&apos;t have the scientific
research to prove it, but I feel more tired the more I switch context. So you&apos;re
left with a choice - either plan for context switches to minimize their cost and
time overhead, or you&apos;ll have to embrace the chaos and the overhead that comes
with it.&lt;/p&gt;
&lt;p&gt;That said, I&apos;m not much of a daily-level planner. My usual operational mode for
these shifts is to stick to one task as much as possible, fight against new
piling tasks (unless they are super-super urgent, but the burden of urgency
proof is on the requester), and ultimately embrace the chaos. It works most
days, but it&apos;s far from a perfect system. I&apos;m experimenting with a more
structured approach, we&apos;ll see how that goes.&lt;/p&gt;
&lt;p&gt;While the point of having a broad skillset and flexibility to be able to jump in
and out of different tasks stands, we are limited by time. Strategy is vital, as
we are prone to burnout.&lt;/p&gt;
&lt;h2&gt;The hidden bonus - you can specialize&lt;/h2&gt;
&lt;p&gt;With ups and downs covered, there&apos;s one key aspect that we didn&apos;t - you can
specialize at any time. Being a generalist, you already have at least some
basics of a specialized skillset. That gives you an advantage if you decide that
you want to specialize in front-end, or back-end, or cloud, or whatever.&lt;/p&gt;
&lt;p&gt;This is likely one of the most significant advantages of being a generalist.
While nothing is stopping a developer who decided to be a specialist from the
get-go to broaden their skills, it&apos;s often a more arduous path to take compared
to already having a skillset that you can build upon.&lt;/p&gt;
&lt;h2&gt;The hidden bonus, 2 - it doesn&apos;t have to be one&lt;/h2&gt;
&lt;p&gt;Nothing is limiting you from doing it twice. Or as many times as you feel like.
In fact, I&apos;d argue that the ultimate full-stack generalist ideal would be &amp;quot;a
jack of all trades and a master of some&amp;quot;. Specializing doesn&apos;t cost you
flexibility; it simply adds depth to an already existing skill set.&lt;/p&gt;
&lt;p&gt;Broad plus deep in some areas is a great combination to have, and it opens up a
lot of opportunities.&lt;/p&gt;
&lt;h2&gt;Takeaway&lt;/h2&gt;
&lt;p&gt;Being a generalist, or full-stack, or having a broader skillset does come with a
set of advantages and disadvantages. It&apos;s not for everyone; it can be
energy-consuming, and it can burn you out quickly if you don&apos;t have a strategy.
But it&apos;s a rewarding family of roles and a perfect fit for the curious mind that
likes to learn new things.&lt;/p&gt;
&lt;p&gt;On the other hand, the role also provides a unique perspective, allowing for a
greater understanding of the bigger picture in a project. The ability to see and
work across the spectrum offers a holistic view that specialists might sometimes
miss. This is beneficial not only to the individual but to the teams and
companies they work for, as they can provide insights that bridge gaps, improve
communication, and optimize processes.&lt;/p&gt;
&lt;p&gt;Additionally, the path of a generalist is often a journey of continuous
learning. It&apos;s not just about staying updated with the latest technologies or
methodologies, but it&apos;s also about understanding how different parts of a system
interact and influence each other. This constant need for learning and updating
one’s skill set can be a strong motivator for those with an innate curiosity.&lt;/p&gt;
&lt;p&gt;For those who thrive on variety, learning, and adaptability, it&apos;s a path worth
considering.&lt;/p&gt;
</content:encoded><author>Darko Bozhinovski</author></item></channel></rss>