<?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: Denis Rodionov</title>
    <description>The latest articles on DEV Community by Denis Rodionov (@zunh).</description>
    <link>https://dev.to/zunh</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%2F617494%2F298a896c-601b-4c50-bcdc-9fdf9cda3bdd.jpeg</url>
      <title>DEV Community: Denis Rodionov</title>
      <link>https://dev.to/zunh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zunh"/>
    <language>en</language>
    <item>
      <title>Things I learnt doing a small fuzzy search UI element</title>
      <dc:creator>Denis Rodionov</dc:creator>
      <pubDate>Thu, 06 May 2021 21:49:26 +0000</pubDate>
      <link>https://dev.to/zunh/things-i-learnt-doing-a-small-fuzzy-search-ui-element-1l4a</link>
      <guid>https://dev.to/zunh/things-i-learnt-doing-a-small-fuzzy-search-ui-element-1l4a</guid>
      <description>&lt;p&gt;I added search functionality to &lt;a href="https://opusclassical.net"&gt;Opus Classical&lt;/a&gt;. It was quite simple, but I learnt a few things.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S1OIvue4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rpqkivfjrmkrw9td9rav.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S1OIvue4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rpqkivfjrmkrw9td9rav.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding CORS to &lt;a href="https://saturnframework.org"&gt;Saturn&lt;/a&gt; is pretty straightforward
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight fsharp"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;configureCors&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;CorsPolicyBuilder&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt;
    &lt;span class="n"&gt;builder&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AllowAnyOrigin&lt;/span&gt;&lt;span class="bp"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AllowAnyMethod&lt;/span&gt;&lt;span class="bp"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AllowAnyHeader&lt;/span&gt;&lt;span class="bp"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;ignore&lt;/span&gt;

&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt;
    &lt;span class="n"&gt;application&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// ...&lt;/span&gt;
        &lt;span class="n"&gt;use_cors&lt;/span&gt; &lt;span class="s2"&gt;"All"&lt;/span&gt; &lt;span class="n"&gt;configureCors&lt;/span&gt;
        &lt;span class="c1"&gt;// ...&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;a href="https://svelte.dev"&gt;Svelte&lt;/a&gt; is fantastic for this kind of thing
&lt;/h2&gt;

&lt;p&gt;Choose a node, attach a Svelte component to it. Have reactivity, nice clean syntax and TypeScript.&lt;/p&gt;

&lt;p&gt;5kb of compressed JS bundle is pretty comparable to what I would have had with Vanilla JS and hardly possible with Vue/React/Angular.&lt;/p&gt;

&lt;h2&gt;
  
  
  Postgres &lt;a href="https://www.postgresql.org/docs/13/pgtrgm.html"&gt;trigram&lt;/a&gt; is godly
&lt;/h2&gt;

&lt;p&gt;Do an index:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="n"&gt;idx&lt;/span&gt;
   &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;composers&lt;/span&gt; &lt;span class="k"&gt;USING&lt;/span&gt; &lt;span class="n"&gt;gin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;last_name&lt;/span&gt; &lt;span class="n"&gt;gin_trgm_ops&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make super fast fuzzy search selects:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;select&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;last_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;similarity&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;last_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'beth'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;composers&lt;/span&gt;
&lt;span class="k"&gt;where&lt;/span&gt; &lt;span class="n"&gt;last_name&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="s1"&gt;'beth'&lt;/span&gt;
&lt;span class="k"&gt;order&lt;/span&gt; &lt;span class="k"&gt;by&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="k"&gt;desc&lt;/span&gt;
&lt;span class="k"&gt;limit&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>fsharp</category>
      <category>postgres</category>
      <category>svelte</category>
    </item>
    <item>
      <title>F# Web Backend: Rationale</title>
      <dc:creator>Denis Rodionov</dc:creator>
      <pubDate>Tue, 20 Apr 2021 17:07:15 +0000</pubDate>
      <link>https://dev.to/zunh/f-web-backend-rationale-4lod</link>
      <guid>https://dev.to/zunh/f-web-backend-rationale-4lod</guid>
      <description>&lt;p&gt;F# is an ML-family language on .NET platform. If you are happy with your C#, or Node.js, or PHP, or Python, you don't need F#. You gotta have certain wanderlust to drift away from established mainstream.&lt;/p&gt;

&lt;p&gt;What I consider strong points of F#:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Functional, but not pure. Allows to flexibly opt into mutability and OOP.&lt;/li&gt;
&lt;li&gt;Decent interoperability with .NET platform and C#. All good that there is about modern .NET is available.&lt;/li&gt;
&lt;li&gt;Sophisticated type system, e.g. union types.&lt;/li&gt;
&lt;li&gt;Type inference is phenomenal.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Vs Rust:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Better tooling and ecosystem.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Vs Scala:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Maybe more FP feel, but very close competitor.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>fsharp</category>
    </item>
    <item>
      <title>How to choose programming language for web backend</title>
      <dc:creator>Denis Rodionov</dc:creator>
      <pubDate>Mon, 19 Apr 2021 22:31:38 +0000</pubDate>
      <link>https://dev.to/zunh/how-to-choose-programming-language-for-web-backend-fd3</link>
      <guid>https://dev.to/zunh/how-to-choose-programming-language-for-web-backend-fd3</guid>
      <description>&lt;p&gt;Skip PHP, Python, Ruby, JavaScript and Dart. Try different, try better.&lt;/p&gt;

&lt;p&gt;Choose Elixir or Clojure if you like dynamic types.&lt;/p&gt;

&lt;p&gt;Take Go if you need cheap, fast, minimalistic, effective.&lt;/p&gt;

&lt;p&gt;Choose Rust if you care about memory, performance and language being beautiful.&lt;/p&gt;

&lt;p&gt;Skip Java. Choose Scala if you want everything from OOP and FP worlds. Choose Kotlin if you like JVM, want better Java and don't have the guts for Scala.&lt;/p&gt;

&lt;p&gt;Skip Swift. Well, choose it if you are an iOS dev.&lt;/p&gt;

&lt;p&gt;Choose C# if you want the balance. Choose F# if you liked the balance of modern .NET, but want more than C#.&lt;/p&gt;

&lt;p&gt;Choose TypeScript if you really need some kind of unified codebase with frontend.&lt;/p&gt;

&lt;p&gt;I haven't tried OCaml, Haskell, Crystal, or Nim.&lt;/p&gt;

&lt;p&gt;I chose C#/F#.&lt;/p&gt;

</description>
      <category>fsharp</category>
    </item>
  </channel>
</rss>
