<?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: Debugg</title>
    <description>The latest articles on DEV Community by Debugg (@debugg).</description>
    <link>https://dev.to/debugg</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%2Forganization%2Fprofile_image%2F1866%2Ffcc6fa41-93a1-4251-8c96-ac803529bbc0.png</url>
      <title>DEV Community: Debugg</title>
      <link>https://dev.to/debugg</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/debugg"/>
    <language>en</language>
    <item>
      <title>Debugging story of the week: Cargo refused to build my project - A Rust debugging story!</title>
      <dc:creator>Syed Faraaz Ahmad</dc:creator>
      <pubDate>Sat, 29 Feb 2020 08:38:35 +0000</pubDate>
      <link>https://dev.to/debugg/debugging-story-of-the-week-cargo-refused-to-build-my-project-a-rust-debugging-story-4aol</link>
      <guid>https://dev.to/debugg/debugging-story-of-the-week-cargo-refused-to-build-my-project-a-rust-debugging-story-4aol</guid>
      <description>&lt;p&gt;This is Debugging Story of the Week. A series where each week I post my favourite Debugging story from the interwebs, and why I think they're interesting. You are most definitely invited to share your debugging story.&lt;/p&gt;

&lt;p&gt;This week it is from Raunak (&lt;a class="mentioned-user" href="https://dev.to/rrampage"&gt;@rrampage&lt;/a&gt;), it's my favourite because it shows how your code can fail to compile even when you've done nothing wrong. You can install the language using the right tools, write the perfect code, use all secure packages that are compatible with each other, and yet your code can fail to compile. His knowledge of compilers and linkers came in handy while debugging and thankfully the &lt;a href="https://doc.rust-lang.org/cargo/reference/"&gt;Cargo Book&lt;/a&gt; had good documentation. If a tool doesn't have proper documentation, it is easy to get lost in guessing where the error could be originating from.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aYMAMljd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://external-preview.redd.it/cYLaCmWIjE17sMtkZCR7NKtcnOtgzkEm-e8QXURcgqM.jpg%3Fauto%3Dwebp%26s%3D9f8f8cecd588a44d932e1e42c5a9f523cb8db315" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aYMAMljd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://external-preview.redd.it/cYLaCmWIjE17sMtkZCR7NKtcnOtgzkEm-e8QXURcgqM.jpg%3Fauto%3Dwebp%26s%3D9f8f8cecd588a44d932e1e42c5a9f523cb8db315" alt="If you want them to RTFM, write a better FM" width="500" height="375"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check out Raunak's story below and tell me what you think.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/rrampage/cargo-refused-to-build-my-project---a-rust-debugging-story-25e9"&gt;https://dev.to/rrampage/cargo-refused-to-build-my-project---a-rust-debugging-story-25e9&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We all have debugging stories where in the end, we might even feel stupid (we all do). I think we should all share these stories with each other, so that when someone comes across a similar problem, they don't have to spend time pulling their hairs out wondering what went wrong.&lt;/p&gt;

&lt;p&gt;So, what's your debugging story?&lt;/p&gt;

</description>
      <category>debugging</category>
      <category>story</category>
      <category>discuss</category>
      <category>rust</category>
    </item>
    <item>
      <title>The "best" web framework?</title>
      <dc:creator>Syed Faraaz Ahmad</dc:creator>
      <pubDate>Wed, 26 Feb 2020 19:36:48 +0000</pubDate>
      <link>https://dev.to/debugg/the-best-web-framework-1e90</link>
      <guid>https://dev.to/debugg/the-best-web-framework-1e90</guid>
      <description>&lt;p&gt;&lt;em&gt;What is the best web framework to learn?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This is a common question among people just starting out in the field of web development. As a beginner, it is easy to assume that there is probably one major framework that everyone uses. Learning this framework would be enough to quickly land you a job, right?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/SVgKToBLI6S6DUye1Y/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/SVgKToBLI6S6DUye1Y/giphy.gif" alt="Well yes, but actually no"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In my opinion, there is no "best" web framework. Only one that is best for  the given requirements and constraints. &lt;/p&gt;

&lt;p&gt;What do you think?&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>framework</category>
      <category>javascript</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Building a web server in Golang</title>
      <dc:creator>Syed Faraaz Ahmad</dc:creator>
      <pubDate>Mon, 10 Feb 2020 14:54:33 +0000</pubDate>
      <link>https://dev.to/debugg/building-a-web-server-in-golang-4kje</link>
      <guid>https://dev.to/debugg/building-a-web-server-in-golang-4kje</guid>
      <description>&lt;p&gt;&lt;em&gt;This post is a solution to the "Adam doesn't know routing" problem on Debugg. Visit Debugg at &lt;a href="https://debugg.me"&gt;https://debugg.me&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;What we need here is a simple web server and one route, the &lt;code&gt;/&lt;/code&gt; or "root" route, let's say.&lt;/p&gt;

&lt;p&gt;There's a built-in package called &lt;code&gt;net/http&lt;/code&gt; that can help us here. Open the &lt;code&gt;main.go&lt;/code&gt; file, and import the package.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// main.go&lt;/span&gt;

&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s"&gt;"net/http"&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&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;The official documentation of the package shows &lt;a href="https://golang.org/pkg/net/http/#example_ListenAndServe"&gt;an example&lt;/a&gt; for the function &lt;code&gt;ListenAndServe&lt;/code&gt;, which is just what we need.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// main.go&lt;/span&gt;

&lt;span class="o"&gt;...&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ListenAndServe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;":8080"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;nil&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;which will start an http server on port 8080. Now we need to return "Hello, world!" on the root route. For this we use a &lt;a href="https://golang.org/pkg/net/http/#HandleFunc"&gt;&lt;code&gt;HandleFunc&lt;/code&gt;&lt;/a&gt; and pass it the route path and the handler function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// main.go&lt;/span&gt;

&lt;span class="o"&gt;...&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;helloHandler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ResponseWriter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HandleFunc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;helloHandler&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ListenAndServe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;":8080"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;nil&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;to return "Hello, World!", we invoke &lt;code&gt;io.WriteString&lt;/code&gt; by passing in the &lt;code&gt;ResponseWriter&lt;/code&gt; instance and "Hello, World!".&lt;/p&gt;

&lt;p&gt;The final file looks as follows&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s"&gt;"io"&lt;/span&gt;
    &lt;span class="s"&gt;"log"&lt;/span&gt;
    &lt;span class="s"&gt;"net/http"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;helloHandler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ResponseWriter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;WriteString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Hello, World!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HandleFunc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;helloHandler&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Fatal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ListenAndServe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;":8080"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;nil&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;Visit Debugg at &lt;a href="https://debugg.me"&gt;https://debugg.me&lt;/a&gt;&lt;/p&gt;

</description>
      <category>go</category>
      <category>webdev</category>
      <category>routing</category>
    </item>
  </channel>
</rss>
