<?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: Jordan Taylor</title>
    <description>The latest articles on DEV Community by Jordan Taylor (@justjordant).</description>
    <link>https://dev.to/justjordant</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%2F114108%2F59d8adfd-fec2-445f-a296-2952517ed7d1.jpg</url>
      <title>DEV Community: Jordan Taylor</title>
      <link>https://dev.to/justjordant</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/justjordant"/>
    <language>en</language>
    <item>
      <title>Exploring Interfaces in Go: A Versatile Tool for Polymorphism</title>
      <dc:creator>Jordan Taylor</dc:creator>
      <pubDate>Wed, 11 Oct 2023 21:10:32 +0000</pubDate>
      <link>https://dev.to/justjordant/exploring-interfaces-in-go-a-versatile-tool-for-polymorphism-429b</link>
      <guid>https://dev.to/justjordant/exploring-interfaces-in-go-a-versatile-tool-for-polymorphism-429b</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I6jjRS5D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/0%2AH4e-fr_2Dp_w5-ZV" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I6jjRS5D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/1024/0%2AH4e-fr_2Dp_w5-ZV" alt="" width="800" height="534"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Photo by Barn Images on Unsplash&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Interfaces in Go are a versatile tool that can greatly enhance the way we design and build programs. In this blog post, we’ll explore how Go interfaces can be leveraged to create a flexible and extensible system for making various types of toys.&lt;/p&gt;
&lt;h4&gt;
  
  
  The World of Toy Creation
&lt;/h4&gt;

&lt;p&gt;Imagine you are developing a toy factory application in Go. Your factory can produce a wide range of toys, from teddy bears to action figures and remote-controlled cars. Each toy has its unique features and functionalities, making it challenging to design a robust and maintainable system.&lt;/p&gt;
&lt;h4&gt;
  
  
  Enter Go Interfaces
&lt;/h4&gt;

&lt;p&gt;Go interfaces provide an elegant solution to handle the diversity of toy types and their respective functionalities. Let’s dive into a practical example:&lt;br&gt;
&lt;/p&gt;

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

import (
 "fmt"
)

// Toy represents the basic structure of a toy.
type Toy interface {
 Assemble() string
 Play() string
}

// TeddyBear is a type of toy that implements the Toy interface.
type TeddyBear struct {
 Name string
}

// Assemble method for a teddy bear.
func (tb TeddyBear) Assemble() string {
 return fmt.Sprintf("Assembling a %s teddy bear…", tb.Name)
}

// Play method for a teddy bear.
func (tb TeddyBear) Play() string {
 return fmt.Sprintf("Playing with the %s teddy bear!", tb.Name)
}

// ActionFigure is another type of toy that implements the Toy interface.
type ActionFigure struct {
 Name string
}

// Assemble method for an action figure.
func (af ActionFigure) Assemble() string {
 return fmt.Sprintf("Assembling an %s action figure…", af.Name)
}

// Play method for an action figure.
func (af ActionFigure) Play() string {
 return fmt.Sprintf("Playing with the %s action figure!", af.Name)
}

func main() {
 // Create a teddy bear.
 teddy := TeddyBear{Name: "Cuddly"}
// Create an action figure.
 actionFigure := ActionFigure{Name: "Superhero"}
// Create a slice of toys.
 toys := []Toy{teddy, actionFigure}
// Assemble and play with each toy.
 for _, toy := range toys {
 fmt.Println(toy.Assemble())
 fmt.Println(toy.Play())
 fmt.Println() // Add a newline for separation.
 }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, we define a Toyinterface with two methods: &lt;code&gt;Assemble()&lt;/code&gt; and Play(). We then create two toy types, TeddyBearand ActionFigure, each of which implements the Toyinterface by providing their implementations of Assemble()and Play(). If this wasn’t clear just to repeat myself; we use the names of the func’s as a contract to agree with; with the Interfacethat we are implementing. Moving forward any methods that use the same names are now in agreement with this Interface as to what they should now be implementing as a default. ie ActionFigure implements the Play() / Assemble() methods.&lt;/p&gt;

&lt;h3&gt;
  
  
  Benefits of Using Interfaces
&lt;/h3&gt;

&lt;p&gt;Using interfaces in your toy creation program offers several advantages:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Flexibility&lt;/strong&gt; : You can create new types of toys by simply implementing the &lt;code&gt;Toy&lt;/code&gt; interface. This allows you to add new toys to your factory without modifying existing code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Polymorphism&lt;/strong&gt; : You can treat different types of toys uniformly, enabling you to assemble and play with them generically, as demonstrated in the loop in the &lt;code&gt;main()&lt;/code&gt; function.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Maintainability&lt;/strong&gt; : Interfaces promote clean code by enforcing a consistent structure for toys. This makes it easier to understand, extend, and maintain your toy factory application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Testing&lt;/strong&gt; : Interfaces make it straightforward to create mock toy implementations for testing purposes, ensuring the reliability of your code.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Conclusion
&lt;/h4&gt;

&lt;p&gt;In the world of toy creation, Go interfaces are a valuable tool for building a flexible and extensible system. By defining a common interface for different types of toys, you can streamline the assembly and play processes, making your toy factory code more elegant and maintainable. As you continue to develop your toy factory, interfaces will empower you to add new and exciting toys to your lineup with ease. Happy toy crafting in Go!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Mastering Go For Loops: A Comprehensive Guide</title>
      <dc:creator>Jordan Taylor</dc:creator>
      <pubDate>Wed, 11 Oct 2023 21:09:52 +0000</pubDate>
      <link>https://dev.to/justjordant/mastering-go-for-loops-a-comprehensive-guide-3io5</link>
      <guid>https://dev.to/justjordant/mastering-go-for-loops-a-comprehensive-guide-3io5</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;For loops are commonly used to iterate over arrays and slices in Go using the range keyword. They can also be used to traverse the elements of a map.&lt;/p&gt;

&lt;p&gt;An infinite loop can be created by omitting the initialization, condition, and post statements, but these must be used carefully.&lt;/p&gt;

&lt;p&gt;The post typically updates the loop counter variable. Loops allow programming repeating logic and process collections of data.&lt;/p&gt;

&lt;h4&gt;
  
  
  The Basic Syntax
&lt;/h4&gt;

&lt;p&gt;The basic syntax of a for loop in Go is straightforward:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for initialization; condition; post {
 // Code to be executed
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Initialization&lt;/strong&gt; : This part is executed before the loop begins and typically initializes a variable that will be used in the loop.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Condition&lt;/strong&gt; : The loop continues executing as long as the condition is true.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Post&lt;/strong&gt; : This part is executed after each iteration of the loop and is often used to update the loop control variable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s break down each component with examples:&lt;/p&gt;

&lt;h4&gt;
  
  
  Initialization
&lt;/h4&gt;

&lt;p&gt;In this section, you can declare and initialize variables that will be used within the loop. For instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for i := 0; i &amp;lt; 5; i++ {
 fmt.Println(i)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, &lt;code&gt;i&lt;/code&gt; is initialized to 0, and the loop will continue as long as &lt;code&gt;i&lt;/code&gt; is less than 5. After each iteration, &lt;code&gt;i&lt;/code&gt; is incremented by 1.&lt;/p&gt;

&lt;h4&gt;
  
  
  Condition
&lt;/h4&gt;

&lt;p&gt;The loop will continue executing as long as the condition is true. If the condition is false from the beginning, the loop won’t run at all. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go
for j := 10; j &amp;gt; 0; j — {
 fmt.Println(j)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This loop counts down from 10 to 1. Once &lt;code&gt;j&lt;/code&gt; becomes 0, the condition is false, and the loop terminates.&lt;/p&gt;

&lt;h4&gt;
  
  
  Post
&lt;/h4&gt;

&lt;p&gt;The post statement is executed after each iteration of the loop and is often used to update the loop control variable. Here’s an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go
for x := 0; x &amp;lt; 10; x += 2 {
 fmt.Println(x)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this case, &lt;code&gt;x&lt;/code&gt; starts at 0 and is incremented by 2 after each iteration, producing the numbers 0, 2, 4, 6, and 8.&lt;/p&gt;

&lt;h3&gt;
  
  
  Using For Loops
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Looping Over Arrays and Slices
&lt;/h4&gt;

&lt;p&gt;For loops are commonly used to iterate over arrays and slices 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;
numbers := []int{1, 2, 3, 4, 5}

for index, value := range numbers {
 fmt.Printf("Index: %d, Value: %d\n", index, value)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;range&lt;/code&gt; keyword is used to iterate over the elements of a slice or an array, providing both the index and the value of each element in each iteration.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Infinite Loops&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;In the world of go, we don’t have a &lt;code&gt;while&lt;/code&gt; loop; but we can create an infinite loop by omitting the initialization, condition, and post statements. Use caution when creating infinite loops, as they can lead to program hangs if not controlled properly. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for {
 // This is an infinite loop
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Using For Loops with Maps
&lt;/h3&gt;

&lt;p&gt;In addition to iterating over arrays and slices, Go for loops are also useful for traversing the elements of a map. Here’s an example of how you can loop over a map and perform actions on its key-value pairs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Create a map with some key-value pairs
studentGrades := map[string]int{
 “Alice”: 90,
 “Bob”: 85,
 “Charlie”: 78,
 “David”: 92,
}

// Loop over the map using the "range" keyword
for student, grade := range studentGrades {
 fmt.Printf("Student: %s, Grade: %d\n", student, grade)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, we have a map called &lt;code&gt;studentGrades&lt;/code&gt; that associates student names with their grades. We use a &lt;code&gt;for&lt;/code&gt; loop with the &lt;code&gt;range&lt;/code&gt; keyword to iterate over the map. During each iteration, the &lt;code&gt;student&lt;/code&gt; variable holds the key (student name), and the &lt;code&gt;grade&lt;/code&gt; variable holds the corresponding value (student’s grade).&lt;/p&gt;

&lt;p&gt;The output of this code will be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Student: Alice, Grade: 90
Student: Bob, Grade: 85
Student: Charlie, Grade: 80
Student: David, Grade: 92
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This example demonstrates how to effectively loop over a map in Go, allowing you to access and process key-value pairs within your programs. Whether you need to analyze data stored in maps or perform specific operations on map elements, the &lt;code&gt;for&lt;/code&gt; loop combined with &lt;code&gt;range&lt;/code&gt; provides a powerful and flexible way to work with maps in Go.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;In this blog post, we’ve covered the basics of for loops in Go, including their syntax and usage in various scenarios. Understanding how to use loops effectively is crucial for writing clean and efficient Go code. With this knowledge, you can iterate over collections, implement looping logic, and create more advanced control flow structures in your Go programs. Experiment with different loop variations to become proficient in harnessing the power of loops in Go, Happy coding friends!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Building Go Structs: An Illustrated Guide to Toy Creation</title>
      <dc:creator>Jordan Taylor</dc:creator>
      <pubDate>Wed, 13 Sep 2023 20:05:43 +0000</pubDate>
      <link>https://dev.to/justjordant/building-go-structs-an-illustrated-guide-to-toy-creation-hbj</link>
      <guid>https://dev.to/justjordant/building-go-structs-an-illustrated-guide-to-toy-creation-hbj</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Structs in the Go programming language serve as fundamental building blocks for creating custom data structures. They enable us to encapsulate and organize data effectively. In this blog post, we'll explore Go structs by using the analogy of creating a toy to better understand their syntax, usage, and best practices.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Struct?
&lt;/h2&gt;

&lt;p&gt;In Go, a struct is like a blueprint for creating custom data types. Think of it as a recipe for building something unique. For our analogy, let's imagine we're creating a toy car:&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;type&lt;/span&gt; &lt;span class="n"&gt;ToyCar&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Model&lt;/span&gt;  &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;Color&lt;/span&gt;  &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;Wheels&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, we've defined a &lt;code&gt;ToyCar&lt;/code&gt; struct with three key attributes: &lt;code&gt;Model&lt;/code&gt;, &lt;code&gt;Color&lt;/code&gt;, and &lt;code&gt;Wheels&lt;/code&gt;, each representing an essential feature of our toy car.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating Toy Instances
&lt;/h2&gt;

&lt;p&gt;Just as you would assemble a real toy car, you can create instances (or instances of your toy) from the &lt;code&gt;ToyCar&lt;/code&gt; struct. Here's how you can create a toy car:&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="n"&gt;myToyCar&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;ToyCar&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Model&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;  &lt;span class="s"&gt;"Sports"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;Color&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;  &lt;span class="s"&gt;"Red"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;Wheels&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4&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;In this code, &lt;code&gt;myToyCar&lt;/code&gt; is an instance of our &lt;code&gt;ToyCar&lt;/code&gt; struct, and we've given it specific values for its attributes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Playing with Toy Fields
&lt;/h2&gt;

&lt;p&gt;To enjoy our toy car, we need to know how to interact with it. In Go, we access a struct's attributes using dot notation. For instance, if we want to know the model of &lt;code&gt;myToyCar&lt;/code&gt;, we can do this:&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="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;myToyCar&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c"&gt;// Output: Sports&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Toy Composition: Adding Extra Features
&lt;/h2&gt;

&lt;p&gt;Just like you might want to add a turbocharger or racing stripes to your toy car, Go allows you to embed one struct within another. This feature is called "struct embedding" and allows you to compose more complex data structures. Let's say we want to add a radio to our toy car:&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;type&lt;/span&gt; &lt;span class="n"&gt;ToyWithRadio&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;ToyCar&lt;/span&gt;
    &lt;span class="n"&gt;Radio&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, a &lt;code&gt;ToyWithRadio&lt;/code&gt; includes all the attributes of a &lt;code&gt;ToyCar&lt;/code&gt; as well as an extra &lt;code&gt;Radio&lt;/code&gt; feature.&lt;/p&gt;

&lt;h2&gt;
  
  
  Toy Methods: Making It Move
&lt;/h2&gt;

&lt;p&gt;To make our toy car zoom around, we need to define methods. In Go, methods are functions that operate on a struct's instances. For example, let's add a method to start our toy car:&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;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="n"&gt;ToyCar&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Start&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;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Starting the"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Color&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"toy car!"&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;With this method, we can start our toy car like this:&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="n"&gt;myToyCar&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Start&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c"&gt;// Output: Starting the Red Sports toy car!&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Certainly! Let's improve the example in the "Decorating Our Toy: Using Struct Tags" section by using JSON tags, and I'll explain why they are essential.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decorating Our Toy: Using JSON Tags
&lt;/h2&gt;

&lt;p&gt;In the world of Go structs, JSON tags are commonly used to provide metadata about struct fields. These tags are particularly important when you need to serialize a struct into JSON format or deserialize JSON data into a struct. Here's a revised example:&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;type&lt;/span&gt; &lt;span class="n"&gt;ToyCar&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Model&lt;/span&gt;  &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="s"&gt;`json:"model"`&lt;/span&gt;
    &lt;span class="n"&gt;Color&lt;/span&gt;  &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="s"&gt;`json:"color"`&lt;/span&gt;
    &lt;span class="n"&gt;Wheels&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;    &lt;span class="s"&gt;`json:"wheels"`&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this updated &lt;code&gt;ToyCar&lt;/code&gt; struct, we've added JSON tags to each field. The JSON tags are specified within backticks and follow the field name. The tags provide information to Go's JSON encoding and decoding functions.&lt;/p&gt;

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

&lt;p&gt;Creating Go structs is akin to crafting your own toys, with each field and method defining a unique feature or behavior. By understanding how to define, build, and play with structs, you'll be well-equipped to design and develop complex applications in Go. So, unleash your creativity and start building incredible Go "toys" today!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>devops</category>
      <category>programming</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Getting started with C# -String Formatting</title>
      <dc:creator>Jordan Taylor</dc:creator>
      <pubDate>Sun, 11 Jul 2021 14:00:13 +0000</pubDate>
      <link>https://dev.to/justjordant/getting-started-with-c-string-formatting-5f82</link>
      <guid>https://dev.to/justjordant/getting-started-with-c-string-formatting-5f82</guid>
      <description>&lt;h2&gt;
  
  
  C# - String Formatting
&lt;/h2&gt;

&lt;p&gt;Hey friends, today I will show you how string formatting works in C#; let's dive in.&lt;/p&gt;

&lt;p&gt;You can follow long with your own code or clone the git repo as well. &lt;a href="https://github.com/JustJordanT/gettingStartedWithCsharp/tree/main/gettingStartedWIthCsharp%20-%20stringFormatting/stringFormat"&gt;gettingStartedWIthCsharp - stringFormatting&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Learn By Doing
&lt;/h3&gt;

&lt;p&gt;All right, so let's learn a little .NET CLI as well; we start by making a new .NET project. Now let's create our .NET project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;//The following will create our console app in the directory, in the stringFormate.&lt;/span&gt;
&lt;span class="n"&gt;dotnet&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;console&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="n"&gt;o&lt;/span&gt; &lt;span class="n"&gt;stringFormate&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This basic console app for now, and we will be adding upon this. Here our &lt;code&gt;Main&lt;/code&gt; method will be asking for your first and last name, and then it will give you your initials.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;string&lt;/span&gt; &lt;span class="n"&gt;format&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Program&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Main&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="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Enter you first name: "&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;IsUpper&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;firstName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ReadLine&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

            &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Enter you last name: "&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;lastName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ReadLine&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

            &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"Your initials are: '&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;firstName&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="s"&gt;.&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;lastName&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="s"&gt;'"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  string interpolation
&lt;/h3&gt;

&lt;p&gt;If we look at the existing code block that we just ran, we can see that the final line seems a little different from a standard print string. This is called &lt;code&gt;string interpolation&lt;/code&gt;; this is a way of formatting our output; we can add the &lt;code&gt;$""&lt;/code&gt; to our write lines to call variables from directly in the &lt;code&gt;Console.WriteLine()&lt;/code&gt; method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"Your initials are: '&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;firstName&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="s"&gt;.&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;lastName&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="s"&gt;'"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;You can access the characters in a string by referring to its index number inside square brackets &lt;code&gt;[]&lt;/code&gt;. If we take a look at our example, we can see that we already used this to get the first character from our first and the last name gets it our initials.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"Your initials are: '&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;firstName&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="s"&gt;.&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;lastName&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="s"&gt;'"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Okay, now let's look at a few other methods that can help us format our stings. &lt;/p&gt;

&lt;h3&gt;
  
  
  ToUpper()
&lt;/h3&gt;

&lt;p&gt;This is a method that you can add to your strings to make sure that you always get upper case lettering no matter what the user puts in. If we take a tool at the following code block, we can see that we need to add some extra variables to our method. If we look at our new variables, we can see that we call the &lt;code&gt;ToUpper()&lt;/code&gt; method when it's attached to an existing variable. ie &lt;code&gt;fistName.ToUpper()&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Side Note&lt;/strong&gt;&lt;br&gt;
C# is a strongly typed language which means, you must declare a variable type before you can use it. We see that with both the variables, we are calling the types we want to use. The "var" keyword is used to declare a var type variable. The var type variable can be used to store a simple .NET data type, a complex type, an anonymous type, or a user-defined type.&lt;br&gt;
From a programming standpoint, you can think of &lt;code&gt;var == string, double, int, char, bool, long, object&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Enter you first name: "&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;firstName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ReadLine&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;upperFirstName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToUpper&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

            &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Enter you lastname: "&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;lastName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ReadLine&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;upperLastName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToUpper&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

            &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"Your initials are: '&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;upperFirstName&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="s"&gt;.&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;upperLastName&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="s"&gt;'"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;We can see that in this session, we were able to complete the following.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Being able to create variables.&lt;/li&gt;
&lt;li&gt;Taking input from the console.&lt;/li&gt;
&lt;li&gt;Apply indexing to our outputs to get only certain characters.&lt;/li&gt;
&lt;li&gt;Using different types.&lt;/li&gt;
&lt;li&gt;Formatting methods.&lt;/li&gt;
&lt;li&gt;Using string interpolation to format our output.&lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;Formatting strings can be instrumental in &lt;code&gt;real-world&lt;/code&gt; scenarios; this could range from formatting numbers for security reasons or validating that the data that is being used is only received in a specific format itself. &lt;br&gt;
Here is some homework for you. Are you able to find any other method that we can use to format our data? I will give you one more to look into to, &lt;code&gt;.ToLower&lt;/code&gt; the name gives it away if you have made it this far; with this, we can turn all our data into a lower casing format. Explore and see what other methods you can find as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.c-sharpcorner.com/UploadFile/mahesh/format-string-in-C-Sharp/"&gt;How To Format Strings In C#&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3schools.com/cs/index.php"&gt;w3schools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.c-sharpcorner.com/article/what-does-var-mean-in-c-sharp/"&gt;What Does “var” Mean In C#?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/tokens/interpolated"&gt;$ - string interpolation (C# reference)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Like, share and follow me 🔥 for more content:&lt;/p&gt;

&lt;p&gt;📽&lt;a href="https://www.youtube.com/channel/UCWMddXhNGWkzBYYS9cv-7Qg"&gt;YouTube&lt;/a&gt;&lt;br&gt;
☕&lt;a href="https://ko-fi.com/justjordant"&gt;Buy me a coffee&lt;/a&gt;&lt;br&gt;
💖&lt;a href="https://www.patreon.com/JustJordanT"&gt;Patreon&lt;/a&gt;&lt;br&gt;
🌐&lt;a href="//www.justjordant.com"&gt;JustJordanT.com&lt;/a&gt;&lt;br&gt;
🐱‍💻&lt;a href="https://github.com/JustJordanT"&gt;GitHub&lt;/a&gt;&lt;br&gt;
🤠&lt;a href="https://twitter.com/Just_Jordan_T"&gt;Twitter&lt;/a&gt;&lt;br&gt;
🏢&lt;a href="https://www.linkedin.com/in/justjordant/"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Get out there and build and happy coding.&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>codenewbie</category>
      <category>dotnet</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Getting started with C# - Storing and retrieving data</title>
      <dc:creator>Jordan Taylor</dc:creator>
      <pubDate>Mon, 07 Jun 2021 20:44:15 +0000</pubDate>
      <link>https://dev.to/justjordant/getting-started-with-c-testing-5a27</link>
      <guid>https://dev.to/justjordant/getting-started-with-c-testing-5a27</guid>
      <description>&lt;h2&gt;
  
  
  C# Variables
&lt;/h2&gt;

&lt;p&gt;Variables are containers for storing data values.&lt;/p&gt;

&lt;p&gt;In C#, there are different types of variables (defined with different keywords), for example:&lt;/p&gt;

&lt;h3&gt;
  
  
  int:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;stores integers (whole numbers) without decimals, such as 123 or 123.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  double:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;stores floating-point numbers, with decimals, such as 19.99 or -19.99.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  char:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;stores single characters, such as 'a' or 'B'. Single quotes surround char values&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;string:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;stores text, such as "Hello World." Double quotes surround string values&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  bool:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;stores values with two states: true or false&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Declaring Variables
&lt;/h2&gt;

&lt;p&gt;By declaring variables we are creating a variable, you must specify the type and assign it a value:&lt;/p&gt;

&lt;h3&gt;
  
  
  Examples
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;num&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;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Writeline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;//double&lt;/span&gt;
&lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;3.92&lt;/span&gt;
&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Writeline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Jordan"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Modifying variables
&lt;/h3&gt;

&lt;p&gt;A good thing to note is if you assign a new value to an existing variable, it will overwrite the previous value:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;myNum&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;115&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;myNum&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;220&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// myNum is now 220&lt;/span&gt;
&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;myNum&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;You can also add the &lt;code&gt;const&lt;/code&gt; keyword to prevent others from altering the existing values; this could be helpful in certain situations.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;numPi&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;3.14&lt;/span&gt;
&lt;span class="n"&gt;numPi&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;20&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// error&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The const keyword is used to tell a variable always to keep the same value.&lt;/p&gt;

&lt;p&gt;Note: You cannot declare a constant variable without assigning the value. If you do, an error will occur: A const field requires a value to be provided.&lt;/p&gt;

&lt;h3&gt;
  
  
  Using the keyword var.
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;var&lt;/code&gt; keyword has been around for a long time, and it's commonly used in code examples.&lt;/p&gt;

&lt;p&gt;The use of the &lt;code&gt;var&lt;/code&gt; keyword is significant in C#. There are some situations where the data type may be different than the code intended to use it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Hello world!"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;19.0m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sneak Peak for the next lesson we will continue to put this all together for what we have learned so far.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;25&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Jordan"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Writeline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"Hey Friends!, my name is &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;, and I am &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to dive in deep with variables take a look at the links below.&lt;/p&gt;

&lt;h3&gt;
  
  
  sources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/types#default-constructors"&gt;https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/types#default-constructors&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/learn/modules/csharp-literals-variables/"&gt;https://docs.microsoft.com/en-us/learn/modules/csharp-literals-variables/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3schools.com/cs/cs_variables.asp"&gt;https://www.w3schools.com/cs/cs_variables.asp&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Like, share and follow me 🔥 for more content:&lt;/p&gt;

&lt;p&gt;📽&lt;a href="https://www.youtube.com/channel/UCWMddXhNGWkzBYYS9cv-7Qg"&gt;YouTube&lt;/a&gt;&lt;br&gt;
☕&lt;a href="https://ko-fi.com/justjordant"&gt;Buy me a coffee&lt;/a&gt;&lt;br&gt;
💖&lt;a href="https://www.patreon.com/JustJordanT"&gt;Patreon&lt;/a&gt;&lt;br&gt;
🌐&lt;a href="//www.justjordant.com"&gt;JustJordanT.com&lt;/a&gt;&lt;br&gt;
🐱‍💻&lt;a href="https://github.com/JustJordanT"&gt;GitHub&lt;/a&gt;&lt;br&gt;
🤠&lt;a href="https://twitter.com/Just_Jordan_T"&gt;Twitter&lt;/a&gt;&lt;br&gt;
🏢&lt;a href="https://www.linkedin.com/in/justjordant/"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>codenewbie</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Getting started with C# - Hello World!</title>
      <dc:creator>Jordan Taylor</dc:creator>
      <pubDate>Mon, 07 Jun 2021 20:43:19 +0000</pubDate>
      <link>https://dev.to/justjordant/getting-started-with-c-km9</link>
      <guid>https://dev.to/justjordant/getting-started-with-c-km9</guid>
      <description>&lt;p&gt;Hey friends!&lt;/p&gt;

&lt;p&gt;If you are like and you realized that C# and the whole .NET ecosystem is fun to work with or you are just getting your feet wet this is fast little series of articles for you to go through to get up and running with C#. &lt;/p&gt;

&lt;h2&gt;
  
  
  What is C#?
&lt;/h2&gt;

&lt;p&gt;C# is pronounced "C-Sharp".&lt;/p&gt;

&lt;p&gt;It is an object-oriented programming language created by Microsoft that runs on the .NET Framework.&lt;/p&gt;

&lt;p&gt;C# has roots from the C family, and the language is close to other popular languages like C++ and Java.&lt;/p&gt;

&lt;p&gt;The first version was released in year 2000. The latest version, C# 9 that was released in 2020.&lt;/p&gt;

&lt;h2&gt;
  
  
  C# is used for:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Mobile applications.&lt;/li&gt;
&lt;li&gt;Desktop applications.&lt;/li&gt;
&lt;li&gt;Web applications.&lt;/li&gt;
&lt;li&gt;Web services.&lt;/li&gt;
&lt;li&gt;Web sites.&lt;/li&gt;
&lt;li&gt;Games.&lt;/li&gt;
&lt;li&gt;VR.&lt;/li&gt;
&lt;li&gt;Database applications.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And a whole lot more!&lt;/p&gt;

&lt;h3&gt;
  
  
  So by now you may be thinking... Why Use C#?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;It is one of the most popular programming language in the world.&lt;/li&gt;
&lt;li&gt;It is easy to learn and simple to use.&lt;/li&gt;
&lt;li&gt;It has a huge community support.&lt;/li&gt;
&lt;li&gt;C# is an object oriented language which gives a clear structure -to programs and allows code to be reused, lowering development costs.&lt;/li&gt;
&lt;li&gt;As C# is close to C, C++ and Java, it makes it easy for .&lt;/li&gt;
&lt;li&gt;programmers to switch to C# or vice versa.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Let's get building!
&lt;/h3&gt;

&lt;p&gt;Microsoft has built this handy tool to try .NET and C# that is vary user friendly or beginner or even if you don't want to mess with IDEs it get straight to coding. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Click me&lt;/strong&gt; - &lt;a href="https://try.dot.net/"&gt;Try.dot.net&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Taking out first steps.
&lt;/h3&gt;

&lt;p&gt;Now that we have our web IDE, let's start coding something simple. We can remove all the default test on &lt;a href="https://try.dot.net/"&gt;Try.dot.net&lt;/a&gt; and copy this in there and click run.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;HelloWorld&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Program&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Main&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="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello World!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;    
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="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;We can view our results.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff895f26n52cfspcfyo9q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff895f26n52cfspcfyo9q.png" alt="image" width="671" height="770"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And there we are running our first lines of code in C#.&lt;/p&gt;

&lt;p&gt;In part 2 we will take a look at Storing and retrieving data in C#.&lt;/p&gt;

&lt;h4&gt;
  
  
  Resources
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.w3schools.com/cs/default.asp"&gt;https://www.w3schools.com/cs/default.asp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/C_Sharp_(programming_language)"&gt;https://en.wikipedia.org/wiki/C_Sharp_(programming_language)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/dotnet/csharp/"&gt;https://docs.microsoft.com/en-us/dotnet/csharp/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Like, share and follow me 🔥 for more content:&lt;/p&gt;

&lt;p&gt;📽&lt;a href="https://www.youtube.com/channel/UCWMddXhNGWkzBYYS9cv-7Qg"&gt;YouTube&lt;/a&gt;&lt;br&gt;
☕&lt;a href="https://ko-fi.com/justjordant"&gt;Buy me a coffee&lt;/a&gt;&lt;br&gt;
💖&lt;a href="https://www.patreon.com/JustJordanT"&gt;Patreon&lt;/a&gt;&lt;br&gt;
🌐&lt;a href="//www.justjordant.com"&gt;JustJordanT.com&lt;/a&gt;&lt;br&gt;
🐱‍💻&lt;a href="https://github.com/JustJordanT"&gt;GitHub&lt;/a&gt;&lt;br&gt;
🤠&lt;a href="https://twitter.com/Just_Jordan_T"&gt;Twitter&lt;/a&gt;&lt;br&gt;
🏢&lt;a href="https://www.linkedin.com/in/justjordant/"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>coding</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>#100DaysOfCode Thoughts?</title>
      <dc:creator>Jordan Taylor</dc:creator>
      <pubDate>Sun, 04 Oct 2020 15:19:31 +0000</pubDate>
      <link>https://dev.to/justjordant/100daysofcode-thoughts-8dg</link>
      <guid>https://dev.to/justjordant/100daysofcode-thoughts-8dg</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AMJ5d8ya--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://images.unsplash.com/photo-1554306274-f23873d9a26c%3Fixlib%3Drb-1.2.1%26ixid%3DeyJhcHBfaWQiOjEyMDd9%26auto%3Dformat%26fit%3Dcrop%26w%3D2850%26q%3D80" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AMJ5d8ya--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://images.unsplash.com/photo-1554306274-f23873d9a26c%3Fixlib%3Drb-1.2.1%26ixid%3DeyJhcHBfaWQiOjEyMDd9%26auto%3Dformat%26fit%3Dcrop%26w%3D2850%26q%3D80" alt="pic" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have always been interested in computers and programming from a young age, but never supported my direction.&lt;/p&gt;

&lt;p&gt;Python courses always try to give you the basics and nothing more; most courses nowadays do a lot better when it comes to the content. &lt;/p&gt;

&lt;p&gt;I wanted to learn programming on a deeper level, so I decided to buckle down and learn Python from the top. I've made some small python projects in the past, but nothing too significant, just enough to connect the dots. &lt;/p&gt;

&lt;p&gt;Then cam the &lt;a href="https://www.coursera.org/specializations/python"&gt;Python for Everybody&lt;/a&gt; and &lt;a href="https://www.coursera.org/specializations/data-science-python"&gt;Data Science applied with Python&lt;/a&gt; from the University of Michigan; this was a big game-changer. &lt;/p&gt;

&lt;p&gt;These courses brought you through everything you would need to get started as a python programmer, from understanding the workflow and how to think about problems from an engineering standpoint. &lt;/p&gt;

&lt;p&gt;I will say that after completing this challenge, I do think that you could probably learn a lot more, focusing on a project-based capacity.&lt;/p&gt;

&lt;p&gt;Even if you do not know 100 percent of what you are doing, this will allow you to research and find out what you need for a specific problem; I think this correlates well to real-world experiences / Projects.&lt;/p&gt;

&lt;p&gt;100 Days Of Coding can be an excellent resource and or habit for coding, but I think that moving on to something like 100DaysOfCoingProjects would be a good idea as well.&lt;/p&gt;

&lt;h3&gt;
  
  
  Project ideas
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/karan/Projects"&gt;https://github.com/karan/Projects&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.codementor.io/@npostolovski/40-side-project-ideas-for-software-engineers-g8xckyxef"&gt;https://www.codementor.io/@npostolovski/40-side-project-ideas-for-software-engineers-g8xckyxef&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.reddit.com/r/learnprogramming/comments/2a9ygh/1000_beginner_programming_projects_xpost/"&gt;https://www.reddit.com/r/learnprogramming/comments/2a9ygh/1000_beginner_programming_projects_xpost/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.freecodecamp.org/news/more-project-ideas-to-improve-your-coding-skills-99f48d09bb4b/"&gt;https://www.freecodecamp.org/news/more-project-ideas-to-improve-your-coding-skills-99f48d09bb4b/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>100daysofcode</category>
      <category>python</category>
      <category>datascience</category>
    </item>
  </channel>
</rss>
