<?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: Mathijs Vogelzang</title>
    <description>The latest articles on DEV Community by Mathijs Vogelzang (@mathijs81).</description>
    <link>https://dev.to/mathijs81</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%2F963604%2Fe6e948bf-6eed-4cf9-962d-026e8ade0782.jpeg</url>
      <title>DEV Community: Mathijs Vogelzang</title>
      <link>https://dev.to/mathijs81</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mathijs81"/>
    <language>en</language>
    <item>
      <title>Stellar Quest Out of Control: how I shot 100 asteroids with fewer than 300 bytes of WebAssembly</title>
      <dc:creator>Mathijs Vogelzang</dc:creator>
      <pubDate>Tue, 07 Mar 2023 14:34:23 +0000</pubDate>
      <link>https://dev.to/mathijs81/stellar-quest-out-of-control-how-i-shot-100-asteroids-with-fewer-than-300-bytes-of-webassembly-m84</link>
      <guid>https://dev.to/mathijs81/stellar-quest-out-of-control-how-i-shot-100-asteroids-with-fewer-than-300-bytes-of-webassembly-m84</guid>
      <description>&lt;p&gt;Stellar (the organization behind the Stellar Lumen cryptocurrency) organizes programming competitions, called "Stellar Quests". From February 15th to March 1st 2023, the competition revolved around a game called “Asteroids”, where you control a spaceship that moves through galaxies containing fuel pods and asteroids. To win, you need to shoot 100 asteroids without running out of fuel. The full instructions of this game are available &lt;a href="https://fastcheapandoutofcontrol.com/game/asteroids/play"&gt;on the official website&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This stellar quest had three categories: Fast (first submitted solution), Cheap (most efficient solution), and Out of Control (smallest solution). Read how I found a solution of fewer than 300 bytes of WebAssembly (WASM) code on &lt;a href="https://blog.vogelcode.com/blog/stellar-quest-wasm-optimization/"&gt;my blog&lt;/a&gt;&lt;/p&gt;

</description>
      <category>soroban</category>
      <category>sorobanathon</category>
      <category>rust</category>
      <category>webassembly</category>
    </item>
    <item>
      <title>Streamline your git workflow with HighFlux: the automated git client</title>
      <dc:creator>Mathijs Vogelzang</dc:creator>
      <pubDate>Thu, 15 Dec 2022 16:23:13 +0000</pubDate>
      <link>https://dev.to/mathijs81/streamline-your-git-workflow-with-highflux-the-automated-git-client-2mbk</link>
      <guid>https://dev.to/mathijs81/streamline-your-git-workflow-with-highflux-the-automated-git-client-2mbk</guid>
      <description>&lt;p&gt;Do you ever forget to commit a crucial file and end up with a broken build? Or your latest work is on your desktop, and you can't continue working on your laptop because you forgot to push? These are common challenges for developers, and we want to fix those with HighFlux.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.highflux.io/blog/streamline-git-workflow-automated-client"&gt;Read the full article about HighFlux here!&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>devops</category>
    </item>
    <item>
      <title>Rust, Tauri, and React: Our Technology choices for a desktop app in 2022</title>
      <dc:creator>Mathijs Vogelzang</dc:creator>
      <pubDate>Tue, 06 Dec 2022 15:47:58 +0000</pubDate>
      <link>https://dev.to/mathijs81/rust-tauri-and-react-our-technology-choices-for-a-desktop-app-in-2022-5ddg</link>
      <guid>https://dev.to/mathijs81/rust-tauri-and-react-our-technology-choices-for-a-desktop-app-in-2022-5ddg</guid>
      <description>&lt;p&gt;We built HighFlux, a transformative git client this year. Given the desired functionality (synchronize code to the cloud while a developer is writing it), we needed to build an app that runs on the developer’s machine. We come from a background in mobile apps (mainly Android) and web apps, so this was an exciting journey. In this post, I want to share our decisions and what we learned.&lt;/p&gt;

&lt;p&gt;Read the &lt;a href="https://www.highflux.io/blog/rust-tauri-react-developing-desktop-app-2022" rel="noopener noreferrer"&gt;full post on our blog!&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>What makes git so hard to use?</title>
      <dc:creator>Mathijs Vogelzang</dc:creator>
      <pubDate>Wed, 16 Nov 2022 21:44:33 +0000</pubDate>
      <link>https://dev.to/mathijs81/what-makes-git-so-hard-to-use-5hm5</link>
      <guid>https://dev.to/mathijs81/what-makes-git-so-hard-to-use-5hm5</guid>
      <description>&lt;p&gt;Git is a beautiful work of engineering. It's blazingly fast even on&lt;br&gt;
massive repositories, and it efficiently manages vast numbers of&lt;br&gt;
branches.&lt;/p&gt;

&lt;p&gt;These qualities have made git the dominant source control system, even&lt;br&gt;
though it's hard for humans to use.&lt;/p&gt;

&lt;p&gt;So what's wrong with git?&lt;/p&gt;
&lt;h2&gt;
  
  
  Git commands are too many, too low-level and hard to understand.
&lt;/h2&gt;

&lt;p&gt;The git program is a collection of 157 commands:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.highflux.io%2Fimg%2Fgit-commands.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.highflux.io%2Fimg%2Fgit-commands.png" alt="All 157 git commands"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The sheer number of commands is a problem. Even though it's pretty easy&lt;br&gt;
to master the most common 10 commands for day-to-day coding, you often&lt;br&gt;
run into commands you've never seen before. So git makes you feel like&lt;br&gt;
you're always a beginner!&lt;/p&gt;

&lt;p&gt;Also, git commands are low-level operations, so they don't map exactly&lt;br&gt;
to things you want to do.&lt;/p&gt;

&lt;p&gt;You need multiple commands to execute common actions (like "put my code&lt;br&gt;
on GitHub" and "make my coworker's code available in my editor").&lt;/p&gt;

&lt;p&gt;Finally, some of the commands do quite different things depending on&lt;br&gt;
their parameters (e.g., &lt;code&gt;git reset&lt;/code&gt; and &lt;code&gt;git checkout&lt;/code&gt;), making them&lt;br&gt;
hard to understand.&lt;/p&gt;

&lt;p&gt;Git has been trying to create less confusing commands (like splitting&lt;br&gt;
&lt;code&gt;git checkout&lt;/code&gt; into &lt;code&gt;git switch&lt;/code&gt; and &lt;code&gt;git restore&lt;/code&gt;), but this&lt;br&gt;
creates even more commands to learn!&lt;/p&gt;
&lt;h2&gt;
  
  
  Git tracks 4 versions of files, instead of just "my" version and "the team's" version.
&lt;/h2&gt;

&lt;p&gt;When I'm working on a file, I mostly think about "my" version (what I'm&lt;br&gt;
working on in my editor) and "the team's" version (what the file looks&lt;br&gt;
like on GitHub).&lt;/p&gt;

&lt;p&gt;Unfortunately, git has two more versions that I need to keep in mind:&lt;br&gt;
the one in the "index" (or "staging area") and the one in the HEAD&lt;br&gt;
commit in my local repository.&lt;/p&gt;

&lt;p&gt;Because of the low-level commands and the 4 different versions, there's&lt;br&gt;
no single git command that tells git to just take a file I saved in my&lt;br&gt;
editor and update GitHub. Instead, I have to do the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# disk -&amp;gt; index/staging area&lt;/span&gt;
git add README.md
&lt;span class="c"&gt;# staging area -&amp;gt; local branch&lt;/span&gt;
git commit
&lt;span class="c"&gt;# local branch -&amp;gt; remote repository (e.g., GitHub)&lt;/span&gt;
git push origin branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(The first two commands can be reduced to one with &lt;code&gt;git commit -a&lt;/code&gt;,&lt;br&gt;
but beware: that will only add changed files and skip any new files you&lt;br&gt;
created while coding.)&lt;/p&gt;

&lt;p&gt;Clearly, the 4-version internal git model complicates most common tasks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Git doesn't let us safely experiment
&lt;/h2&gt;

&lt;p&gt;Most of us learn new tools by experimenting with them, but git is not&lt;br&gt;
set up for experimentation. It lacks "undo", "--dryrun", and safeguards&lt;br&gt;
against you deleting your own code.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Undo would allow you to try some commands and backtrack if they
don't lead to the right result.&lt;/li&gt;
&lt;li&gt;  A dry run parameter would show you a summary of what a command does
without making actual changes. If git had that, you could
confidently explore commands and preview the effects before applying
them.&lt;/li&gt;
&lt;li&gt;  Finally, a safeguard against deleting code could prompt you with an
extra warning before executing commands like &lt;code&gt;git reset –hard&lt;/code&gt; or
&lt;code&gt;git push –force origin&lt;/code&gt;&lt;sup id="fnref1"&gt;1&lt;/sup&gt;. If all commands that might cause
you to permanently lose your data had a safeguard, you could
experiment more.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because these three features are missing, you can't casually experiment&lt;br&gt;
with git commands unless you want to risk losing code you spent hours&lt;br&gt;
working on.&lt;/p&gt;

&lt;p&gt;In summary,** git forces you to convert commands that make sense to you&lt;br&gt;
into commands that make sense to git, and it punishes you for any&lt;br&gt;
mistake you make**.&lt;/p&gt;

&lt;h2&gt;
  
  
  The way forward: new tools will improve the git user experience.
&lt;/h2&gt;

&lt;p&gt;Despite the user experience issues, git will probably not be replaced by&lt;br&gt;
a new source control system. Instead, new tools on top of git can make&lt;br&gt;
it easier to use by converting commands that make sense to humans into&lt;br&gt;
commands that make sense to git. They will offer us fewer, more&lt;br&gt;
meaningful commands, automatically manage the 4-version model of git and&lt;br&gt;
make experimentation easy and safe.&lt;/p&gt;

&lt;p&gt;Several tools are already out there:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://gitless.com/" rel="noopener noreferrer"&gt;Gitless&lt;/a&gt; &lt;sup id="fnref2"&gt;2&lt;/sup&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://getsturdy.com/" rel="noopener noreferrer"&gt;Sturdy&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/frostming/legit" rel="noopener noreferrer"&gt;legit&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://github.com/martinvonz/jj" rel="noopener noreferrer"&gt;jj&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://sapling-scm.com/" rel="noopener noreferrer"&gt;Sapling&lt;/a&gt;: just opensourced yesterday by Meta&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://www.highflux.io/docs/install" rel="noopener noreferrer"&gt;HighFlux&lt;/a&gt;: our product, currently in beta&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We're focused on improving the git user experience. We'd love to hear&lt;br&gt;
your thoughts:&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.highflux.io/discord" rel="noopener noreferrer"&gt;discuss with us on Discord&lt;/a&gt; or &lt;a href="https://twitter.com/intent/user?screen_name=highflux_io" rel="noopener noreferrer"&gt;follow us on Twitter&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://www.linkedin.com/in/mvogelzang/" rel="noopener noreferrer"&gt;Mathijs&lt;/a&gt; is one of the co-founders of HighFlux.io&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.highflux.io/docs/install" rel="noopener noreferrer"&gt;HighFlux&lt;/a&gt; is a CLI and GUI that incorporates these ideas and is currently in beta.&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.highflux.io/docs/install" rel="noopener noreferrer"&gt;Download now&lt;/a&gt;&lt;/p&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;With an additional parameter to skip the safeguard for automated workflows. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn2"&gt;
&lt;p&gt;We highly recommend reading the research article by the gitless author: "What's wrong with Git? A conceptual design analysis": &lt;a href="https://spderosso.github.io/onward13.pdf" rel="noopener noreferrer"&gt;https://spderosso.github.io/onward13.pdf&lt;/a&gt; ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>git</category>
      <category>ux</category>
    </item>
    <item>
      <title>Git power tool: patch</title>
      <dc:creator>Mathijs Vogelzang</dc:creator>
      <pubDate>Tue, 15 Nov 2022 11:23:10 +0000</pubDate>
      <link>https://dev.to/mathijs81/git-power-tool-patch-2gg</link>
      <guid>https://dev.to/mathijs81/git-power-tool-patch-2gg</guid>
      <description>&lt;p&gt;Git has many tools that you don't normally encounter in day-to-day use.&lt;/p&gt;

&lt;p&gt;One very powerful one I've started using recently is the "patch" flag.&lt;/p&gt;

&lt;p&gt;Say you're working on a branch, and you discover you need something you've already implemented on a different branch. Not the whole change, just a tiny bit (in case you want the whole change, &lt;code&gt;git cherry-pick&lt;/code&gt; or &lt;code&gt;git merge&lt;/code&gt; are more appropriate).&lt;/p&gt;

&lt;p&gt;Instead of manual switching and code-copying, you can use &lt;code&gt;git checkout --patch&lt;/code&gt; (or &lt;code&gt;git checkout -p&lt;/code&gt; for short).&lt;/p&gt;

&lt;p&gt;It works like this:&lt;br&gt;
I'm on branch &lt;code&gt;featureA&lt;/code&gt; and want to copy things from branch &lt;code&gt;featureB&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I execute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git checkout -p featureB
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(If you know which particular file or directory you want to patch, you can also add that as the last argument, like &lt;code&gt;git checkout -p featureB src/my_page.tsx&lt;/code&gt;)&lt;/p&gt;

&lt;p&gt;I now get walked to all parts of the change (called hunks) and get asked if I want to apply them or not:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--z0I_mR-V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7sgp1nsqbzr9jn64wd3e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--z0I_mR-V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7sgp1nsqbzr9jn64wd3e.png" alt="Screenshot of patching with git" width="567" height="244"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Very convenient!&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>productivity</category>
      <category>versioncontrol</category>
    </item>
    <item>
      <title>3 things you have to get used to when learning Rust</title>
      <dc:creator>Mathijs Vogelzang</dc:creator>
      <pubDate>Thu, 10 Nov 2022 10:18:11 +0000</pubDate>
      <link>https://dev.to/mathijs81/3-things-you-have-to-get-used-to-with-rust-eai</link>
      <guid>https://dev.to/mathijs81/3-things-you-have-to-get-used-to-with-rust-eai</guid>
      <description>&lt;p&gt;I've been using Rust for over half a year now. It's an amazing technology. Nevertheless, there are some things that keep tripping me up. The following are the three things that come to mind:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;If statements have no parentheses&lt;/em&gt;&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if language=="Rust" {
  println!("Don't use parentheses!");
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As I frequently switch back and forth still with TypeScript and &lt;br&gt;
Kotlin, I keep having to get used to not typing parentheses for the expression of if statements. And then, when I've been doing &lt;br&gt;
Rust long enough, I have to get used to adding them again when &lt;br&gt;
switching back to TS/Kotlin 😫.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;&lt;code&gt;async&lt;/code&gt; code still needs careful attention&lt;/em&gt;&lt;br&gt;
A big benefit of Rust is that it has the speed of non-garbage collected languages like C/C++ but still has the same memory safety as Java/Python/Go and others. Concurrent programming is also safe; the compiler makes it nearly impossible to create a race condition.&lt;br&gt;
If you start writing &lt;code&gt;async&lt;/code&gt; code, this safety is also not fully there. We ran into issues where an accidentally long-running task was scheduled like&lt;br&gt;
&lt;code&gt;tokio::spawn(async || sync_function_that_sometimes_runs_long())&lt;/code&gt;, and when a couple too many of these tasks got executed, they blocked all tokio functionality from running at all.&lt;br&gt;
The fix is to run these tasks with &lt;code&gt;tokio::spawn_blocking&lt;/code&gt;, but you have to think of that yourself; the compiler doesn't check this for you.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Your target/ dir needs to be occasionally cleaned up&lt;/em&gt;&lt;br&gt;
Rust fills the &lt;code&gt;target&lt;/code&gt; dir with intermediate results, and this directory grows very big quickly. (Multiple GBs for a trivial project, and after more time working on a project, it can easily become 20GB).&lt;br&gt;
My VSCode sometimes stops monitoring files in my workspace because the target dir is so big. (This can be fixed by adding &lt;code&gt;target&lt;/code&gt; to the &lt;code&gt;files.watcherExclude&lt;/code&gt; setting, see &lt;a href="https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-changes-in-this-large-workspace-error-enospc"&gt;this documentation page for more information&lt;/a&gt;).&lt;br&gt;
Even with VSCode ignoring &lt;code&gt;target&lt;/code&gt;, it's still a good idea to clean occasionally. Otherwise, you might run out of disk space if you have more than a handful of Rust projects!&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;What do you think are the biggest gotchas with Rust?&lt;/p&gt;

</description>
      <category>rust</category>
      <category>beginners</category>
    </item>
    <item>
      <title>HighFlux Friday</title>
      <dc:creator>Mathijs Vogelzang</dc:creator>
      <pubDate>Fri, 04 Nov 2022 14:31:29 +0000</pubDate>
      <link>https://dev.to/mathijs81/highflux-friday-4nch</link>
      <guid>https://dev.to/mathijs81/highflux-friday-4nch</guid>
      <description>&lt;p&gt;It's Friday.. best time to try out HighFlux, the smart &amp;amp; automated git client! &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.highflux.io/"&gt;https://www.highflux.io/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>devtools</category>
      <category>tooling</category>
    </item>
    <item>
      <title>Git has 157 commands</title>
      <dc:creator>Mathijs Vogelzang</dc:creator>
      <pubDate>Wed, 02 Nov 2022 22:18:51 +0000</pubDate>
      <link>https://dev.to/mathijs81/git-has-157-commands-41p</link>
      <guid>https://dev.to/mathijs81/git-has-157-commands-41p</guid>
      <description>&lt;p&gt;Git has no fewer than 157 built-in commands. No wonder it's considered hard to learn.&lt;/p&gt;

&lt;p&gt;I've been using Git for &amp;gt; 10 years and there are total surprises for me here.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5auMbk2v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ngfakrobc3prq69ggvwt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5auMbk2v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ngfakrobc3prq69ggvwt.png" alt="Image description" width="880" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Did you know that &lt;code&gt;git instaweb&lt;/code&gt; opens a bare-bones repo viewer in your browser?&lt;/p&gt;

</description>
      <category>git</category>
      <category>ux</category>
    </item>
  </channel>
</rss>
