<?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: Samarth Gupta</title>
    <description>The latest articles on DEV Community by Samarth Gupta (@livesamarthgupta).</description>
    <link>https://dev.to/livesamarthgupta</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%2F498920%2F5b73b376-a25c-49c6-b7d8-cd694031c26c.jpeg</url>
      <title>DEV Community: Samarth Gupta</title>
      <link>https://dev.to/livesamarthgupta</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/livesamarthgupta"/>
    <language>en</language>
    <item>
      <title>Ultimate Backend Roadmap 2022</title>
      <dc:creator>Samarth Gupta</dc:creator>
      <pubDate>Sun, 21 Nov 2021 12:43:13 +0000</pubDate>
      <link>https://dev.to/livesamarthgupta/backend-skillset-roadmap-4d5i</link>
      <guid>https://dev.to/livesamarthgupta/backend-skillset-roadmap-4d5i</guid>
      <description>&lt;h1&gt;
  
  
  Hey There,
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Are you a Java developer, or a Python developer, or maybe Golang developer?&lt;/strong&gt;&lt;br&gt;
Well, whoever you are, we all face the same set of problems in our backend, just our language of choice is different in solving those problems. But one may think how to grow, not just in particular technology but as an engineer in a whole. So I present the &lt;a href="https://whimsical.com/backend-dev-3UYBHbZzFYjmZbPToLxJje"&gt;Backend Skillset Roadmap&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;This roadmap is language agnostic and could be thought of as a checklist instead of a roadmap. You don't need to learn things serially, one can progress through each parallelly.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;P.S: Don't be Jack of all and Master of none.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>beginners</category>
      <category>devjournal</category>
      <category>programming</category>
    </item>
    <item>
      <title>Java Backend Roadmap</title>
      <dc:creator>Samarth Gupta</dc:creator>
      <pubDate>Wed, 20 Oct 2021 04:17:15 +0000</pubDate>
      <link>https://dev.to/livesamarthgupta/java-backend-roadmap-17ko</link>
      <guid>https://dev.to/livesamarthgupta/java-backend-roadmap-17ko</guid>
      <description>&lt;h3&gt;
  
  
  Hi You all,
&lt;/h3&gt;

&lt;p&gt;I created a perfect Java Roadmap for Backend Engineering. &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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwqib9qzmnql855obokbo.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwqib9qzmnql855obokbo.png" alt="Part-I"&gt;&lt;/a&gt;&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5lj6r1uaz67ojfgsv854.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5lj6r1uaz67ojfgsv854.png" alt="Part-II"&gt;&lt;/a&gt;&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2op60lpumczpsoxuzngn.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2op60lpumczpsoxuzngn.png" alt="Part-III"&gt;&lt;/a&gt;&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3zzv9szvm1m637nu06xj.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3zzv9szvm1m637nu06xj.png" alt="Part-IV"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nh0r03an88whzc6onzcp.png" rel="noopener noreferrer"&gt;Download Roadmap&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also check my &lt;a href="https://dev.to/livesamarthgupta/spring-learning-plan-8p9"&gt;Spring Learning Path&lt;/a&gt; to learn Spring.&lt;br&gt;
&lt;a href="https://guptasamarth.netlify.app/" rel="noopener noreferrer"&gt;Follow Me Here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Golang for Experienced Developers - Part III</title>
      <dc:creator>Samarth Gupta</dc:creator>
      <pubDate>Sun, 03 Oct 2021 15:14:54 +0000</pubDate>
      <link>https://dev.to/livesamarthgupta/golang-for-experienced-developers-part-iii-3d92</link>
      <guid>https://dev.to/livesamarthgupta/golang-for-experienced-developers-part-iii-3d92</guid>
      <description>&lt;h3&gt;
  
  
  Hi, I'm back
&lt;/h3&gt;

&lt;p&gt;This is the third part of Golang tutorial series, if you haven't checked out the first &amp;amp; second parts, do check it out &lt;a href="https://dev.to/livesamarthgupta/golang-for-experienced-developers-5bba"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Control Constructs in Go
&lt;/h2&gt;

&lt;p&gt;Go provides following statements for controlling the program flow:&lt;/p&gt;

&lt;h3&gt;
  
  
  If statement
&lt;/h3&gt;

&lt;h6&gt;
  
  
  Syntax:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Regular if
if condition {
    ...
}

// Initialised if
if initialisation; condition {
    ...
}

// if-else
if condition {
    ...
} else {
    ...
}

if condition1 {
    ...
} else if condition2 {
    ...
} else {
    ...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  Points to remember:
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;Go provides two syntaxes for &lt;code&gt;if&lt;/code&gt; statements, one with initialisation &amp;amp; one without initialisation.&lt;/li&gt;
&lt;li&gt;Braces are mandatory, even for one line.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;{&lt;/code&gt; (opening brace) after the &lt;code&gt;if&lt;/code&gt; and &lt;code&gt;else&lt;/code&gt; must be on the same line.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;else if&lt;/code&gt; and &lt;code&gt;else&lt;/code&gt; must be on same line as &lt;code&gt;}&lt;/code&gt; (closing brace).&lt;/li&gt;
&lt;li&gt;Can use parentheses for composite expressions with &amp;amp;&amp;amp;, ||, !&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;;&lt;/code&gt; after &lt;code&gt;initialisation&lt;/code&gt; is required.&lt;/li&gt;
&lt;li&gt;Use local assignments (&lt;code&gt;:=&lt;/code&gt;) for &lt;code&gt;initialisation&lt;/code&gt; in initialised if statements.&lt;/li&gt;
&lt;li&gt;Scope of initialisation variable is known only within &lt;code&gt;if&lt;/code&gt; statement.&lt;/li&gt;
&lt;li&gt;Can also invoke functions to initialise variable in the initialised if statements.&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Example:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package main
import ("fmt"; "runtime")

func main() {
    if platform := runtime.GOOS; platform == "linux" { // fetch os info 
      fmt.Println("linux platform")
    } else if platform  == "darwin" {
      fmt.Println("darwin platform")
    } else {
      fmt.Println("windows platform")
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Switch Statement
&lt;/h3&gt;

&lt;h6&gt;
  
  
  Syntax:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Regular switch
switch variable {
    case val1:
        ...
    case val2:
        ...
    default:
        ...
}

// Initialised switch 
switch initialisation; variable {
    case val1:
        ...
    case val2:
        ...
    default:
        ...
}

// Tag-less switch
switch {
    case boolexpr1:
        ...
    case boolexp2:
        ...
    default:
        ...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  Points to remember:
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;Go provides three syntaxes for &lt;code&gt;switch&lt;/code&gt; statement.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;{&lt;/code&gt; (opening brace) must be on the same line as the &lt;code&gt;switch&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;variable&lt;/code&gt; can be any type.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;val1&lt;/code&gt;, &lt;code&gt;val2&lt;/code&gt; must be of the same type.&lt;/li&gt;
&lt;li&gt;More than one value may appear in a case.&lt;/li&gt;
&lt;li&gt;Breaks from each case are implicit.&lt;/li&gt;
&lt;li&gt;Use keyword &lt;code&gt;fallthrough&lt;/code&gt; to combine &lt;code&gt;case&lt;/code&gt; conditions.&lt;/li&gt;
&lt;li&gt;Braces (&lt;code&gt;{&lt;/code&gt; and &lt;code&gt;}&lt;/code&gt;) are allowed in case for multiple statements.&lt;/li&gt;
&lt;li&gt;Use keyword &lt;code&gt;default&lt;/code&gt; to handle conditions that match no &lt;code&gt;case&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Keyword &lt;code&gt;default&lt;/code&gt; may be placed anywhere in switch.&lt;/li&gt;
&lt;li&gt;In tag-less switch statements, &lt;code&gt;case&lt;/code&gt; statements must evaluate to boolean expressions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Example:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package main
import ("fmt"; "runtime", "os")

func main() {
    switch platform := runtime.GOOS; platform {
        case "linux", "darwin", "windows":   // multiple cases
            fmt.Println("Known OS")
        default:
            fmt.Println("Unknown OS")
     }

    arg := os.Args[1]  // fetch command line argument
    num, _ := strconv.ParseFloat(arg, 64) // string to float64
    var val float64
    switch {
         case num &amp;lt; 0:
             num = -num
             fallthrough   // fallthrough to second case
         case num &amp;gt; 0:
             val = math.Sqrt(num)
         case num == 0:
             val = 0;
    }
    fmt.Println(val)    
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  For statement
&lt;/h3&gt;

&lt;h6&gt;
  
  
  Syntax:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Counter controlled loop
for initialisation; condition; update {
    ...
}

// Condition controlled loop
for condition {
    ...
}

// Range controlled loop
for index, value := range collection {
    ... 
}
for index := range collection {
    ...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  Points to remember:
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;Go provides three syntaxes for &lt;code&gt;for&lt;/code&gt; statement.&lt;/li&gt;
&lt;li&gt;No while or do while statements.&lt;/li&gt;
&lt;li&gt;Braces are mandatory, even for one line.&lt;/li&gt;
&lt;li&gt;Opening brace &lt;code&gt;{&lt;/code&gt; must be on the same line as &lt;code&gt;for&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Surrounding parenthesis after &lt;code&gt;for&lt;/code&gt; are not allowed.&lt;/li&gt;
&lt;li&gt;May assign more than one counter in initialise with commas&lt;/li&gt;
&lt;li&gt;Omitting &lt;code&gt;condition&lt;/code&gt; in a condition controlled loop results in an infinite loop.&lt;/li&gt;
&lt;li&gt;In range controlled loops, &lt;code&gt;collection&lt;/code&gt; is a sequence of items (string, array, map).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;index&lt;/code&gt; is the integer index at each iteration in the loop.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;value&lt;/code&gt; is the item in the collection at each iteration in the loop.&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Example:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package "main"
import "fmt"
import "os"

func main() {
    nargs := len(os.Args)
    // counter controlled
    for i := 1; i &amp;lt; nargs; i++ {
        fmt.Printf("%s ", os.Args[i])
    }

    args1 := os.Args[1:]
    // condition controlled
    for len(args) &amp;gt; 0 {
        fmt.Printf("%s ", args1[0])
        args1 = args1[1:]  // shift left
    }

    args2 := os.Args[1:]
    // range controlled
    for i, arg := range args {
        fmt.Printf("%d %s\n", i, arg)
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Break &amp;amp; Continue Statement
&lt;/h3&gt;

&lt;h6&gt;
  
  
  Break:
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;Used inside a &lt;code&gt;for&lt;/code&gt;, &lt;code&gt;switch&lt;/code&gt;, or &lt;code&gt;select&lt;/code&gt; statement.&lt;/li&gt;
&lt;li&gt;Breaks out of innermost loop in multiple &lt;code&gt;for&lt;/code&gt; statements.&lt;/li&gt;
&lt;li&gt;Can be used with labels.&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Continue:
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;Can only be used in &lt;code&gt;for&lt;/code&gt; statement.&lt;/li&gt;
&lt;li&gt;Continues with the next iteration of innermost loop.&lt;/li&gt;
&lt;li&gt;Skips remaining body of loop.&lt;/li&gt;
&lt;li&gt;Can be used with labels.&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Example:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package main
import "fmt"
func main() {
    for i := 1; i &amp;lt; 25; i++ {
        if i % 2 != 0 { continue }
        if i &amp;gt; 20 { break }
        fmt.Printf("%d ", i)
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;This concludes the third part of the series. In next tutorial we'll cover &lt;code&gt;functions&lt;/code&gt; and more, till then, Aloha.&lt;/p&gt;

&lt;p&gt;Reach out to me &lt;a href="https://guptasamarth.netlify.app/"&gt;here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>go</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>Golang for Experienced Developers - Part II</title>
      <dc:creator>Samarth Gupta</dc:creator>
      <pubDate>Tue, 21 Sep 2021 16:18:23 +0000</pubDate>
      <link>https://dev.to/livesamarthgupta/golang-for-experienced-developers-part-ii-2lj1</link>
      <guid>https://dev.to/livesamarthgupta/golang-for-experienced-developers-part-ii-2lj1</guid>
      <description>&lt;h3&gt;
  
  
  Welcome,
&lt;/h3&gt;

&lt;p&gt;This is the second part of Golang tutorial series, if you haven't checked out the first part, do check it out &lt;a href="https://dev.to/livesamarthgupta/golang-for-experienced-developers-5bba"&gt;here&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Let's continue where we left off...&lt;/p&gt;

&lt;h2&gt;
  
  
  Primitive Data Types in Go
&lt;/h2&gt;

&lt;h6&gt;
  
  
  Syntax:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var variableName type = value
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Following are the types of Primitive Data Types in Go:&lt;/p&gt;

&lt;h3&gt;
  
  
  Boolean
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;code&gt;bool&lt;/code&gt; type represents the set of Boolean truth values denoted by the predeclared constants &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Supported operators are &amp;amp;&amp;amp;, || and !&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;%t&lt;/code&gt; to print booleans. &lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Example:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var flag bool = !(10 &amp;gt; 0 &amp;amp;&amp;amp; 20 &amp;lt; 40)
fmt.Printf("%t\n", flag)  // false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Numeric
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A numeric type represents sets of integer or floating-point values.&lt;/li&gt;
&lt;li&gt;Architecture dependent types determine their size based on the architecture. Architecture independent types have fixed size.&lt;/li&gt;
&lt;li&gt;There is no &lt;code&gt;float&lt;/code&gt; type, only &lt;code&gt;float32&lt;/code&gt; or &lt;code&gt;float64&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Precision of &lt;code&gt;float32&lt;/code&gt; is 7 decimal places.&lt;/li&gt;
&lt;li&gt;Precision of &lt;code&gt;float64&lt;/code&gt; is 15 decimal places.&lt;/li&gt;
&lt;li&gt;There is no implicit type conversion between any data types. i.e. &lt;code&gt;int16&lt;/code&gt; can't be assigned to &lt;code&gt;int32&lt;/code&gt;, to overcome this one must do explicit type conversion.&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Architecture Dependent Types:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uint     either 32 or 64 bits
int      same size as uint
uintptr  an unsigned integer large enough to store the uninterpreted bits of a pointer value
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  Architecture Independent Types:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uint8       the set of all unsigned  8-bit integers (0 to 255)
uint16      the set of all unsigned 16-bit integers (0 to 65535)
uint32      the set of all unsigned 32-bit integers (0 to 4294967295)
uint64      the set of all unsigned 64-bit integers (0 to 18446744073709551615)

int8        the set of all signed  8-bit integers (-128 to 127)
int16       the set of all signed 16-bit integers (-32768 to 32767)
int32       the set of all signed 32-bit integers (-2147483648 to 2147483647)
int64       the set of all signed 64-bit integers (-9223372036854775808 to 9223372036854775807)

float32     the set of all IEEE-754 32-bit floating-point numbers
float64     the set of all IEEE-754 64-bit floating-point numbers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  Explicit Type Conversion:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var val1 int16 = 32
var val2 int32 = int32(val1)   // explicit conversion
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Complex Number
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Go provides a two new data type to store complex numbers which are architecture independent.&lt;/li&gt;
&lt;li&gt;Complex arithmetic is supported.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;complex(real, imaginary)&lt;/code&gt; function to create complex numbers &amp;amp; &lt;code&gt;real()&lt;/code&gt; &amp;amp; &lt;code&gt;imag()&lt;/code&gt; function to extract real &amp;amp; imaginary part.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;%v&lt;/code&gt; to print complex numbers.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;complex64   the set of all complex numbers with float32 real and imaginary parts
complex128  the set of all complex numbers with float64 real and imaginary parts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  Example:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var cp1 = complex(1.2, 2.1)
var cp2 = complex(3.4, 5.8)
fmt.Println(real(cp1), imag(cp2))  // 1.2  5.8
fmt.Printf("%v\n", cp1 + cp2)     // (4.6 + 7.9i)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Character
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;It's a special case of integer type.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;\u(4 hex digit)&lt;/code&gt; or &lt;code&gt;\U(8 hex digits)&lt;/code&gt; for unicode&lt;/li&gt;
&lt;li&gt;User &lt;code&gt;%c&lt;/code&gt; or &lt;code&gt;%U&lt;/code&gt; for printing.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;byte        alias for uint8, for storing ASCII characters
rune        alias for int32, for storing UTF-8 characters
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  Example:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var char1 byte = 65           // ASCII 'A'
var char2 byte = '\x41'       // ASCII 'A'
var char3 rune = '\u0041'     // Unicode 'A'
var char4 rune = '\U00101234' // Unicode
fmt.Printf("%c %U\n", char1, char4)   // A U+1012334
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Pointer
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Pointers are variables that store memory address.&lt;/li&gt;
&lt;li&gt;This is exactly similar to C++ except pointer arithmetic isn't supported in Go.&lt;/li&gt;
&lt;li&gt;Pointer variables are stored in heap and are garbage collected.&lt;/li&gt;
&lt;li&gt;AddressOf(&amp;amp;) and dereference(*) operators act same as C++.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;%p&lt;/code&gt; to print pointers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Syntax:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var identifier *type = address
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  Example:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var num int = 6
var ptr *int = &amp;amp;num
fmt.Printf("%p\n", ptr)    // address of num

*ptr = 20                  // changes num to 20
fmt.Println(num)           // 20

ptr++                      // illegal, pointer arithmetic not supported
const val = 10
ptr = &amp;amp;val                 // illegal, why?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;See &lt;a href="https://stackoverflow.com/questions/35146286/find-address-of-constant-in-go"&gt;this&lt;/a&gt; for why.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  String
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;string&lt;/code&gt; are immutable in Go for the same reason why it's immutable in Java.&lt;/li&gt;
&lt;li&gt;Strings are not null terminated like C/C++.&lt;/li&gt;
&lt;li&gt;Indexing &amp;amp; slicing is allowed.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;len(str)&lt;/code&gt; for string length.&lt;/li&gt;
&lt;li&gt;Can't take address of string character (&amp;amp;str[i] illegal)&lt;/li&gt;
&lt;li&gt;Comparison operators compare bytes.&lt;/li&gt;
&lt;li&gt;Strings are initialised with double quotes or back-ticks.&lt;/li&gt;
&lt;li&gt;Defaults to empty string ("")&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Example:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var str string = "Let's Go"
fmt.Println(len(str))       // 8
var str2 string = "C:\newfolder\text.txt"
fmt.Println(str2)     // C:
                      // ewfolder    ext.txt, bcoz escape sequence

var str3 string = `C:\newfolder\text.txt`   // raw string
fmt.Pritln(str3)     // C:\newfolder\text.txt

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  Concatenation &amp;amp; Update:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var a = "Hello "
var b = "world"
var c = a + b      // Hello world, concatenation
a += b          // Hello world, update but create new object bcoz immutability
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  Indexing:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var str = "hello"
fmt.Printf("%c\n", str[0]) // h
str[0] = 'j'             // illegal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  Slicing:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var str = "hello"
fmt.Println(str[1:4])   // ell, index 1-3
fmt.Println(str[:4])    // hell, index 0-3
fmt.Println(str[1:])    // ello, index 1-end
fmt.Println(str[:])     // hello, index 0-end

fmt.Println(str[-1])    // illegal, but legal in Python
fmt.Println(str[:-1])   // illegal, but legal in Python
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  String Conversions &amp;amp; Functions
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;There are two packages available for string conversions and string functions in Go.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  For string conversion:
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;import "strconv"&lt;/code&gt;&lt;/p&gt;

&lt;h6&gt;
  
  
  Example:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package "main"
import "strconv"
import "fmt"

func main() {
    // string to numeric
    num, _ := strconv.Atoi("1234")
    fmt.Println(num)    // 1234 - int
    fval, _ := strconv.ParseFloat("3.46", 64)  // (str, floatSize)
    fmt.Println(fval)   // 3.46 - float64
    num2, _ := strconv.ParseInt("123", 10, 64) // (str, base, intSize)
    fmt.Println(num2)   // 123 - int64

    // numeric to string
    str1 := strconv.Itoa(789)
    fmt.Println(str1)    // 789 - string
    str2 := strconv.FormatFloat(3.45, 'f', -1, 32)
    fmt.Println(str2)    // 3.45 - string
    str3 := strconv.FormatInt(1234, 10)
    fmt.Println(str3)    // 1234 - string
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  For string functions:
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;import "strings"&lt;/code&gt;&lt;/p&gt;

&lt;h6&gt;
  
  
  Useful Functions:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func Contains(s, substr string) bool
func Count(s, sep string) int
func HasPrefix(s, prefix string) bool
func HasSuffix(s, suffix string) bool
func Index(s, sep string) int
func Join(a []string, sep string) string
func LastIndex(s, sep string) int
func Repeat(s string, count int) string
func Replace(s, old, new string, n int) string
func Split(s, sep string) []string
func ToLower(s string) string
func ToUpper(s string) string
func Trim(s string, cutset string) string
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this, concludes the second part of this tutorial. Next up we have control constructs in Golang. Coming soon...&lt;/p&gt;

</description>
      <category>go</category>
      <category>tutorial</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Spring Learning Path</title>
      <dc:creator>Samarth Gupta</dc:creator>
      <pubDate>Tue, 21 Sep 2021 02:08:57 +0000</pubDate>
      <link>https://dev.to/livesamarthgupta/spring-learning-plan-8p9</link>
      <guid>https://dev.to/livesamarthgupta/spring-learning-plan-8p9</guid>
      <description>&lt;h2&gt;
  
  
  Java is a confusing world.
&lt;/h2&gt;

&lt;p&gt;As a newcomer to Java, have these questions ever popped up in your mind?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is J2SE?&lt;/li&gt;
&lt;li&gt;Okay, I understand J2SE but what is J2EE?&lt;/li&gt;
&lt;li&gt;What is JSF now?&lt;/li&gt;
&lt;li&gt;What is JNDI and what is JNI?&lt;/li&gt;
&lt;li&gt;What is EJBs now?&lt;/li&gt;
&lt;li&gt;What is JMS?&lt;/li&gt;
&lt;li&gt;What is JSR?&lt;/li&gt;
&lt;li&gt;What's JPA?&lt;/li&gt;
&lt;li&gt;and more...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If these questions does boggle your mind sometimes(well, it certainly did to me), you're in the right place. Today I am going to oversimplify Spring learning path for you. This will clarify how Java progressed through time and how Spring came as a de-facto standard in industry. This will also clarify what should you learn in Java world, certainly you can't learn it all. JAVA IS HUGE.&lt;/p&gt;

&lt;p&gt;I will be going through pointers to explain it easily:&lt;/p&gt;

&lt;h6&gt;
  
  
  J2SE
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;Core Java + Concurrency API + Collection API = Java Standard Edition (J2SE)&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  J2EE
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Then comes Java Enterprise Edition (J2EE) which has a set of enterprise features used to develop full-fledged enterprise java applications. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Servlet, JSP, JSF, EJB, JMS, JNDI, JDBC, JavaMail, JTS, JTA, JCA, these all are enterprise features and comes under J2EE.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;J2EE is just some abstract and standardised specifications (APIs) and their implementation is provided by the respective Application Server. Examples of Application Servers are Glassfish, JBoss, Liberty, WebSphere, etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;These abstract specifications are defined using JSR (Java Specification Request) and are implemented by Reference Implementation, for eg. JPA is a JSR and Hibernate is a Reference implementation i.e. JPA defines all annotations and methods signatures &amp;amp; a reference implementation implements underlying code for it. Think interface &amp;amp; class.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Web Server vs Application Server vs Web Container
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;Web servers just serve static content, Application servers provide dynamic content with other functionality like managing EJB pool, facilitating distributed transaction, facilitating application lookup over JNDI, application security, and others. Web containers are just Servlet containers that are only responsible for generating HTML by executing JSP and Servlet on the server-side.&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Spring is here
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Spring is another alternative to J2EE for creating Enterprise applications in Java.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Spring is a framework doing lots of the stuff on the J2EE specifications, but in its own form. They don't follow J2EE specifications and APIs for that. But they do include a web framework, transaction management, security, and several other solutions that J2EE offers.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Spring Learning Plan
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;So start with Spring Core which is relevant to CDI in J2EE. This will teach you dependency injection &amp;amp; inversion of control.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Then move on to Spring-Web/MVC which is equivalent to Servlet/JSPs in J2EE but with more features &amp;amp; support.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Then move on to several Spring Modules which provides different functionality of J2EE. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Important Spring Modules:
&lt;/h6&gt;

&lt;blockquote&gt;
&lt;p&gt;Spring-AOP: Provides cross cutting concerns&lt;br&gt;
Spring-JDBC: Provides JdbcTemplate which removes boilerplate code from JDBC &lt;br&gt;
Spring-ORM: Provides HibernateTemplate which does the same in ORM world&lt;br&gt;
Spring-JMS: Provides messaging.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;After you're done with this and know how spring works, it's time to start learning Springboot, Springboot is opinionated framework and does most of the configuration for you.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's it, this is the oversimplification of Spring Learning Path. If you're a curious Spring learner, I have a new tutorial series coming up to learn spring from scratch. Follow to know more. Comment in case you've any doubts.&lt;/p&gt;

</description>
      <category>spring</category>
      <category>beginners</category>
      <category>java</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Golang for Experienced Developers</title>
      <dc:creator>Samarth Gupta</dc:creator>
      <pubDate>Mon, 20 Sep 2021 15:39:41 +0000</pubDate>
      <link>https://dev.to/livesamarthgupta/golang-for-experienced-developers-5bba</link>
      <guid>https://dev.to/livesamarthgupta/golang-for-experienced-developers-5bba</guid>
      <description>&lt;h3&gt;
  
  
  Hello World,
&lt;/h3&gt;

&lt;p&gt;Today I am going to start a Golang tutorial series. I am an experienced Java Developer however my job required me to learn Golang so I will be documenting my learning journey in a structured format. In this series, we'll go from absolute basics to somewhat intermediate in Golang. This is the first place you should start if you have just heard of the name "Golang" but never got a chance to learn it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Go: Pros &amp;amp; Cons
&lt;/h2&gt;

&lt;p&gt;Suppose C++, Java &amp;amp; Python had a child, they named it Go and so it inherits features from each one of these languages. Here are some of them:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;C-like Syntax, therefore Concise &amp;amp; Clean&lt;/li&gt;
&lt;li&gt;Garbage Collection, therefore Memory Safety&lt;/li&gt;
&lt;li&gt;Package Model, therefore Faster Builds
&lt;/li&gt;
&lt;li&gt;Statically Typed, therefore Type Safety&lt;/li&gt;
&lt;li&gt;Free &amp;amp; Open Source, therefore More Support&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Here is What Go Lacks?&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;No overloading of functions &amp;amp; operators&lt;/li&gt;
&lt;li&gt;No classes &amp;amp; inheritance&lt;/li&gt;
&lt;li&gt;No exception handling &lt;/li&gt;
&lt;li&gt;No support for pointer arithmetic&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After reading these counter statements you might be wondering why would someone go with Go(pun intended), check &lt;a href="https://blog.astradot.com/why-we-moved-from-kotlin-spring-boot-to-go/"&gt;this&lt;/a&gt; &amp;amp; &lt;a href="https://faun.pub/building-enterprise-grade-microservice-using-go-golang-51a4e27ed199"&gt;this&lt;/a&gt; out and you will know why.&lt;/p&gt;




&lt;h2&gt;
  
  
  Let's "Go" to First Program
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package main
import "fmt"

func main() {
    fmt.Println("Hello World!");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  Points to remember:
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;main&lt;/code&gt; is the first function that gets executed, similar to any other programming language.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;fmt&lt;/code&gt; is a format library in-built in Go, it's used for formatted printing &amp;amp; more.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;import&lt;/code&gt; statement is used to import external libraries in Go, like Java.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;package&lt;/code&gt; is used for modularisation of Go programs, like Java.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Go Run &amp;amp; Go Build
&lt;/h3&gt;

&lt;p&gt;Now it's time to build &amp;amp; run the program we just wrote, for this purpose we need to make sure we have Go installed in our system, you can refer &lt;a href="https://golang.org/doc/install"&gt;this&lt;/a&gt; to install Go in your system.&lt;/p&gt;

&lt;h6&gt;
  
  
  Building Go Programs
&lt;/h6&gt;

&lt;blockquote&gt;
&lt;p&gt;$ go build main.go &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This command will build your Go program into system native executable named same as your program file name (main.go), you can run the executable directly by calling the executable (main).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;$ go build -ldflags "-s -w" main.go&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The ldflags stand for linker flags, it passes flags to underlying Go toolchain linker. The flags &lt;code&gt;-s&lt;/code&gt; &amp;amp; &lt;code&gt;-w&lt;/code&gt; will disable creation of symbol tables for the compiler and hence reduce down the size of the executable. &lt;/p&gt;

&lt;h6&gt;
  
  
  Running Go Programs
&lt;/h6&gt;

&lt;blockquote&gt;
&lt;p&gt;$ go run main.go   &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This command will first build your Go program in system temp location &amp;amp; run it to show the output, once the run is completed, the build is discarded. In other words, this will simply run your Go program.&lt;/p&gt;




&lt;h2&gt;
  
  
  How Does Go Work?
&lt;/h2&gt;

&lt;p&gt;Go programs doesn't require a VM to run like how Java runs on JVM, Go compiles the program into native executables that are specific to the system therefore Go doesn't support platform independence. However the load falls on the developer to build executables for Windows, Linux &amp;amp; Darwin systems.&lt;/p&gt;




&lt;h2&gt;
  
  
  Basics
&lt;/h2&gt;

&lt;p&gt;Any Go program consists of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keywords&lt;/li&gt;
&lt;li&gt;Identifiers&lt;/li&gt;
&lt;li&gt;Data Types&lt;/li&gt;
&lt;li&gt;Constants&lt;/li&gt;
&lt;li&gt;Variables&lt;/li&gt;
&lt;li&gt;Operators &lt;/li&gt;
&lt;li&gt;Functions&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Keywords
&lt;/h3&gt;

&lt;p&gt;The following keywords are reserved and may not be used as identifiers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;break        default      func         interface    select
case         defer        go           map          struct
chan         else         goto         package      switch
const        fallthrough  if           range        type
continue     for          import       return       var
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Identifiers
&lt;/h3&gt;

&lt;p&gt;Identifiers name program entities such as variables and types.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An identifier is a sequence of one or more letters and digits.&lt;/li&gt;
&lt;li&gt;The first character in an identifier must be a letter.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some identifiers are predeclared.&lt;/p&gt;

&lt;h6&gt;
  
  
  Predeclared Identifiers:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Types:
       bool byte complex64 complex128 error float32 
       float64 int int8 int16 int32 int64 rune 
       string uint uint8 uint16 uint32 uint64 uintptr

Constants:
       true false iota

Zero value:
       nil _

Functions:
       append cap close complex copy delete imag len
       make new panic print println real recover
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Data Types
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Primitives: 
           int, complex, float, bool, string
Structured:
           struct, array, slice, map, channel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;NOTE: We'll cover each data type in further tutorials.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Constants
&lt;/h3&gt;

&lt;p&gt;The syntax to define a constant in Go is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const identifier type = value
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  Points to remember:
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;Constants must be evaluated at compile time.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;type&lt;/code&gt; is optional as compiler will guess the type based on value at compile time.&lt;/li&gt;
&lt;li&gt;Applies only to primitive data types.&lt;/li&gt;
&lt;li&gt;Can be enumerated with &lt;code&gt;iota&lt;/code&gt; identifier.&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Examples:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const c1 = "this is a constant string." // type is optional

const c2 float32 = 5/6. // period(.) at the end tells compiler to do float arithmetic instead of integer arithmetic.

const billion = 1e9 // possible

const funcValue = funcThatReturnValue()   // compile time error, why? 

const(one, two = 1, 2) // can combine various constant initialisation into once

const (           // using iota for enumeration
    zero = iota   // 0
    one           // 1
    two           // 3
    three         // 4
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Variables
&lt;/h3&gt;

&lt;p&gt;The syntax to define a variable in Go is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var identifier type = value
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  Points to remember:
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;If &lt;code&gt;value&lt;/code&gt; is not supplied, &lt;code&gt;type&lt;/code&gt; is required.&lt;/li&gt;
&lt;li&gt;If &lt;code&gt;type&lt;/code&gt; is not supplied, &lt;code&gt;value&lt;/code&gt; is required.&lt;/li&gt;
&lt;li&gt;Variables are always initialised to default values (0 or nil).&lt;/li&gt;
&lt;li&gt;Variables declared inside functions have local scope.&lt;/li&gt;
&lt;li&gt;Variables declared outside functions have global scope(package scope).&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Examples:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var variable1 int   // syntactically ok

var variable2       // missing value &amp;amp; type, compile time error

var value = 3.48    // ok, defaults to float64 type

var isSet bool = false  // ok

var (                  // can combine various variable declaration into once
    radius int
    isSet bool
    name string
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Operators:
&lt;/h3&gt;

&lt;p&gt;Following is the list of operators &amp;amp; delimiters in Go:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-    |    +    &amp;amp;    *    ^    /    &amp;lt;&amp;lt;    /=    &amp;lt;&amp;lt;=    ++    =
%    &amp;gt;&amp;gt;    %=    &amp;gt;&amp;gt;=    --    !    &amp;amp;^    &amp;amp;^=    +=    &amp;amp;=    -= |=    *=    ^=    &amp;amp;&amp;amp;    ==    !=    (    )    ||    &amp;lt;    &amp;lt;-   
&amp;gt;    &amp;lt;=    [    ]    &amp;gt;=    {    }    :=    ,    ;  ...    .  :
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  Operator Precedence:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Precedence    Operator
    5             *  /  %  &amp;lt;&amp;lt;  &amp;gt;&amp;gt;  &amp;amp;  &amp;amp;^
    4             +  -  |  ^
    3             ==  !=  &amp;lt;  &amp;lt;=  &amp;gt;  &amp;gt;=
    2             &amp;amp;&amp;amp;
    1             ||
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Local Assignment Operator( := ):
&lt;/h4&gt;

&lt;p&gt;The syntax for local assignment operator is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;identifier := value
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  Points to remember:
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;The local assignment operator ( := ) creates new variables and assign value.&lt;/li&gt;
&lt;li&gt;It doesn't need &lt;code&gt;type&lt;/code&gt; details as the compiler does guess it for you.&lt;/li&gt;
&lt;li&gt;Local assignment operator must be used inside functions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Example:
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func main() {
    value := 50.5
    isSet := false
    x, y, z := 3, 56.5, "hello"   // x = 3, y = 56.5, z = "hello"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This concludes the first part of this tutorial series. Check out the second part &lt;a href="https://dev.to/livesamarthgupta/golang-for-experienced-developers-part-ii-2lj1"&gt;here&lt;/a&gt; where I talked about all primitive data types and string handling.&lt;/p&gt;

</description>
      <category>go</category>
      <category>tutorial</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
