<?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: Xun Zhou</title>
    <description>The latest articles on DEV Community by Xun Zhou (@vikbert).</description>
    <link>https://dev.to/vikbert</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%2F165918%2Fea5dedc1-6601-4dc7-b13f-a75dd81cdfa5.jpeg</url>
      <title>DEV Community: Xun Zhou</title>
      <link>https://dev.to/vikbert</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vikbert"/>
    <language>en</language>
    <item>
      <title>[Golang 03/30] Go: data types commonly used</title>
      <dc:creator>Xun Zhou</dc:creator>
      <pubDate>Thu, 25 May 2023 05:38:20 +0000</pubDate>
      <link>https://dev.to/vikbert/golang-0330-go-data-types-commonly-used-3cnb</link>
      <guid>https://dev.to/vikbert/golang-0330-go-data-types-commonly-used-3cnb</guid>
      <description>&lt;p&gt;&lt;strong&gt;Numeric Types:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;int&lt;/code&gt;: Signed integer type. &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;int8, int16, int32, int64&lt;/code&gt;: Signed integer types with specific bit sizes.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;uint&lt;/code&gt;: Unsigned integer type.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;uint8, uint16, uint32, uint64&lt;/code&gt;: Unsigned integer types with specific bit sizes.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;float32, float64&lt;/code&gt;: Floating-point types for representing decimal numbers.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;complex64, complex128&lt;/code&gt;: Complex number types for representing real and imaginary parts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Positive and negative integer&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;int&lt;/code&gt; depends on the running system. If you're running Go on 32-bit OS system, the default type for &lt;code&gt;int&lt;/code&gt; is &lt;code&gt;int32&lt;/code&gt;， and its range is -2^31 to 2^31-1(-2147483648, 2147483647)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Positive integer&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;unit8&lt;/code&gt; has the range of &lt;code&gt;(0, 2^8-1)&lt;/code&gt;, i.e. &lt;code&gt;(0, 255)&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Boolean Type:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;bool&lt;/code&gt;: Represents a Boolean value (&lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;String Type:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;string&lt;/code&gt;: Represents a sequence of characters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Array Types:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;array&lt;/code&gt;: A &lt;code&gt;fixed-size&lt;/code&gt; collection of elements of the &lt;code&gt;same type&lt;/code&gt;. The size of an array is determined at compile-time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Slice Type:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;slice&lt;/code&gt;: A flexible, &lt;code&gt;dynamically-sized&lt;/code&gt; sequence of elements. Slices are built on top of arrays.&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;"fmt"&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="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;intA&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="m"&gt;12&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;intA: %d"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;intA&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c"&gt;//intA: -12&lt;/span&gt;

    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;intB&lt;/span&gt; &lt;span class="kt"&gt;uint&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;12&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;intB: %d"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;intB&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c"&gt;//intB: 12&lt;/span&gt;

    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;floatA&lt;/span&gt; &lt;span class="kt"&gt;float64&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;98.6&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;floatA: %f"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;floatA&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c"&gt;//floatA: 98.600000&lt;/span&gt;

    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;stringVar&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"hello world!"&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;stringVar: %s"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;stringVar&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c"&gt;// stringVar: hello world!&lt;/span&gt;

    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;boolVar&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;boolVar: %t&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;boolVar&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c"&gt;// boolVar: true&lt;/span&gt;

    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Size of 'numbers' is %d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c"&gt;// Size of 'numbers' is 6&lt;/span&gt;
    &lt;span class="c"&gt;// [0 1 2 3 4 5]&lt;/span&gt;

    &lt;span class="n"&gt;numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;7&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Size of 'numbers' is changed to %d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c"&gt;// Size of 'numbers' is changed to 8&lt;/span&gt;
    &lt;span class="c"&gt;// [0 1 2 3 4 5 6 7]&lt;/span&gt;

    &lt;span class="n"&gt;sliced&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"sliced numbers: "&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sliced&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c"&gt;// sliced numbers: [1 2 3 4]&lt;/span&gt;

    &lt;span class="n"&gt;numberArray&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"numberArray with size 3 and default value:"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numberArray&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c"&gt;// numberArray with size 3 and default value:[1 2 0]&lt;/span&gt;


&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Map Type:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;map&lt;/code&gt;: An unordered collection of key-value pairs, where each &lt;code&gt;key is unique&lt;/code&gt;.&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="s"&gt;"fmt"&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="c"&gt;// Create a map to store employee names and their corresponding IDs&lt;/span&gt;
    &lt;span class="c"&gt;// key: string, value: int&lt;/span&gt;
    &lt;span class="n"&gt;employees&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nb"&gt;make&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"current size of this map: %d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;employees&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="c"&gt;// current size of this map: 0&lt;/span&gt;

    &lt;span class="c"&gt;// Add key-value pairs to the map&lt;/span&gt;
    &lt;span class="n"&gt;employees&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"John"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1001&lt;/span&gt;
    &lt;span class="n"&gt;employees&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"Alice"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1002&lt;/span&gt;
    &lt;span class="n"&gt;employees&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"Bob"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1003&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;employees&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c"&gt;// map[Alice:1002 Bob:1003 John:1001]&lt;/span&gt;

    &lt;span class="c"&gt;// Accessing values from the map&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;employees&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"Alice"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;  
    &lt;span class="c"&gt;// Output: 1002&lt;/span&gt;

    &lt;span class="c"&gt;// Modifying values in the map&lt;/span&gt;
    &lt;span class="n"&gt;employees&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"Bob"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1004&lt;/span&gt;

    &lt;span class="c"&gt;// Deleting a key-value pair from the map&lt;/span&gt;
    &lt;span class="nb"&gt;delete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;employees&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"John"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c"&gt;// Print the updated map&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;employees&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c"&gt;// map[Alice:1002 Bob:1004]&lt;/span&gt;

    &lt;span class="c"&gt;// Checking if a key exists in the map&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;exists&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;employees&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"Alice"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;exists&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Alice's ID:"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="c"&gt;// Alice's ID: 1002&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Alice not found"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;keys&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="k"&gt;range&lt;/span&gt; &lt;span class="n"&gt;employees&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;keys&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Keys from the map 'employees': "&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c"&gt;// Keys from the map 'employees': [Alice Bob]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



</description>
      <category>go</category>
      <category>golang30days</category>
    </item>
    <item>
      <title>[Golang 02/30] Go declare variables</title>
      <dc:creator>Xun Zhou</dc:creator>
      <pubDate>Thu, 25 May 2023 04:18:16 +0000</pubDate>
      <link>https://dev.to/vikbert/golang-230-go-declare-variables-a62</link>
      <guid>https://dev.to/vikbert/golang-230-go-declare-variables-a62</guid>
      <description>&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;"fmt"&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="c"&gt;// declare a variable with value "hello"&lt;/span&gt;
  &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"hello"&lt;/span&gt;
  &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;a: %s"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="c"&gt;// shortcut for "var ab string"&lt;/span&gt;
  &lt;span class="c"&gt;// it declares a variable named "ab", &lt;/span&gt;
  &lt;span class="c"&gt;// and auto-detect its type and assign the value "hello" to it.&lt;/span&gt;
  &lt;span class="n"&gt;ab&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="s"&gt;"hello"&lt;/span&gt;
  &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;ab: %s"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ab&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="c"&gt;// declare a variable with explicit type&lt;/span&gt;
  &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;abc&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"hello"&lt;/span&gt;
  &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;abc: %s"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;abc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="c"&gt;// declare multiple variables with type "int"&lt;/span&gt;
  &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;b: %d, c:%d"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="c"&gt;// declare multiple variables and assign them the values&lt;/span&gt;
  &lt;span class="c"&gt;// the types will be auto-detected&lt;/span&gt;
  &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"golang"&lt;/span&gt;
  &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;d: %d, e: %s"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;e&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;It prints the following content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a: hello
ab: hello
abc: hello
b: 0, c:0
d: 1, e: golang
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In Go, we can declare variables using the &lt;code&gt;var&lt;/code&gt; keyword or its shortcut &lt;code&gt;:=&lt;/code&gt;.&lt;br&gt;
Golang will assign the &lt;code&gt;default&lt;/code&gt; value to the variables, which are not initialized.&lt;br&gt;
For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;string&lt;/code&gt; default: empty string&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;int&lt;/code&gt; default: &lt;code&gt;0&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;bool&lt;/code&gt; default: &lt;code&gt;false&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>go</category>
      <category>golang30days</category>
    </item>
    <item>
      <title>[Golang 01/30] Go pointer and variable</title>
      <dc:creator>Xun Zhou</dc:creator>
      <pubDate>Wed, 24 May 2023 16:03:44 +0000</pubDate>
      <link>https://dev.to/vikbert/day1-go-pointer-and-variable-10e8</link>
      <guid>https://dev.to/vikbert/day1-go-pointer-and-variable-10e8</guid>
      <description>&lt;p&gt;Pointer in Golang is a variable which is used to stores the memory address of another variable. The memory address is always found in hexadecimal format, i.e. 0xFFAAF etc.&lt;/p&gt;

&lt;p&gt;Most important operators we will used in pointer are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;operator &lt;strong&gt;*&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;declare pointer variable&lt;/li&gt;
&lt;li&gt;access the value stored in that address&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;operator &lt;strong&gt;&amp;amp;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;return the address of a variable
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&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;"fmt"&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="c"&gt;// declare a variable&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;myVar&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;

    &lt;span class="c"&gt;// declare a pointer variable for type "int"&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;pointerVar&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;

    &lt;span class="c"&gt;// assign the address to that pointer variable&lt;/span&gt;
    &lt;span class="n"&gt;pointerVar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;myVar&lt;/span&gt;

    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;An integer %d is assigned to 'myVar', its location in memory: %p"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;myVar&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;myVar&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;The Value at memory location %p is %d"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pointerVar&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;pointerVar&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c"&gt;// overwrite the content at the address&lt;/span&gt;
    &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;pointerVar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;100&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;The Value at memory location %p is changed to %d"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pointerVar&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;pointerVar&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;The Value of 'myVar' with same address is changed to %d, too."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;myVar&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;It prints the following content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;An integer 5 is assigned to 'myVar', its location in memory: 0xc0000b8000
The Value at memory location 0xc0000b8000 is 5
The Value at memory location 0xc00001c030 is changed to 100
The Value of 'myVar' with same address is changed to 100, too.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Here &lt;code&gt;&amp;amp;&lt;/code&gt; is used to get the address of the variable &lt;code&gt;myVar&lt;/code&gt;, so &lt;code&gt;&amp;amp;myVar&lt;/code&gt; and &lt;code&gt;pointerVar&lt;/code&gt; has the same value &lt;code&gt;0xc0000b8000&lt;/code&gt;.&lt;br&gt;
&lt;code&gt;*&lt;/code&gt; symbol is used to read the value at memory address &lt;code&gt;0xc0000b8000&lt;/code&gt;, so &lt;code&gt;*pointerVar&lt;/code&gt; shows the same content &lt;code&gt;5&lt;/code&gt; as &lt;code&gt;myVar&lt;/code&gt;.&lt;/p&gt;

</description>
      <category>go</category>
      <category>golang30days</category>
    </item>
    <item>
      <title>Web3: smart contract</title>
      <dc:creator>Xun Zhou</dc:creator>
      <pubDate>Mon, 12 Sep 2022 07:00:21 +0000</pubDate>
      <link>https://dev.to/vikbert/web3-smart-contract-46hg</link>
      <guid>https://dev.to/vikbert/web3-smart-contract-46hg</guid>
      <description>&lt;p&gt;In web3, we store a contract, an actual agreement, and this doen't just meana digitalized PDF. It it a mini program with a predefined list of rules to very specifically control the business transactions. And what makes a smart contract smart is that once on the blockchain, it will be executed automatically, based on those rules. Because smart contact is written in code, it requires no intermediary to make them happen, they're fully automactic. Like the other things in blockchain, once it's placed there, it can't be changed.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;IBM&lt;/strong&gt; "Smart contracts are digital contracts store on a blockchain that are automatically executed when predetermined terms and conditions are met. They typically are used to automate the execution of an agreement so that all participants can immediately certain of the outcome without any intermediary's involvement or time loss."&lt;br&gt;
&lt;a href="https://www.ibm.com/topics/smart-contracts"&gt;https://www.ibm.com/topics/smart-contracts&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Microsoft&lt;/strong&gt; "a smart contract is a program that's stored inside a blockchain. Smart contracts extend blockchain from data to code. They represent an agreement between parties. The agreement is coded, and when an action happens, the code runs and provides a response. All of the terms and conditions of the contracts are programmatically defined. ... Smart contracts run on their own, send events that trigger state transistions, and call functions. They're pefect for blockchain technology because they allow people who don't know one another to do business in a securely specified way that requires no middleman. ... Smart contracts are most commonly used with Ethereum. It allows smart contacts to be defined to help facilitates the transfer of digital assets, like ether."&lt;br&gt;
&lt;a href="https://docs.microsoft.com/en-us/training/modules/blockchain-solidity-ethereum-smart-contracts/2-smart-contracts"&gt;https://docs.microsoft.com/en-us/training/modules/blockchain-solidity-ethereum-smart-contracts/2-smart-contracts&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;wikipedia&lt;/strong&gt; "A smart contract is a computer program or transaction protocol that is intended to automatically execute, control or document legally relevant events and actions according to the terms of a contract or an agreement. The objectives of smart contracts are the reduction of need for trusted intermediators, arbitrations costs, fraud losses, as well as the reduction of malicious and accidental exceptions. Smart contracts are commonly associated with cryptocurrencies, and the smart contracts introduced by Ethereum are generally considered a fundamental building block for decentralized finance(DeFi) applications." &lt;a href="https://en.wikipedia.org/wiki/Smart_contract"&gt;https://en.wikipedia.org/wiki/Smart_contract&lt;/a&gt;&lt;br&gt;
 &lt;/p&gt;
&lt;/blockquote&gt;

</description>
    </item>
    <item>
      <title>Use D-MVC Pattern in Symfony Application</title>
      <dc:creator>Xun Zhou</dc:creator>
      <pubDate>Sun, 24 Jul 2022 11:44:43 +0000</pubDate>
      <link>https://dev.to/vikbert/use-d-mvc-pattern-in-symfony-application-5f90</link>
      <guid>https://dev.to/vikbert/use-d-mvc-pattern-in-symfony-application-5f90</guid>
      <description>&lt;h2&gt;
  
  
  🗣 Our story
&lt;/h2&gt;

&lt;p&gt;This is about the journey to a &lt;strong&gt;lightweight software design&lt;/strong&gt; for a complex conference management system.&lt;/p&gt;

&lt;p&gt;The story started with:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I am going to design a conference management system. It should contain different domains: user management, tweets and rating, schedule talks, registration &amp;amp; SSO. The development should take the domains into consideration.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;See the design overview of conference management system&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%2Fl2321a9o2ctbkto0ycki.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%2Fl2321a9o2ctbkto0ycki.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🤯 Our challenge
&lt;/h2&gt;

&lt;p&gt;Most of our developers might have less experience with software design, especially complex systems. The architecture such as &lt;code&gt;Onion architecture&lt;/code&gt;, &lt;code&gt;Hexagonal Architecture&lt;/code&gt; or &lt;code&gt;Clean Architecture&lt;/code&gt; might be overkill for most of them who have less knowledge about design. But they all know well &lt;code&gt;MVC&lt;/code&gt; pattern, which is actually native pattern used in a standard Symfony project.&lt;/p&gt;

&lt;h2&gt;
  
  
  😎 Bingo ! D-MVC Architecture
&lt;/h2&gt;

&lt;p&gt;I came to the idea to design this mixed project structure, so that the developers with less experience can follow and understand the architecture as well.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;MVC&lt;/code&gt; is most well-known architecture which is widely used in &lt;code&gt;ruby on rails&lt;/code&gt; and &lt;code&gt;Symfony framework&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;But what is &lt;code&gt;D-MVC&lt;/code&gt;? 😱&lt;br&gt;
In fact, it is just based on the MVC principle, but inspired by common-used pattern &lt;code&gt;duck-redux&lt;/code&gt; from Frontend-world. &lt;a href="https://medium.com/@matthew.holman/what-is-redux-ducks-46bcb1ad04b7" rel="noopener noreferrer"&gt;read more on what is redux ducks?&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Ducks is a modular pattern that collocates actions, action types and reducers, which are used in redux implementation&lt;br&gt;
Because the structure of the project looks like the ducks in the row, see the image below :D&lt;/p&gt;
&lt;/blockquote&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%2Fstringydingding.com%2Fwp-content%2Fuploads%2F2020%2F01%2F20C99A3F-45ED-4A8F-9DB3-53CBA12C26C8-scaled.jpeg" 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%2Fstringydingding.com%2Fwp-content%2Fuploads%2F2020%2F01%2F20C99A3F-45ED-4A8F-9DB3-53CBA12C26C8-scaled.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;the guideline in duck-MVC&lt;/strong&gt;: we built different &lt;strong&gt;modules(i.e. ducks)&lt;/strong&gt; that are strictly designed and implemented in &lt;strong&gt;&lt;code&gt;MVC&lt;/code&gt;&lt;/strong&gt; pattern.&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%2Flfc07i58lvuk1jdw15vo.jpeg" 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%2Flfc07i58lvuk1jdw15vo.jpeg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 Every Developer knows well &lt;code&gt;MVC&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Because every developer knows well &lt;code&gt;MVC&lt;/code&gt; and there is no need to coach them. We are able to get started easier and faster.&lt;br&gt;
To make the project more familiar with standard Symfony project, I kept the &lt;code&gt;View&lt;/code&gt; layer as default in &lt;code&gt;Symfony framework&lt;/code&gt;, i.e. all views are still located in &lt;strong&gt;&lt;code&gt;/templates&lt;/code&gt;&lt;/strong&gt; folder.&lt;/p&gt;

&lt;p&gt;Each &lt;code&gt;duck&lt;/code&gt; should contain just the three parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Controller:&lt;/strong&gt; controller the web request or API request&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model:&lt;/strong&gt; all domain specific services, models, which are common used by the controller.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;View:&lt;/strong&gt; in fact, they are located in &lt;code&gt;/templates&lt;/code&gt; folder (This is standard way from Symfony framework. I kept the thing as simple as possible. Sure, it can be moved directly within a &lt;code&gt;duck :: user&lt;/code&gt; folder, too.)&lt;/li&gt;
&lt;/ul&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%2F1p6zhhx34rzwo0tsu26t.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%2F1p6zhhx34rzwo0tsu26t.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Based on this &lt;code&gt;D-MVC&lt;/code&gt; approach, we are able to build different modules for the business domains. It can be very easily scaled with more modules.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Schedule:&lt;/strong&gt; module to manage the schedule of talks &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security:&lt;/strong&gt; module to manage authentication and SSO&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tweet:&lt;/strong&gt; module to manage the conference tweets and ratings&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User:&lt;/strong&gt; module to manage the users&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;... other modules&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  ✅ Getting things done
&lt;/h2&gt;

&lt;p&gt;the cool part of this approach is the possibility to maximize the team velocity with less knowledge in software architecture. Additionally, I have still the following important things involved in this approach:&lt;/p&gt;

&lt;h3&gt;
  
  
  Domain
&lt;/h3&gt;

&lt;p&gt;I don't divide the domains into pieces and distribute them in the different &lt;code&gt;ducks&lt;/code&gt;. Because most of them are shared among the different domains. Putting them together will reduce the cost of maintenance and the code can be shared friendly among the &lt;code&gt;ducks&lt;/code&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%2F4382ab9daax34s8l8yof.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%2F4382ab9daax34s8l8yof.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;domain&lt;/code&gt; folder contains the most important domain related stuffs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Entities&lt;/code&gt;: the doctrine entities&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Validations&lt;/code&gt;: the implementations of the business rules&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Value Objects&lt;/code&gt;: the domain specific value objects&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;This solution is a good approach for a team, which has less architecture knowledge. It can maximize the team effort without taking too much time in thinking it over, where should I put the files. The developer should just follow the basic principles, which they learned in the past &lt;code&gt;MVC&lt;/code&gt; projects. It should work.&lt;/p&gt;

&lt;h4&gt;
  
  
  Additionally, we have still some valuable wins:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;scalability&lt;/strong&gt;: Project can be scaled very easily. It will still keep the project in the very clear structure, if the project domains become complex.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;simplicity&lt;/strong&gt;: there is &lt;code&gt;no magic&lt;/code&gt; in this solution, but very &lt;strong&gt;pragmatical&lt;/strong&gt;. Every developer can get started very easily with this setup and less design knowledge is required.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;domain-driven&lt;/strong&gt;: because we try to build the small &lt;code&gt;ducks&lt;/code&gt; for the special domains. It help both the business and development to track the problem as quick as possible in the target &lt;code&gt;duck&lt;/code&gt; area.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Mobility&lt;/strong&gt;: Each &lt;code&gt;duck&lt;/code&gt; has the standard &lt;code&gt;MVC&lt;/code&gt; structure. The code can be transformed very easily into &lt;code&gt;micro-service&lt;/code&gt;, if it is needed.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;This article might not be able to be used as a solution template, because there is still something that are not included and explained. But it can be an inspiration for finding a pragmatic solution for Symfony web development. If it will help u or if you have any question, feel free to write the comments or get the contact directly with me.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>symfony</category>
      <category>mvc</category>
      <category>softwaredesign</category>
      <category>architecture</category>
    </item>
    <item>
      <title>3x essential tests in Symfony application</title>
      <dc:creator>Xun Zhou</dc:creator>
      <pubDate>Sun, 24 Jul 2022 09:33:34 +0000</pubDate>
      <link>https://dev.to/vikbert/3x-essential-tests-in-symfony-application-2d9b</link>
      <guid>https://dev.to/vikbert/3x-essential-tests-in-symfony-application-2d9b</guid>
      <description>&lt;p&gt;You wanna be a good Symfony developer, so give the time to master the following three testing in Symfony application.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;TestCase (common used)&lt;/th&gt;
&lt;th&gt;description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Unit&lt;/td&gt;
&lt;td&gt;&lt;code&gt;TestCase&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;It ensures that individual units of source code (e.g. a single class or some specific method in some class) meet their design and behave as intended&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Functional&lt;/td&gt;
&lt;td&gt;&lt;code&gt;WebTestCase&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;It checks the integration of the different layers of an application (from the routing to the views).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Integration&lt;/td&gt;
&lt;td&gt;&lt;code&gt;KernelTestCase&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;It tests a larger part of source code as integrated components. It uses generally the Symfony Kernel to fetch a service from the dependency injection container.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The simplest way to start any type of tests, is to use &lt;code&gt;maker bundle&lt;/code&gt;:&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;# install the maker bundle&lt;/span&gt;
❯ symfony composer req &lt;span class="nt"&gt;--dev&lt;/span&gt; orm maker

&lt;span class="c"&gt;# install the test bundle&lt;/span&gt;
❯ symfony composer req &lt;span class="nt"&gt;--dev&lt;/span&gt; symfony/test-pack
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;❯ symfony console make:test

&lt;span class="c"&gt;# Which test type would you like?:&lt;/span&gt;
&lt;span class="c"&gt;#  [TestCase       ] basic PHPUnit tests&lt;/span&gt;
&lt;span class="c"&gt;#  [KernelTestCase ] basic tests that have access to Symfony services&lt;/span&gt;
&lt;span class="c"&gt;#  [WebTestCase    ] to run browser-like scenarios, but that don't execute JavaScript code&lt;/span&gt;
&lt;span class="c"&gt;# &amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>5 ways to give people a moment to remember</title>
      <dc:creator>Xun Zhou</dc:creator>
      <pubDate>Sat, 23 Jul 2022 13:52:03 +0000</pubDate>
      <link>https://dev.to/vikbert/5-ways-to-give-people-a-moment-to-remember-41ba</link>
      <guid>https://dev.to/vikbert/5-ways-to-give-people-a-moment-to-remember-41ba</guid>
      <description>&lt;p&gt;The key is to give them something to remember. Whether you're delivering a presentation virtually or in person, your listeners will not recall every word you say. They'll remember moments.&lt;/p&gt;

&lt;p&gt;Great communicators intentionally design memorable moments by using some of the following tactics.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎯 Tell stories
&lt;/h2&gt;

&lt;p&gt;Share personal stories that are relevant to the theme of your presentation.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎯 Offer surprising statistics
&lt;/h2&gt;

&lt;p&gt;Find one number that grabs your audience's attention.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎯 Create analogies
&lt;/h2&gt;

&lt;p&gt;A well-chosen analogy speaks volumes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Plan surprise reveals
&lt;/h2&gt;

&lt;p&gt;Your message doesn't have to change; just change the way you express it. &lt;/p&gt;

&lt;h2&gt;
  
  
  🎯 Show Photos, images and videos
&lt;/h2&gt;

&lt;p&gt;Picture superiority effect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Above all, people do not pay attention to boring things. Give your audience something to remember, like a story or a surprise they didn't expect.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Read the original article &lt;a href="https://www.inc.com/carmine-gallo/a-steve-jobs-presentation-hack-to-mesmerize-your-audience.html?cid=sf01002"&gt;here&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>presentation</category>
      <category>audience</category>
    </item>
    <item>
      <title>Why do you should protect the scrum sprint</title>
      <dc:creator>Xun Zhou</dc:creator>
      <pubDate>Sat, 23 Jul 2022 13:30:35 +0000</pubDate>
      <link>https://dev.to/vikbert/why-do-you-should-protect-the-scrum-sprint-39j8</link>
      <guid>https://dev.to/vikbert/why-do-you-should-protect-the-scrum-sprint-39j8</guid>
      <description>&lt;p&gt;Today I shared my agile development experience with my team. The presentation was about the difference between &lt;code&gt;KanBan&lt;/code&gt; and &lt;code&gt;Scrum&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;One of import thing I pointed out in the presentation was about &lt;strong&gt;"sprint protection"&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;❓ &lt;em&gt;"Sprint is protected!?" but what should we do as next, if we are going to finish the tickets before time box?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;👉 The sprint is generally protected, after the team started the sprint. If we do NOT have special reason, we should not just simply pull the new tickets from backlog, just because Project managers or customers want to have them. In fact, many teams do it in this way.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6ClwKuTh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9o780teaaq4ypw3k6agu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6ClwKuTh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9o780teaaq4ypw3k6agu.png" alt="sprint is protected" width="880" height="491"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In my opinion, there are plenty of things to do in the rest of your sprint days instead of adding new Tickets to current sprint.&lt;/p&gt;

&lt;p&gt;I wanna give you some examples:&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ get started with the technical debts
&lt;/h3&gt;

&lt;p&gt;Some technical optimisation might not be very interesting for PO/PM, but it is very important for a maintainable software product. For example, well structured dashboard, monitoring. You should use this opportunity to work on them.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ do internal training
&lt;/h3&gt;

&lt;p&gt;The team should grow up together in scrum. Internal coaching for agile development, special knowledge sharing, and pair-programming for special dojo can help the team to improve their skills. The growth in technical skills in a team will bring directly impact on the velocity. The mentoring process will help you in team building and build trust among the developers.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ organise small refinement meetings
&lt;/h3&gt;

&lt;p&gt;The team can use the time to organise additional refinement meeting to improve backlog.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ R&amp;amp;D
&lt;/h3&gt;

&lt;p&gt;Do research and development in the area, in which we have still less knowledge. Be innovative and try something out. A new testing framework, or  new coroutine programming approach, and so on.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--giDxkYOU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s0kci4rn2xd5hrnq0luk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--giDxkYOU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s0kci4rn2xd5hrnq0luk.png" alt="Image description" width="880" height="493"&gt;&lt;/a&gt;&lt;br&gt;
❌ Don't change the sprint Goal, if you have NO special reasons to do that. But use the rest of sprint time proactively for the things I mentioned above. Scrum is about the #teamculture, #workflows, and #increments. The increments are not only about the deliverable increments for the customers, but also about the growth within the scrum team.&lt;/p&gt;

</description>
      <category>teamculture</category>
      <category>workflows</category>
      <category>increments</category>
    </item>
    <item>
      <title>12x things make you a better software engineer</title>
      <dc:creator>Xun Zhou</dc:creator>
      <pubDate>Sat, 23 Jul 2022 13:23:26 +0000</pubDate>
      <link>https://dev.to/vikbert/12x-things-make-you-a-better-software-engineer-3li6</link>
      <guid>https://dev.to/vikbert/12x-things-make-you-a-better-software-engineer-3li6</guid>
      <description>&lt;p&gt;I love coding and enjoy thinking in design and architecture. I give always my best to do the best as I can.&lt;br&gt;
In my opinion, the following things make a good software engineer:&lt;/p&gt;

&lt;h3&gt;
  
  
  🎯 master the essential tools
&lt;/h3&gt;

&lt;p&gt;you should be professional to use the essential dev tools, such as editor, IDE, CLI, which you are using daily for the development. So, find the time to train yourself to master the hotkey, best practice for the dev tools.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎯 master the essentials patterns/architectures
&lt;/h3&gt;

&lt;p&gt;As a good software engineer, you need the fundamental knowledge about the essential design patterns and software architectures. This will help you to understand the other's source code or software product faster as possible. It will build the fundament to design a good software in your mind.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎯 Pairing with more experienced software engineer
&lt;/h3&gt;

&lt;p&gt;Pair-programming is the most efficient way to improve the coding skill in the short term.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎯 less copy and pasting
&lt;/h3&gt;

&lt;p&gt;Stack-Overflow!? Yes, I do. But do less copy and pasting, if you wanna be a better software engineer. Try to write the tests, or rename the variables or refactor the original code, if you HAVE TO do copy and pasting.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎯 read or write min 30. mins every day
&lt;/h3&gt;

&lt;p&gt;As software engineer, insisting on reading and writing.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎯 use TDD as design tool
&lt;/h3&gt;

&lt;p&gt;Yes, TDD as design tool. Early very difficult, but big impact in the future.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎯 watch tech talks
&lt;/h3&gt;

&lt;p&gt;The world is changing. And it changes faster as you image. So stay hungry and stay foolish. P.S. be like a child, not a senior 😀&lt;/p&gt;

&lt;h3&gt;
  
  
  🎯 keep open-source mindset
&lt;/h3&gt;

&lt;p&gt;Try to be involved in open-source software projects; share your best practice, code snippets or packages in the community. Don't own the code alone by yourself, but share them.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎯 make side-projects
&lt;/h3&gt;

&lt;p&gt;Do something different and make side-projects.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎯 find a great mentor &amp;amp; be a great mentor
&lt;/h3&gt;

&lt;p&gt;you should have a mentor to guide you, so that you will get the maximal performance in the shortest time. "Try to teach others and share your experience from beginning on. When you are a junior you can mentor students, when you have already some experience you can mentor a junior." You will have the deeper understanding on what you are teaching and mentoring. It help both parties, if you are doing a mentoring well.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎯 learn to communicate well
&lt;/h3&gt;

&lt;p&gt;Software engineer shares the value to the community and communicate well. So go out of the comfort zone and learn to communicate well.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎯 think beyond the code, and think like designers
&lt;/h3&gt;

&lt;p&gt;Designers care about the user experience, good styling and product value. Yes, we do! We care about the good design and architecture, and the business value and the end-users.&lt;/p&gt;

&lt;p&gt;If you agree with one of these points, take it and do it well in the coming days. :)&lt;/p&gt;

</description>
      <category>softwareengineer</category>
      <category>developer</category>
      <category>architecture</category>
    </item>
    <item>
      <title>How do I organise the documents on my company MacBook</title>
      <dc:creator>Xun Zhou</dc:creator>
      <pubDate>Sat, 23 Jul 2022 13:23:02 +0000</pubDate>
      <link>https://dev.to/vikbert/how-do-i-organise-the-documents-on-my-company-macbook-k75</link>
      <guid>https://dev.to/vikbert/how-do-i-organise-the-documents-on-my-company-macbook-k75</guid>
      <description>&lt;p&gt;In the past days, I got the new company MacBook M1 Max to replace another old MacBook. Again I have to organise and synchronise my documents, softwares, and projects. Sure, many different configurations.&lt;/p&gt;

&lt;p&gt;Yes, I know there is the fastest way to synchronise two MacBooks via iCloud or time machine. But sometimes, I do not really do a 1🔛1 clone between two laptops. Because I prefer to have a fresh and clean start on the new machine. So my favorite way is to use the company certificated cloud solution "OneDrive" to synchronise my documents.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. create a good structure to archive the documents for cloud storage
&lt;/h2&gt;

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

&lt;h3&gt;
  
  
  &lt;code&gt;organisation&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;I manage all files related to the company organisation and HR management.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;conference&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;I manage all documents including slides, books, talks, screenshots, which are related to the conferences, workshops.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;side-projects&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;I did some side-projects in the company innovation hours. Besides the project source codes, there are some mind-maps, project planning, documentation, articles, which are related to those projects, but are fit for code repositories. I would like to put them here.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;software&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Some extension and software, which I build by myself.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;book&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Here is the home of all my Ebooks, and PDFs.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;automators&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;I use a lots &lt;code&gt;automators&lt;/code&gt; for MacOS, which can be used to do a batch of tasks for my daily work. For example: I wrote an automate to open automatically the editor &lt;code&gt;dev.to&lt;/code&gt; to write a new article in a second.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;presentation&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;I do a lots of presentations for internal coaching for our junior developers. I download some presentations from the others to learn some new stuffs from them. Here will be the good place for all of them.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;private&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;as shown in the name, there are some private document, such as my certificates for Agile ScrumMaster, Agile Developer, and so on.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;work&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;In this folder, I manage all the documents which are related to the working projects at the company.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;learning&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;I have collected some learning stuffs, such as tutorial videos for &lt;code&gt;golang&lt;/code&gt;, &lt;code&gt;symfony&lt;/code&gt;, &lt;code&gt;rust&lt;/code&gt;. I would like put them here in this learning area.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. create a synchronisation plan
&lt;/h2&gt;

&lt;p&gt;I configured cloud driver &lt;code&gt;OneDriver&lt;/code&gt; to synchronise my &lt;code&gt;documents&lt;/code&gt; folder. But I excluded the following folders:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;software&lt;/code&gt;: some of them are too large&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;learning&lt;/code&gt;: most of tutorial videos are large than 800MB&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Synchronise the documents to the new MacBook
&lt;/h2&gt;

&lt;p&gt;It takes about one hour to have all the documents synchronised from &lt;code&gt;OneDriver&lt;/code&gt;. I chose the lunch break to start the synchronisation. It will never affect my work and in the mood.😀&lt;/p&gt;

&lt;p&gt;I would like to write another article soon to share my experience and I wanna show you how I installed the software packages on my bland new MacBook. &lt;/p&gt;

</description>
      <category>management</category>
      <category>macbook</category>
      <category>filemanagement</category>
    </item>
    <item>
      <title>10 things you should do to become a Project manager</title>
      <dc:creator>Xun Zhou</dc:creator>
      <pubDate>Tue, 12 Jul 2022 20:03:58 +0000</pubDate>
      <link>https://dev.to/vikbert/10-things-you-should-do-to-become-a-project-manager-5b8k</link>
      <guid>https://dev.to/vikbert/10-things-you-should-do-to-become-a-project-manager-5b8k</guid>
      <description>&lt;h2&gt;
  
  
  1. Learn as much as you can about product management
&lt;/h2&gt;

&lt;p&gt;you should learn as much as you can about product management white you are still a software engineer.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Stick to your domain expertise
&lt;/h2&gt;

&lt;p&gt;You should stick to the domain expertise at the beginning.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Keep and strengthen your SQL knowledge
&lt;/h2&gt;

&lt;p&gt;As a product manager, you constantly need to validate your assumptions with qualitative and quantitative data.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Skills to use UMLs and User flows
&lt;/h2&gt;

&lt;p&gt;Be a professional for UMLs and user flows. It will help you understand both development and business well.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Keep open-source mindset
&lt;/h2&gt;

&lt;p&gt;Keep on sharing knowledge generously.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Make side-project
&lt;/h2&gt;

&lt;p&gt;Prioritising learning above programming.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Hackathons
&lt;/h2&gt;

&lt;p&gt;Given the time constraint hackathons often just focus on feasibilities test, not desirability test.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Become a good writer
&lt;/h2&gt;

&lt;p&gt;A skill to master is to learn to write good notes and documentation. Convert notes into action items is the next stage.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Keep away from solution discussions
&lt;/h2&gt;

&lt;p&gt;To be a PM, you should learn to give the authority about the solution to the developers. The duty of PM is to describe the "why" and "What".&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Get out of GitHub
&lt;/h2&gt;

&lt;p&gt;starting the focus on identifying the user needs and business requirements and learning how to write great user story. GitHub will distract your focus and will ultimately harm the trust as PM among the developers.&lt;/p&gt;

&lt;p&gt;This is a summary of this nice talk by Product People. You can check this video on &lt;a href="https://www.youtube.com/watch?v=4hnu4FM6qYY"&gt;https://www.youtube.com/watch?v=4hnu4FM6qYY&lt;/a&gt;&lt;/p&gt;

</description>
      <category>projectmanager</category>
      <category>sofwareengineer</category>
    </item>
    <item>
      <title>Best Practice: Makefile</title>
      <dc:creator>Xun Zhou</dc:creator>
      <pubDate>Sun, 26 Jun 2022 18:44:14 +0000</pubDate>
      <link>https://dev.to/vikbert/best-practice-makefile-b25</link>
      <guid>https://dev.to/vikbert/best-practice-makefile-b25</guid>
      <description>&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%2Fu56yq51s7fgojiqz2u5z.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%2Fu56yq51s7fgojiqz2u5z.PNG" alt="Output by using "&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://gist.github.com/vikbert/54e27c7a304fe96def50ef76b96b04a6" rel="noopener noreferrer"&gt;Download My Makefile on GitHub Gist&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I use &lt;code&gt;Makefile&lt;/code&gt; for most of every my project, both at work and in side-projects.&lt;br&gt;
It let you just create very easily &lt;code&gt;task group&lt;/code&gt; in a &lt;code&gt;Makefile&lt;/code&gt;, which you can execute them via &lt;code&gt;make&lt;/code&gt; command. &lt;/p&gt;

&lt;p&gt;My best practices are the following:&lt;/p&gt;

&lt;h2&gt;
  
  
  Minimal config
&lt;/h2&gt;

&lt;p&gt;I remove all unnecessary definition which might make noise in the &lt;code&gt;Makefile&lt;/code&gt;. Now it has just 6 lines to configure and define the templating of my favorite &lt;code&gt;Makefile&lt;/code&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

SHELL :&lt;span class="o"&gt;=&lt;/span&gt; /bin/bash

&lt;span class="nb"&gt;help&lt;/span&gt;:
    @grep &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s1"&gt;'^[0-9a-zA-Z_-]+:.*?## .*$$|(^#--)'&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;MAKEFILE_LIST&lt;span class="si"&gt;)&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    | &lt;span class="nb"&gt;awk&lt;/span&gt; &lt;span class="s1"&gt;'BEGIN {FS = ":.*?## "}; {printf "\033[32m %-43s\033[0m %s\n", $$1, $$2}'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    | &lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s1"&gt;'s/\[32m #-- /[33m/'&lt;/span&gt;


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

&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;Help:&lt;/code&gt; this code block defines the templating for the task group and its tasks and I used it in every my makefile.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Group your task
&lt;/h2&gt;

&lt;p&gt;With Prefix &lt;code&gt;#--&lt;/code&gt;, you are able to define the title of task group. We can organise the relevant tasks in the same task group.&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;#-- Docker  &lt;/span&gt;


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

&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;this will define a task group with title name &lt;code&gt;Docker&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Add task always the a task description
&lt;/h2&gt;

&lt;p&gt;by using prefix &lt;code&gt;## description of this task&lt;/code&gt;, we can add the description to each task. &lt;br&gt;
The following code defines a task group &lt;code&gt;Docker&lt;/code&gt; with a single task &lt;code&gt;clean&lt;/code&gt;, which triggers four commands to clean up the docker resources.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
 bash  
clean: ## clean up all docker resources
  docker-compose stop
  docker container prune -f
  docker volume prune -f
  docker network prune -f


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

&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;each command should begin with a &lt;code&gt;Tab&lt;/code&gt;, for example, there is always a &lt;code&gt;Tab&lt;/code&gt; before the command &lt;code&gt;docker-compose stop&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Simple start
&lt;/h2&gt;

&lt;p&gt;By using &lt;code&gt;make&lt;/code&gt;, you can show the list of all defined task groups in &lt;code&gt;Makefile&lt;/code&gt;&lt;br&gt;
By using &lt;code&gt;make clean&lt;/code&gt;, you can execute the task &lt;code&gt;clean&lt;/code&gt; under the task group &lt;code&gt;docker&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;See the final result in the terminal:&lt;br&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%2Fu56yq51s7fgojiqz2u5z.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%2Fu56yq51s7fgojiqz2u5z.PNG" alt="Output by using "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gist.github.com/vikbert/54e27c7a304fe96def50ef76b96b04a6" rel="noopener noreferrer"&gt;Download My Makefile on GitHub Gist&lt;/a&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>makefile</category>
      <category>bestpractice</category>
    </item>
  </channel>
</rss>
