<?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: Michael Lombard</title>
    <description>The latest articles on DEV Community by Michael Lombard (@michaelrlombard).</description>
    <link>https://dev.to/michaelrlombard</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%2F1108254%2F825dd128-7444-40e4-b422-e8af6a023022.png</url>
      <title>DEV Community: Michael Lombard</title>
      <link>https://dev.to/michaelrlombard</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/michaelrlombard"/>
    <language>en</language>
    <item>
      <title>The Journey of Learning Coding:</title>
      <dc:creator>Michael Lombard</dc:creator>
      <pubDate>Fri, 22 Sep 2023 15:00:21 +0000</pubDate>
      <link>https://dev.to/michaelrlombard/the-journey-of-learning-coding-1ed5</link>
      <guid>https://dev.to/michaelrlombard/the-journey-of-learning-coding-1ed5</guid>
      <description>&lt;p&gt;In a rapidly evolving digital age, the ability to code is a superpower. It unlocks the doors to a world of limitless possibilities, enabling individuals to create, innovate, and solve complex problems. For those embarking on the journey of learning coding, it can be both exhilarating and challenging, but the rewards are boundless.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Starting Point&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine a person with little to no prior experience in coding. They are drawn to the world of technology, inspired by the idea of building their own applications or websites. This individual begins their coding journey with a sense of curiosity and determination.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Basics&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first steps are often the most daunting. Learning coding involves understanding the fundamentals, such as variables, data types, and basic logic. It's like learning a new language, with its own grammar and vocabulary. However, with the help of online tutorials, coding courses, and dedicated communities, beginners can start to make sense of it all.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Power of Problem-Solving&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As our aspiring coder progresses, they discover that coding is not just about memorizing syntax; it's about problem-solving. Every coding challenge becomes an opportunity to think critically, break down problems into smaller, manageable parts, and devise elegant solutions. This skill transcends coding and becomes a valuable asset in everyday life.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Joy of Creativity&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the most gratifying aspects of learning coding is the ability to create. Our coder begins to build small projects, experimenting with code to see their ideas come to life. They might develop a simple website, design a basic game, or automate a repetitive task. Each achievement fuels their passion for coding and inspires them to dream bigger.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Role of Persistence&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Coding is not always smooth sailing. There are moments of frustration, bugs that seem unsolvable, and hours spent staring at lines of code. However, the key to success is persistence. Our coder learns to embrace failure as a stepping stone to success, understanding that every bug fixed is a lesson learned.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Community and Collaboration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Learning coding is not a solitary endeavor. Our coder joins coding communities, attends meetups, and collaborates with others on open-source projects. They discover the power of teamwork and the joy of sharing knowledge. These interactions foster personal and professional growth and keep the passion for coding alive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Unlocking Career Opportunities&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As our coder gains confidence and experience, they begin to explore the vast job market for developers. Coding skills are in high demand across various industries, from tech giants to startups, offering exciting career opportunities and the potential for financial stability.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>A Beginner's Guide to backref vs. back_populate</title>
      <dc:creator>Michael Lombard</dc:creator>
      <pubDate>Wed, 30 Aug 2023 12:27:42 +0000</pubDate>
      <link>https://dev.to/michaelrlombard/a-beginners-guide-to-backref-vs-backpopulate-1hea</link>
      <guid>https://dev.to/michaelrlombard/a-beginners-guide-to-backref-vs-backpopulate-1hea</guid>
      <description>&lt;p&gt;In the world of programming, managing databases efficiently and effectively is a crucial skill. Python offers a powerful tool for this purpose known as Object-Relational Mapping (ORM), which allows developers to interact with databases using Python objects. Two commonly used features in ORM libraries, such as SQLAlchemy, are backref and back_populate. In this blog post, we'll explore these features, understand their differences, and learn when to use each one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the Basics
&lt;/h2&gt;

&lt;h3&gt;
  
  
  backref
&lt;/h3&gt;

&lt;p&gt;The backref is a feature  that enables the creation of a reverse relationship on the related table automatically. This means that when you define a relationship between two tables (e.g., a parent and a child table), the child table will have a reference back to the parent table without requiring additional code.&lt;/p&gt;

&lt;h3&gt;
  
  
  back_populate
&lt;/h3&gt;

&lt;p&gt;On the other hand, back_populate  allows you to populate related objects in both directions of a relationship. It enables you to define a bidirectional relationship between two tables, where both tables can access each other's related records.&lt;/p&gt;

&lt;h2&gt;
  
  
  Comparing backref and back_populate
&lt;/h2&gt;

&lt;p&gt;Both backref and back_populate aim to simplify the process of dealing with relationships between tables in an ORM. However, they differ in their usage and functionality:&lt;/p&gt;

&lt;h3&gt;
  
  
  Use Cases
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;backref&lt;/strong&gt;: This feature is especially useful when you want to establish a one-way relationship where one table is aware of the other, but the reverse is not necessarily true. For instance, consider a scenario where an Author table has a relationship with a Book table. Using backref, each Author instance can access the associated books.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;back_populate&lt;/strong&gt;: When you need to establish a bidirectional relationship, where both tables should be aware of each other's records, back_populate comes into play. This is particularly handy when dealing with complex data structures where mutual awareness is crucial.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Code Complexity
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;backref&lt;/strong&gt;: Implementing backref is relatively straightforward. You define it within your table's relationship declaration, and the ORM handles the rest. This results in cleaner and simpler code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;back_populate&lt;/strong&gt;: While more powerful in terms of establishing mutual awareness, back_populate requires more configuration. You'll need to specify the relationship on both sides explicitly, making the code a bit more complex.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Flexibility
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;backref&lt;/strong&gt;: It offers limited flexibility compared to back_populate. The parent table can access related records in the child table, but the child table remains unaware of the parent's records.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;back_populate&lt;/strong&gt;: This feature is more flexible as both tables can access each other's related records. This bidirectional communication can be highly advantageous when building complex data relationships.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Choosing the Right Approach
&lt;/h2&gt;

&lt;p&gt;The decision between backref and back_populate depends on the nature of your data and the relationships you're establishing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;If you're dealing with a one-way relationship and only need the parent to access related child records, backref is an excellent choice. It simplifies your code and reduces complexity.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the other hand, if your application demands a two-way relationship, where both parent and child tables need to access each other's data, back_populate is the more suitable option.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>python</category>
    </item>
    <item>
      <title>Call Methods in Python</title>
      <dc:creator>Michael Lombard</dc:creator>
      <pubDate>Wed, 09 Aug 2023 13:48:55 +0000</pubDate>
      <link>https://dev.to/michaelrlombard/call-methods-in-python-1bd3</link>
      <guid>https://dev.to/michaelrlombard/call-methods-in-python-1bd3</guid>
      <description>&lt;p&gt;Understanding Call Methods in Python&lt;/p&gt;

&lt;p&gt;When working with Python, you will often encounter situations where you need to invoke functions or methods to perform specific tasks. One crucial aspect of Python programming is understanding and utilizing call methods. &lt;/p&gt;

&lt;p&gt;In Python, a call method is used to execute a function or method. It allows you to provide input values, known as arguments, to the function, which then processes these inputs and returns a result. &lt;/p&gt;

&lt;p&gt;Function Definition: Before you can call a function, it must be defined. Functions are blocks of code that perform a specific task. For instance, consider a function that calculates the square of a number:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;square&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Function Call: To use the function, you need to call it by its name followed by parentheses. Inside the parentheses, you provide the necessary arguments.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;square&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Call Methods: Call methods are similar to functions, but they are associated with objects. They perform actions on the object they belong to. For example, calling the upper() method on a string object converts the string to uppercase.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"dot"&lt;/span&gt;
&lt;span class="n"&gt;upper_case_message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;upper&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;upper_case_message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Passing Multiple Arguments: Functions and methods can accept multiple arguments, which are separated by commas.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;add_numbers&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="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;

&lt;span class="n"&gt;sum_result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;add_numbers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sum_result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Understanding call methods is essential for building and using functions and methods effectively in your Python programs. By passing appropriate arguments, you can control the behavior of your functions and obtain desired outcomes.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
    </item>
    <item>
      <title>Let’s Talk About JSX, Baby</title>
      <dc:creator>Michael Lombard</dc:creator>
      <pubDate>Tue, 27 Jun 2023 18:16:06 +0000</pubDate>
      <link>https://dev.to/michaelrlombard/lets-talk-about-jsx-baby-2e4i</link>
      <guid>https://dev.to/michaelrlombard/lets-talk-about-jsx-baby-2e4i</guid>
      <description>&lt;p&gt;What is JSX?  The official name for JSX is JavaScript XML, and it is a syntax that combines JavaScript and HTML used in writing code with React.   Although JSX is commonly used in React,  JSX and React are two different tools.  They are often used together, but can be used separately.  JSX is a specific syntax, while React is a JavaScript library.  &lt;/p&gt;

&lt;p&gt;JSX with React:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Function MyDog = () {
  const name = ‘Dot’;
  const age = 3;

  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;Hello, my name is {name}!&amp;lt;/h1&amp;gt;
      &amp;lt;p&amp;gt;I am {age} years old.&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
  );
};

ReactDOM.render(&amp;lt;MyDog /&amp;gt;, document.getElementById('root'));`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example we define a function called MyDog.  Within the function we declare two variables name and age.  We also give the variables values.  The value of name is Dot, and the value of age is 3.  The JSX code within the return statement will be the output of our component. The last line in this example is calling &lt;br&gt;
ReactDOM.render(, document.getElementById('root'));, &lt;br&gt;
We are instructing React to render the MyDog component and place it inside the DOM element with the id of 'root'. The component will then be displayed on the web page wherever the element with that id is located.&lt;/p&gt;

&lt;p&gt;Let’s look at a JavaScript example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const myComponent = () =&amp;gt; {
  const name = ‘Dot’;
  const age = 3;

  const container = document.createElement('div');

  const heading = document.createElement('h1');
  heading.textContent = `Hello, my name is ${name}!`;

  const paragraph = document.createElement('p');
  paragraph.textContent = `I am ${age} years old.`;

  container.appendChild(heading);
  container.appendChild(paragraph);

  document.getElementById('root').appendChild(container);
};

myComponent();

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

&lt;/div&gt;



&lt;p&gt;This example is doing the same thing as JSX, but as you can see it requires a lot more typing.  This is one of the main differences between JSX syntax and JavaScript.&lt;br&gt;&lt;br&gt;
JSX is a declarative syntax: Describing the result without instructing how to do it implicitly.&lt;br&gt;
JavaScript is an imperative syntax: Describing how the program should do something explicitly.&lt;/p&gt;

&lt;p&gt;The Rules of JSX&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Return a single root element&lt;/li&gt;
&lt;li&gt;Close all the tags&lt;/li&gt;
&lt;li&gt;camelCase all most of the things!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;[&lt;a href="https://react.dev/learn/writing-markup-with-jsx#the-rules-of-jsx"&gt;https://react.dev/learn/writing-markup-with-jsx#the-rules-of-jsx&lt;/a&gt;]&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>react</category>
      <category>jsx</category>
    </item>
    <item>
      <title>Variables and Data Types in JavaScript</title>
      <dc:creator>Michael Lombard</dc:creator>
      <pubDate>Mon, 26 Jun 2023 04:18:07 +0000</pubDate>
      <link>https://dev.to/michaelrlombard/variables-and-data-types-in-javascript-4b1m</link>
      <guid>https://dev.to/michaelrlombard/variables-and-data-types-in-javascript-4b1m</guid>
      <description>&lt;p&gt;In JavaScript, variables are used for storing and manipulating data.  Variables allow the programmer to store values in the computer’s memory.  Storing variables enables us to retrieve these values when we need them.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Variables&lt;/strong&gt;&lt;br&gt;
To declare a variable in JavaScript, we use the “var” “let” or “const”  keyword, followed by the variable name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let city;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above example, we declare a variable named “city” using the ‘let” keyword. Variables can hold various types of data, and their values can be changed throughout the program when using the “let” keyword.  “var” and “const” cannot be reassigned, but that is another topic of its own.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Types&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;JavaScript lets us use following data types: numbers, strings, booleans, arrays, and objects. Below are examples of these JavaScript data types.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Numbers&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;JavaScript uses the number data type to represent numeric values.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let number = 10;
let price = 1.77;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The second example is a floating point number.  The difference is that 1.77 a decimal and not an integer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Strings&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Strings are a set of characters enclosed in single or double quotes. Strings are really just text for the purpose of this blog.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   let name = “Dot”;
   let message = "Woof";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Booleans, derived from Boolean Algebra, represent logical values and can be either true or false. Booleans are used for comparisons.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   let dotIsADog = true;
   let dotIsACat = false;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Arrays&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Arrays are ordered collections of values, or a set of data enclosed in square brackets. They can hold elements of any data type, including numbers, strings, and even other arrays.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    let numbers = [1, 2, 3, 4, 5];
    let cars= [“Jeep”, “Cadillac”, “Chevrolet”];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Objects&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Objects are data types that store 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;let dog= {
     name: “Dot”,
     age: 3,
     city: “Boston”'
   };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Understanding variables and data types is critical in order to manipulate data in JavaScript.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
