<?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: Sphere</title>
    <description>The latest articles on DEV Community by Sphere (@codingwithsphere).</description>
    <link>https://dev.to/codingwithsphere</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%2F1305015%2F9b657349-e8fc-4b71-a3d9-c0ae4f77e452.png</url>
      <title>DEV Community: Sphere</title>
      <link>https://dev.to/codingwithsphere</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/codingwithsphere"/>
    <language>en</language>
    <item>
      <title>Neovim Tips to Accelerate Your Text Navigation</title>
      <dc:creator>Sphere</dc:creator>
      <pubDate>Sun, 16 Feb 2025 20:28:50 +0000</pubDate>
      <link>https://dev.to/codingwithsphere/neovim-tips-to-accelerate-your-text-navigation-3p8f</link>
      <guid>https://dev.to/codingwithsphere/neovim-tips-to-accelerate-your-text-navigation-3p8f</guid>
      <description>&lt;p&gt;Neovim has endless shortcuts and features. Even with a grasp on the basics, it can be difficult to really get a grasp on the hidden power of the editor. Here, my goal is to provide some tips that I believe are game changers when it comes to navigating text efficiently.&lt;/p&gt;

&lt;p&gt;This is meant for individuals that are past the initial setup phase. You should have a decent understanding of how the configuration system works, and know about some of the basic shortcuts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stop Using &lt;code&gt;hjkl&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;No, you don't have to &lt;em&gt;completely&lt;/em&gt; stop using &lt;code&gt;hjkl&lt;/code&gt;. They have their uses. For example, if you are one line above or below, &lt;code&gt;j&lt;/code&gt; and &lt;code&gt;k&lt;/code&gt; make sense. If you are one character to the left or right, you could use &lt;code&gt;h&lt;/code&gt; or &lt;code&gt;l&lt;/code&gt;. However, in any other situation &lt;code&gt;hjkl&lt;/code&gt; are inefficient.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Should I Use Instead of h and l?
&lt;/h2&gt;

&lt;p&gt;h and l can be replaced with &lt;code&gt;w&lt;/code&gt;, &lt;code&gt;b&lt;/code&gt;, and &lt;code&gt;e&lt;/code&gt;. These three commands can almost fully replace moving left and right by one character. Traversing a line horizontally is significantly more efficient. Take this example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight zig"&gt;&lt;code&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Bar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Bar&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;init&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="c"&gt;//    ˘          ⦿&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You are at the &lt;code&gt;f&lt;/code&gt; in &lt;code&gt;foo&lt;/code&gt;, and you want to get to the &lt;code&gt;B&lt;/code&gt; in &lt;code&gt;Bar&lt;/code&gt;. Normally, you'd have to type &lt;code&gt;l&lt;/code&gt; eleven times! Instead, using &lt;code&gt;w&lt;/code&gt;, you can get there in 4.&lt;/p&gt;

&lt;p&gt;We can do better, though. There exists &lt;code&gt;W&lt;/code&gt;, &lt;code&gt;B&lt;/code&gt;, and &lt;code&gt;E&lt;/code&gt;, which act similar to their respective lowercase keybindings, with one main difference. Instead of qualifying a word as a group of continuous characters not interrupted by symbols or white space, the capital versions treat every character that isn't white space as one word. This means that &lt;code&gt;foo:&lt;/code&gt; is considered one word. Now, we can make it to "Bar" in just three key presses!&lt;/p&gt;

&lt;p&gt;Anything beyond this can be a bit unreliable. We &lt;em&gt;could&lt;/em&gt; use the &lt;code&gt;f&lt;/code&gt; command followed by &lt;code&gt;B&lt;/code&gt; to jump to the first occurrence of &lt;code&gt;B&lt;/code&gt;, and then press &lt;code&gt;;&lt;/code&gt; to go to the desired one. This is very useful, but is not really a huge improvement, as it still takes three key presses to get to the target.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using a Plugin for Ultimate Speed
&lt;/h2&gt;

&lt;p&gt;In the previous example, where the target is on the same line, it makes total sense to use &lt;code&gt;W&lt;/code&gt; or &lt;code&gt;f&lt;/code&gt;. However, this is not always the case. Take this example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight zig"&gt;&lt;code&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Bar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Bar&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;init&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="c"&gt;//    ˘&lt;/span&gt;
&lt;span class="k"&gt;defer&lt;/span&gt; &lt;span class="n"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;deinit&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="n"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;baz&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hasBar&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;doSomethingAwesome&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arg1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;arg2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;arg3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c"&gt;//                                   ⦿&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we are at the &lt;code&gt;f&lt;/code&gt; in &lt;code&gt;foo&lt;/code&gt; and we want to get to the &lt;code&gt;a&lt;/code&gt; in &lt;code&gt;arg3&lt;/code&gt;. This is offset in two dimensions, making it difficult to determine the best way to get there.&lt;/p&gt;

&lt;p&gt;We could just directly search up the argument with &lt;code&gt;/&lt;/code&gt; followed by &lt;code&gt;arg3&lt;/code&gt;. This works, but isn't very precise. If &lt;code&gt;arg3&lt;/code&gt; was used anywhere between the cursor and that target location, it would jump there first.&lt;/p&gt;

&lt;p&gt;We can utilize &lt;a href="https://github.com/folke/flash.nvim" rel="noopener noreferrer"&gt;flash.nvim&lt;/a&gt; to help us out here. Instead of searching or spamming &lt;code&gt;j&lt;/code&gt; and &lt;code&gt;l&lt;/code&gt;, we can press one keybinding (in my case, &lt;code&gt;zk&lt;/code&gt;), and then press the target character. We then get a jump list next to every occurrence of &lt;code&gt;a&lt;/code&gt; on the screen, giving us a unique key to press to instantly teleport to the target location. This allows us to make it to the target in four key presses, despite being in a completely arbitrary location. It can be three as well, I just ran out of one-letter keybinding space.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Replace &lt;code&gt;j&lt;/code&gt; and &lt;code&gt;k&lt;/code&gt;?
&lt;/h2&gt;

&lt;p&gt;Now honestly, &lt;code&gt;j&lt;/code&gt; and &lt;code&gt;k&lt;/code&gt; have a lot more practicality than &lt;code&gt;h&lt;/code&gt; and &lt;code&gt;l&lt;/code&gt;. Jumping up and down by one line is extremely common. So, don't completely throw away the muscle memory...&lt;/p&gt;

&lt;p&gt;However, if there are large jumps &amp;gt; 2 lines, maybe there is a better approach. I'd like to tell you I used numbered jumps like &lt;code&gt;3j&lt;/code&gt;, but that isn't true most of the time. Even though I have relative line numbers enabled, I find that looking to the left at the numbers pulls me out of a productive state. There must be some way to jump large blocks of text without having to look away from the text...&lt;/p&gt;

&lt;p&gt;In situations where the target line is &lt;em&gt;not&lt;/em&gt; visible, I like to use &lt;code&gt;&amp;lt;C-u&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;C-d&amp;gt;&lt;/code&gt;. These commands, which go up half a page and down half a page respectively, are extremely useful when I need to rapidly travel up and down a page.&lt;/p&gt;

&lt;p&gt;If a target line is known and visible, I'll use a variety of techniques. If the location is near a &lt;code&gt;(&lt;/code&gt; or any unique, easy to press character, I'll just use &lt;code&gt;f&lt;/code&gt; followed by the character. Most of the time this works well. In unique situations, I'll use flash.nvim.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;{&lt;/code&gt; and &lt;code&gt;}&lt;/code&gt; are very useful when highlighting or traveling by blocks of code, with some caveats. They travel up and down until the line is white space, which they stop on (and include!). This is great for highlighting entire functions that are visible on the screen. It's not so great for moving through code precisely. If you've worked on any code base with more than one developer, you'd know that spacing is dangerously optional. Some people don't even put spaces between their functions!!! In a code base like this, &lt;code&gt;{&lt;/code&gt; and &lt;code&gt;}&lt;/code&gt; become non-deterministic.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;ciw&lt;/code&gt;, &lt;code&gt;caw&lt;/code&gt;, etc.
&lt;/h2&gt;

&lt;p&gt;If you didn't know, there is a family of commands for performing an action in and around a text object in nvim. The general form is "". This is really useful in situations where your cursor is not at the beginning of a word, but you need to modify it entirely. It is even &lt;em&gt;more&lt;/em&gt; useful when modifying blocks of code encapsulated in brackets. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight zig"&gt;&lt;code&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="n"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arg1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;i32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;arg2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;u32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;arg3&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Bar&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If I want to change the contents of the arguments, I can just type &lt;code&gt;cib&lt;/code&gt; to remove everything in the arg list and be in insert mode. You don't even have to be inside the brackets, quotes, etc. Nvim will search for the next occurence of the text object and perform the action on that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Telescope.nvim More!
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/nvim-telescope/telescope.nvim" rel="noopener noreferrer"&gt;Telescope.nvim&lt;/a&gt; is extremely popular for navigating between files in Neovim. But that's not all that it can do! Telescope.nvim comes with dozens of builtins that can be extremely useful. My two favorites are &lt;code&gt;lsp_document_symbols&lt;/code&gt; and &lt;code&gt;live_grep&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The first is extremely useful for jumping around a file. If an LSP is setup, it will find functions, type definitions, constants, and lots of other symbols that can then be searched for and jumped to. This is extremely useful, especially in files with over a thousand lines. Jumping to a function becomes trivial, even with so much noise.&lt;/p&gt;

&lt;p&gt;The second is very useful when you can remember a snippet of a function, definition, etc., but don't know what file or where in the file. &lt;code&gt;live_grep&lt;/code&gt; allows you to search across files for a specific pattern. For example, I can search "matrix" in a game engine code base to find every instance where I typed "matrix".&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Marks with Telescope.nvim
&lt;/h2&gt;

&lt;p&gt;Marks are no where near as popular as they should be. I see a lot of beginner tutorials talking about using &lt;code&gt;w&lt;/code&gt;, &lt;code&gt;b&lt;/code&gt;, and &lt;code&gt;e&lt;/code&gt;, and maybe &lt;code&gt;f&lt;/code&gt; and &lt;code&gt;t&lt;/code&gt;, but never marks. When used correctly, they can be absolutely revolutionary to your workflow. Take this example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight zig"&gt;&lt;code&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;Bar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;i32&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c"&gt;// hundreds of lines of code...&lt;/span&gt;

&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="n"&gt;something&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bar&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;Bar&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;bar&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="py"&gt;item&lt;/span&gt; &lt;span class="c"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We are modifying &lt;code&gt;something&lt;/code&gt;, but notice we need to change something with the &lt;code&gt;Bar&lt;/code&gt; struct, which is hundreds of lines away. We can utilize previous shortcuts to jump a half-page up until we reach &lt;code&gt;Bar&lt;/code&gt;, correct our position, and make a modification. Or, we can even using Telescope with &lt;code&gt;lsp_document_symbols&lt;/code&gt; to jump straight to Bar (good idea!). However, neither of these approach are perfectly seamless. Even in the Telescope approach, we have to type in a few characters until we find the bar struct. If this was a longer type like &lt;code&gt;MySuperLongStructName&lt;/code&gt;, it could take even more characters to identify it.&lt;/p&gt;

&lt;p&gt;We can use marks to prevent doing this every time we need to jump back and forth. To make a mark, place a cursor where you want the mark to be, and then press &lt;code&gt;m&lt;/code&gt; followed by a mark identifier. This should be a lower-case character.We can put a mark on &lt;code&gt;Bar&lt;/code&gt; with &lt;code&gt;ma&lt;/code&gt; and a mark on &lt;code&gt;something&lt;/code&gt; with &lt;code&gt;ms&lt;/code&gt;. Then, while we're working on the function, we can press &lt;code&gt;'a&lt;/code&gt; to jump to &lt;code&gt;Bar&lt;/code&gt;, and &lt;code&gt;'s&lt;/code&gt; to jump back. We can even omit the mark on something, and press &lt;code&gt;&amp;lt;C-o&amp;gt;&lt;/code&gt; to jump back to our last location before a jump.&lt;/p&gt;

&lt;p&gt;So, we can setup marks quickly with Telescope, and then use the marks for ultimate speed from then on out. It looks like we've maxed out our navigation speed!&lt;/p&gt;

&lt;h2&gt;
  
  
  Make Custom Snippets
&lt;/h2&gt;

&lt;p&gt;Snippets can massively boost productivity. Most languages have some built-in to the LSP. However, they must be non-intrusive and generic enough that everyone accepts them. Your setup is &lt;em&gt;your&lt;/em&gt; setup, so you can make whatever you want. For example, I created a simple snippet for creating a struct in &lt;a href="https://ziglang.org" rel="noopener noreferrer"&gt;zig&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"stru"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="s2"&gt;"const "&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
        &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="s2"&gt;" = struct {"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
        &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"};"&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
    &lt;span class="p"&gt;}),&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This was made for the &lt;a href="https://github.com/L3MON4D3/LuaSnip" rel="noopener noreferrer"&gt;luasnip&lt;/a&gt; plugin, which is most likely what you are using for snippets. It allows me to autocomplete "stru" with a skeleton struct implementation, that gives me convenience points to insert content and tab through.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create Your Own Plugins/Utilities
&lt;/h2&gt;

&lt;p&gt;Plugins are not mystical pieces of software that take an experienced wizard to create--quite the opposite actually. Neovim uses lua because it enables more people to write a plugin than with the harder to use "VimScript" in vim. You can and should make plugins for your own needs.&lt;/p&gt;

&lt;p&gt;No one knows you as well as you do. So, go make the thing you always dreamed of having in an editor!&lt;/p&gt;

</description>
      <category>neovim</category>
      <category>vim</category>
      <category>terminal</category>
    </item>
    <item>
      <title>Rust has Reignited My Love for Programming</title>
      <dc:creator>Sphere</dc:creator>
      <pubDate>Thu, 28 Mar 2024 23:29:20 +0000</pubDate>
      <link>https://dev.to/codingwithsphere/rust-has-reignited-my-love-for-programming-4b8c</link>
      <guid>https://dev.to/codingwithsphere/rust-has-reignited-my-love-for-programming-4b8c</guid>
      <description>&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;Throughout my programming journey, I've primarily used C++ and Python. C++ is required in college, so most of my non-webdev projects are written with it. Python, on the other hand, is a language for when I'm struggling to get something working in C++. GUI, for example, is infinitely easier in python. If I want to write a desktop app for a CLI tool, I could write one 100x faster in Python with something like &lt;a href="https://docs.python.org/3/library/tkinter.html" rel="noopener noreferrer"&gt;tkinter&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;With C++, I found myself struggling with build systems more than actually coding (Yes I've tried CMake). Call this a skill issue, but the lack of a package manager makes writing fun side projects between university classes a huge pain.&lt;/p&gt;

&lt;p&gt;Additionally, C++ is pretty hard to make cross-platform (in my experience). It seems like every library I tried using for desktop app development/game development had some quirk on Mac/Windows that made it very difficult to work with. Since I primarily use Windows, but my non-coder friends use Mac, I couldn't even get good feedback on my projects. I understand this is a product of Apple and its "walled garden", but that does not eliminate the problem.&lt;/p&gt;

&lt;p&gt;This brings us to Python, my favorite language for hacking something together in an unreasonably short amount of time.&lt;/p&gt;

&lt;p&gt;Python is really easy. Python is cross platform. Python's package manager is awesome. There is a lot to love about python. Why not just write everything in Python? I think you can predict the answer...&lt;/p&gt;

&lt;p&gt;Python's speed is a huge issue for complex apps and games. An interesting result of this is that I find myself over-optimizing an app while writing it, because even small apps are visibly slower than a compiled program in C++.&lt;/p&gt;

&lt;p&gt;I like types. Types are awesome. Whenever I write python, I &lt;em&gt;always&lt;/em&gt; use explicit type hinting. However, I know that they aren't strict, which means weird behavior can still happen at times. I find that when I write Python I try to act as if it isn't Python. I'm trying to make the language something it is not.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding Rust
&lt;/h2&gt;

&lt;p&gt;I ran into a roadblock in my journey of learning to code. I kept finding issues that would completely derail development. My mountain of unfinished projects was piling higher and higher. I started thinking about alternatives that would solve my problems.&lt;/p&gt;

&lt;p&gt;I wanted a language that has these features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Package manager&lt;/li&gt;
&lt;li&gt;Speed&lt;/li&gt;
&lt;li&gt;Strong type system&lt;/li&gt;
&lt;li&gt;Memory Safe&lt;/li&gt;
&lt;li&gt;Cross platform tools&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I've known about Rust for a couple years, but never thought about giving it a try. I had seen snippets of it on YouTube videos. The syntax looked completely alien to me. The strict compiler scared me. It took almost 2 years of watching from the sidelines for me to finally try it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Rust
&lt;/h2&gt;

&lt;p&gt;Learning Rust was intense. I basically dedicated every second of free time to the language in order to grasp its quirks. After getting over that hurtle though, I found that I am extremely productive with it.&lt;/p&gt;

&lt;p&gt;Initially, fighting the compiler meant that programs would take a &lt;em&gt;lot&lt;/em&gt; longer to write in Rust than Python and even C++. However, once the program compiles, it &lt;em&gt;will&lt;/em&gt; work. There is no random crashing. There is no silently failing without an error. The errors are not 200 lines of cryptic text. Contrary to what many people say, I find that I get things done &lt;em&gt;quicker&lt;/em&gt; in Rust than other languages.&lt;/p&gt;

&lt;p&gt;Rust has made me a better programmer. Most of my programming knowledge is self-taught. This means that my old programs are not up to standards as far as being robust and secure. For example, whenever I wrote games with OpenGL, I didn't really handle errors. At most I would add print statements, but that's about it. This is a fault of me, not the languages I use; but they allow it. Rust on the other hand, requires that I handle errors and None values. Assuming I don't just throw around &lt;code&gt;unwrap&lt;/code&gt;, my programs will follow proper error handling practices, drastically improving the safety and readability of my programs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Caution
&lt;/h2&gt;

&lt;p&gt;This is &lt;strong&gt;not&lt;/strong&gt; a diss to C++ and Python. I still love them dearly; and I use them both almost daily. I completely understand that a lot of my issues with C++ and Python come from a lack of experience (I've been coding for ~2 years). I just thought sharing my experience might help others experiencing similar issues. Rust may not be everyone's solution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Rust has reignited my initial love for programming that I found in high school. I find myself writing in other languages, wishing I had errors as values or Rust's enums. Rust gives me confidence that I am writing at least safe code, and possibly even good code. It might seem like a cop out to run to a new language to solve my problems, but I don't care. Rust worked for me.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>programming</category>
      <category>gui</category>
    </item>
  </channel>
</rss>
