<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dan</title>
    <description>The latest articles on DEV Community by Dan (@dpark).</description>
    <link>https://dev.to/dpark</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1254659%2Fd2c6fbb6-56dc-4955-9d1c-a7f07fd92c04.jpg</url>
      <title>DEV Community: Dan</title>
      <link>https://dev.to/dpark</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dpark"/>
    <language>en</language>
    <item>
      <title>Does a ‘perfect’ dev environment exist?</title>
      <dc:creator>Dan</dc:creator>
      <pubDate>Tue, 13 Feb 2024 22:25:26 +0000</pubDate>
      <link>https://dev.to/dpark/does-a-perfect-dev-environment-exist-3bl3</link>
      <guid>https://dev.to/dpark/does-a-perfect-dev-environment-exist-3bl3</guid>
      <description>&lt;p&gt;That’s likely a loaded question and it comes with a further set of qualifiers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How resource intensive is the work? Cloud or local?&lt;/li&gt;
&lt;li&gt;Are we talking about teams or individuals?&lt;/li&gt;
&lt;li&gt;What types of machines are we working with?&lt;/li&gt;
&lt;li&gt;What do you mean by environment? Do you mean your IDE? Internal dev stack?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To avoid the risk of sparking any holy wars, let’s lay some ground rules. Imagine a scenario where we have a team of 15 or so engineers and we’re working on an increasingly complex product where we want to iterate quickly. Our product has a lot of moving pieces and we’re starting to struggle with devs not having shared context for their dev environments. Different setups and inconsistent local environments are slowing us down. Sound familiar?&lt;/p&gt;

&lt;p&gt;We’ve experienced it, we have friends who’ve run into it, some of this might even resonate with you.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Development is a fundamentally creative act and the canvas of development environments needs to enable engineers, not deter them.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This leads us to our quintessential question, what makes the ‘perfect dev environment’? For starters, we believe they should have all of the following characteristics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parametrizable: Save time by encoding common use cases in the dev environment.&lt;/li&gt;
&lt;li&gt;Overridable: Retain flexibility by allowing for changes outside the predefined cases.&lt;/li&gt;
&lt;li&gt;Approachable: Interfacing with your tooling should be intuitive.&lt;/li&gt;
&lt;li&gt;Reliable: The environment should consistently spin up and work as expected.&lt;/li&gt;
&lt;li&gt;Ephemeral: Easily spin up and clean up after yourself.&lt;/li&gt;
&lt;li&gt;Distributable: Ensure everyone can easily access the dev environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's break these down.&lt;/p&gt;

&lt;h3&gt;
  
  
  Parametrizable: Save Time with Common Cases
&lt;/h3&gt;

&lt;p&gt;Parameterization allows you to encode common use cases in your dev environment, letting you flex common interaction points while skipping the boilerplate repetition. Picture your dev environment with a Postgres database. You’ll need to input a username, generate test data, load that data, connect an API to your database, and more. These steps have different inputs however stay consistent.&lt;/p&gt;

&lt;p&gt;In the near term, this saves you time in skipping tedium, but in the long term, especially as your setup grows in complexity, it saves mental bandwidth as every dev doesn’t need intimate knowledge of a system to interact with it. Allowing devs to simply configure the parts they need (username, API keys, etc.) while abstracting away the rest (loading data) ensures devs get the exact configuration they need without needing any knowledge of how the environment was set up.&lt;/p&gt;

&lt;h3&gt;
  
  
  Overridable: Stay Flexible for Uncommon Cases
&lt;/h3&gt;

&lt;p&gt;So we can handle common cases, but what about the uncommon ones? Can we make changes outside the tyranny of what our environment author has set for us? This leads us to environments being overridable. Without the ability to override your dev environment, you’re stuck with the set of tools already written by someone else. If you aren’t already very familiar with those tools, you’d have to dive into that code to understand it, especially well enough not to break it.&lt;/p&gt;

&lt;p&gt;Taking our Postgres example, imagine an internal tool that spins up a Postgres database, web services, and test data. If we wanted to change something that wasn’t yet parameterized — e.g. the flags Postgres starts with — we’d have to dive into Docker, k8s, or whatever else is used to start the dev stack. If you’re using bash scripts, you might break something in your local dev environment requiring more time for debugging. Best case scenario, nothing breaks and you’ve made the edits you expected but you’ve devoted quite a bit of time to achieve that. By allowing your environment to be overridable, you don’t need to deeply understand the system to make changes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Approachable: How Intuitive is Your Setup?
&lt;/h3&gt;

&lt;p&gt;Depending on the sophistication of your setup, it may be challenging to interact with your dev environment. Let's say your DevOps team has decided on a CLI and made this tool fully featured with a myriad of wonderful detailed options. As the tool becomes more powerful, this CLI becomes more complex and challenging to use.&lt;/p&gt;

&lt;p&gt;When a dev is dumped into a tool that isn’t walk-up intuitive, they’re met with the choice of “Do I learn this tool or do I just hack something that’ll work right now?” Increasing approachability with an intuitive tool helps them pick the former. This is easier said than done as achieving this requires both a product mindset as well as a DevOps/platform mindset, or at the very least great docs which no engineer likes to write.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reliable: Your Environment Should Just Work ™️
&lt;/h3&gt;

&lt;p&gt;When spinning up the environments, it needs to just work. These environments need to spin up as expected when presented with different directories, different configurations of dev machines, and more. As many would guess, this is easier said than done. Flaky dev environments not only are frustrating but also result in costly delays.&lt;/p&gt;

&lt;p&gt;Scripting languages are challenging for writing safe code. It’s challenging to catch configuration errors in advance, instead, they need to be caught at runtime. You need to implement waits and health checks correctly i.e. docker by default doesn’t wait for ports to become available and k8s has health checks but users need to configure them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ephemeral: Clean and Consistent
&lt;/h3&gt;

&lt;p&gt;An ideal dev environment is also ephemeral. It’s important that you can spin these environments up and clean up after it trivially. This ensures consistency as team members work off a clean slate baseline environment. They’re also resource-efficient and scalable as you can clean up environments not in use and scale multiple instances as needed.&lt;/p&gt;

&lt;p&gt;Ephemeral environments are useful for a variety of uses across quick dev iterations and end-to-end testing, they do require sophisticated infrastructure or tooling due to resource management, data persistence, and more, however, some upfront pain pays dividends.&lt;/p&gt;

&lt;h3&gt;
  
  
  Distributable: Get Your Tooling to Everyone
&lt;/h3&gt;

&lt;p&gt;The last I’ll mention is the environment being distributable. So you have a highly flexible dev environment that is incredibly easy to spin up for common use cases, but easy to revise for uncommon ones. Sounds great but it’s only valuable if everyone can get their hands on it.&lt;/p&gt;

&lt;p&gt;Smaller teams can likely get by as everyone can clone the repo and individually ensure they have the latest. However as the team grows and work becomes more complex, it becomes challenging to distribute the latest environment, ensuring everyone is working on the same thing and it's in sync with relevant tools. The best tooling is most valuable if it’s uniformly adopted by the people it’s meant for.&lt;/p&gt;

&lt;h3&gt;
  
  
  So where do we land?
&lt;/h3&gt;

&lt;p&gt;Often, how easy achieving these depends on how good your platform engineer is, their familiarity with bash, compose, k8s, and their product mindset for aforementioned approachability. It’s a tall ask creating the ‘perfect dev environment’ given high demands for optimal developer experience, a fast-moving landscape, and technical barriers.&lt;/p&gt;

&lt;p&gt;Luckily, we built Kurtosis so that you don’t have to make that choice. Development environments written into Kurtosis packages achieve all of the above and more. If you’d like to learn more, &lt;a href="https://github.com/kurtosis-tech/kurtosis/tree/main"&gt;check out monorepo and consider dropping a star while you’re there.&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>development</category>
      <category>backend</category>
      <category>developer</category>
    </item>
    <item>
      <title>Pkl and the Goldilocks problem of configuration languages</title>
      <dc:creator>Dan</dc:creator>
      <pubDate>Wed, 07 Feb 2024 00:30:25 +0000</pubDate>
      <link>https://dev.to/dpark/pkl-and-the-goldilocks-problem-of-configuration-languages-4a9d</link>
      <guid>https://dev.to/dpark/pkl-and-the-goldilocks-problem-of-configuration-languages-4a9d</guid>
      <description>&lt;p&gt;Apple’s newly open-sourced config language Pkl &lt;a href="https://dev.tohas%20been%20making%20waves%20on%20HackerNews"&gt;has been making waves on HackerNews&lt;/a&gt;, and the responses seem split between “This is a breath of fresh air” and “Why do we need another config language?”.&lt;/p&gt;

&lt;p&gt;Kurtosis has forced me to think long and hard about configuration, so in this article I’ll provide a framework for evaluating configuration languages, explain why configuration languages face a difficult tradeoff, and make a prediction on Pkl’s trajectory.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What even is configuration?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This seems like a silly question, since we as an industry generally grok what config is: it’s the thing that controls how a piece of software behaves. It can be expressed in various ways — perhaps as an object in your favorite language, perhaps as flags or environment variables, perhaps as a YAML file — but in all cases config represents the top-level parameters of the piece of software.&lt;/p&gt;

&lt;p&gt;However, config is interesting because it sits at the seam between the program being configured and a user (either a human, or another program). Configuration is an API.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;The constraints on configuration&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Because it sits at the seams between two systems, configuration is subject to the following pressures:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Approachability pressure:&lt;/strong&gt; configuration must be walk-up approachable in a way that the program being configured need not be. It’s fine to write your entire program in Brainfuck if your configuration is understandable and well-documented YAML. Minimalism, readability, and documentation are important here.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Integration pressure:&lt;/strong&gt; configuration lives at the seams between two systems, and it’s very common for engineers of the outer system to automate configuring the inner pieces. Configuration that can’t easily be automated is problematic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Maintainability pressure:&lt;/strong&gt; the users of the configuration need to evolve it over time, especially if they have an automation system built on top. Configuration reuse (DRY) is an important tactic for preventing bugs and increasing maintainability, so higher-order logic like conditions, loops, and packaging systems become necessary somewhere.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;NOTE: configuration is also sometimes subjected to validity pressure, under the idea that config shouldn’t even be usable unless it’s valid. More on this later.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Configuration languages today&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Let’s take a brief tour of some popular configuration languages and see how they deal with these pressures:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;YAML — the industry standard — is quite approachable, with its comments and whitespace-delineated blocks and insistence on key name duplication. However, it has very limited configuration reuse capability and lacks conditionals or loops, so its maintainability is low. Despite this, its ability to be integrated into a broader system is very high: every general-purpose language has YAML parsers and generators, and templating is relatively easy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;TOML takes a similar “it’s just data” approach to configuration as YAML, and has similar high-approachability, easy-to-integrate, low-maintainability characteristics to YAML (though with the asterisk that it’s not as well-known and therefore has a larger learning curve).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Jsonnet is more maintainable than YAML because it provides code reuse features like variables, references, conditionals, and imports. However, its custom syntax on top of the verbose JSON syntax reduces its approachability, and the lack of Jsonnet generators reduce its ease-of-integration (which might explain its lack of industry dominance).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Dhall plays in the same “JSON with logic” space as Jsonnet, but adds a typing system as well. This means that the language itself enforces configuration validity, which can be helpful in shortening feedback loops. Like Jsonnet though, the extra logic with custom syntax comes at the cost of approachability and ease-of-integration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cue also focuses on code reuse features using a custom JSON-like syntax similar to Dhall and Jsonnet, but goes even further by baking data validation into the value system. This leads to very strong validation, but with similar approachability and integration problems as Dhall and Jsonnet. In particular, Cue’s matrix model — while powerful — is hard to grok quickly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Starlark is Bazel’s configuration language, and has high approachability as a minimal subset of Python. However, users are free to write quite complex logic so its maintainability suffers, and Starlark generation is difficult so its ease-of-integration is low.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Analysis&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The projects above are sorted by descending star count on the project repo. Assuming star count is a rough proxy for popularity, this suggests some interesting conclusions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Approachability and ease-of-integration tend to move in tandem&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Approachability and maintainability tend to move opposite each other&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The two most-approachable, least-maintainable languages are by far the most popular&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In other words, people prefer to have configuration that’s difficult to maintain so long as they can easily understand what it’s doing, and integrate it with a higher-level system to flex the configuration as needed.&lt;/p&gt;

&lt;p&gt;This makes sense to me, as configuration’s primary purpose is to hold parameters for the lower-level system. Secondary features like code reuse aren’t always worth their complexity weight, because code reuse can be done in a higher-level configuration automation system.&lt;/p&gt;

&lt;p&gt;This is especially true for validation. In theory, it sounds nice to disallow invalid configurations from being instantiated, but in practice doing validation in the configuration language often means the author of the program-to-configure needs to duplicate validation: once in the program to validate the flags and environment variables their program inevitably accepts, and once more in the configuration file schema.&lt;/p&gt;

&lt;p&gt;There is, however, an environment where the calculus changes: a large company with a powerful internal platform and a standardized configuration language. In such an environment, a more powerful top-level configuration language is worth the approachability hit to empower engineers to reuse configuration from a large galaxy of existing configuration.&lt;/p&gt;

&lt;p&gt;It makes sense to me that Jsonnet, Cue, and Starlark were all born of Google’s configuration needs, and that Pkl might be born of Apple’s.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;The Goldilocks problem, and Pkl&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;We’ve seen that configuration languages face a Goldilocks problem — too little complexity and they struggle to keep code DRY and maintainable, too much complexity and they’re difficult to learn and integrate outside of corporate environments. The balance has to be just right.&lt;/p&gt;

&lt;p&gt;So where does Pkl fit in?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Approachability&lt;/strong&gt;: Pkl uses a completely custom syntax, which is a big barrier to adoption, and the system itself seems decently complex. I’d rate the approachability as low.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Integration&lt;/strong&gt;: This is a wildcard for me, as it’s not clear to me if I can import third-party schemas, generate bindings in my favorite general-purpose language, and use that to build a configuration automation system on top.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Maintainability&lt;/strong&gt;: Pkl’s embrace of schemas reflects configuration’s purpose as an API, and much of Pkl’s feature set seems geared towards code reuse and typing. I imagine that Pkl code will be quite maintainable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Validation&lt;/strong&gt;: Pkl seems to prioritize validation highly; I’d anticipate Pkl config to be very safe.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This analysis suggests to me that Pkl is trying to fill a spot somewhat similar to Cue: a very safe, highly-reusable language that’s intended to be your top-level configuration language at large scale, but whose approachability and ease-of-integration can be constraining for smaller projects and companies.&lt;/p&gt;

&lt;p&gt;I therefore hypothesize that, on the current trajectory, Pkl will probably see heavy adoption at Apple, but will remain niche outside. If the Pkl team is aiming for broader open-source adoption, I’d recommend smoothing the approachability and integration paths with the following tactical suggestions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The ability for YAML and TOML to be parsed as basic Pkl files (thereby allowing me to write my config in a language I’m familiar with, but get Pkl schema validation)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Smaller example repos with clearer identification of the Pkl-specific parts so I can see the full cost of buying in&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The ability to generate Pkl from my favorite general-purpose programming language, so I can build a configuration automation platform on top&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Perhaps, features in the toolchain to put backpressure on writing less complex (and therefore more approachable) Pkl files&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Afterword&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Configuration languages fill an important role but face a difficult game of tradeoffs, and Pkl is no exception. The proliferation of tools attempting to be the top-of-stack configuration language reminds me of the &lt;a href="https://xkcd.com/927/"&gt;famous XKCD comic about standards&lt;/a&gt;, and I’m becoming bearish on any non-YAML language as the open-source standard.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgka40v39pa1rmhhjdk66.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgka40v39pa1rmhhjdk66.png" alt="Image description" width="800" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next article I’ll detail how we wrestled with these same dilemmas at Kurtosis, and the conclusion we came to. Until then, if you’re a microservice developer who doesn’t want to deal with infra, I encourage you to check us out on Github; you might find Kurtosis useful.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>ios</category>
    </item>
    <item>
      <title>Cool Devtool Websites?</title>
      <dc:creator>Dan</dc:creator>
      <pubDate>Mon, 05 Feb 2024 23:46:55 +0000</pubDate>
      <link>https://dev.to/dpark/cool-devtool-websites-4g8f</link>
      <guid>https://dev.to/dpark/cool-devtool-websites-4g8f</guid>
      <description>&lt;p&gt;We just redid our website for &lt;a href="https://www.kurtosis.com/"&gt;Kurtosis.com&lt;/a&gt;! &lt;/p&gt;

&lt;p&gt;We're underway with a lot of user discovery so still experimenting with what words makes sense to users. Would love thoughts on how we did:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does the messaging make sense?&lt;/li&gt;
&lt;li&gt;Do you have an idea of what we might be useful for?&lt;/li&gt;
&lt;li&gt;Is it kinda cool? &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Would love any and all feedback! &lt;/p&gt;

&lt;p&gt;If you're interested in chatting on simplifying building your back end for dev and test, come chat with us and/or consider dropping a star on our monorepo &amp;lt;3 &lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/kurtosis-tech/kurtosis"&gt;https://github.com/kurtosis-tech/kurtosis&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>devops</category>
      <category>showdev</category>
      <category>web</category>
    </item>
  </channel>
</rss>
