<?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: Gabrielle J.</title>
    <description>The latest articles on DEV Community by Gabrielle J. (@gabetronic).</description>
    <link>https://dev.to/gabetronic</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%2F1042329%2F1d3d96c0-b0f6-4662-a05f-3c854eb863ca.jpeg</url>
      <title>DEV Community: Gabrielle J.</title>
      <link>https://dev.to/gabetronic</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gabetronic"/>
    <language>en</language>
    <item>
      <title>A Brand New World: An Intro to TypeScript</title>
      <dc:creator>Gabrielle J.</dc:creator>
      <pubDate>Mon, 04 Sep 2023 04:51:11 +0000</pubDate>
      <link>https://dev.to/gabetronic/a-brand-new-world-an-intro-to-typescript-46af</link>
      <guid>https://dev.to/gabetronic/a-brand-new-world-an-intro-to-typescript-46af</guid>
      <description>&lt;p&gt;TypeScript is a great addition to your toolkit if you’re a budding full-stack developer.  It is popular amongst programmers today because it enhances JavaScript code making it more productive and less error-prone.  &lt;/p&gt;

&lt;p&gt;One of the main reasons for this increased productivity is the fact that TypeScript is a 'superset' of JavaScript: every piece of code you've ever written (or ever will write) in JavaScript is also TypeScript code. &lt;/p&gt;

&lt;p&gt;TypeScript was created in 2012 by Microsoft, to help overcome the issues developers had when scaling up applications with JavaScript.  The language’s popularity has slowly grown over the years with each successive, and open-sourced version, thanks to the broadening of its support for non-Microsoft branded environments and technologies.&lt;/p&gt;

&lt;h4&gt;
  
  
  Benefits &amp;amp; Drawbacks
&lt;/h4&gt;

&lt;p&gt;At some point in your code journey, you’ll forget what every variable is supposed to be; it’s natural and everyone does it, no matter how skilled they are at coding.  &lt;/p&gt;

&lt;p&gt;Over at TypeScript's &lt;a href="https://www.typescriptlang.org/docs/handbook/2/basic-types.html"&gt;official site&lt;/a&gt;, they offer the following information:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"TypeScript provides static typing through type annotations to enable type checking at compile time. This is optional and can be ignored to use the regular dynamic typing of JavaScript."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In other words, TypeScript notates (this is called &lt;em&gt;type annotation&lt;/em&gt;) your data type choices while you write code, and then actively checks throughout the life of the program whether or not you’ve stuck to the data types you defined earlier.  &lt;/p&gt;

&lt;p&gt;This early detection system helps you and anyone you may be collaborating with.  The downside to this is you will spend more time writing your code.&lt;/p&gt;

&lt;p&gt;It also makes the environment setup stage a longer process: you must interact with the &lt;code&gt;tsconfig.json&lt;/code&gt; file to make your overall experience run smoothly. I will say, this does provide an opportunity for you to create a more customized experience.  &lt;/p&gt;

&lt;p&gt;Another concern is that TypeScript can’t run on a browser.  The language must first be compiled, either by its in-house compiler, &lt;code&gt;tsc&lt;/code&gt;, or another transpilation program such as Babel.  A benefit of this translation process is that even though TypeScript identifies type errors, once the code has been compiled, those errors remain readable only in &lt;code&gt;.ts&lt;/code&gt; files.&lt;/p&gt;

&lt;p&gt;Now that we’ve got a conceptual understanding down, I’ve provided a short coded example of what TypeScript's type annotation looks and acts like.  I highly recommend the &lt;a href="https://www.typescriptlang.org/play"&gt;TypeScript Sandbox&lt;/a&gt; if you’re interested in exploring the code yourself.&lt;/p&gt;

&lt;h4&gt;
  
  
  A Quick Visual Example
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
let message: string = 'Good morning, good evening, &amp;amp; good night';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After declaring the ‘message’ variable, I added a colon and the name of the data type. &lt;/p&gt;

&lt;p&gt;Technically, you don’t have to set an annotation: TypeScript does this for you in the background, but while learning, this might just be the helpful visual reminder you never knew you needed.&lt;/p&gt;

&lt;p&gt;Here's what happens when I try to reassign &lt;code&gt;message&lt;/code&gt; to a different data type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(message = 2);  
// prints "Type 'number' is not assignable to type 'string'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Variables bound to arrays are written with a colon, followed by a one-word description of the element types, and a pair of brackets.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let authorsArray: string[] = ['Zadie Smith', 'Thomas Hardy'];

let anyTypesArray: any[] = ['eight', 8, true];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This article answers a few journalistic questions: the why, how, what and when of the TypeScript language.  It was written to give you a quick introduction, but I hope it has piqued your curiosity, allowing you to explore and appreciate the many different and interesting aspects of TypeScript-based programming.  Thanks for reading! &lt;/p&gt;

&lt;h5&gt;
  
  
  Sources:
&lt;/h5&gt;

&lt;p&gt;&lt;a href="https://www.typescriptlang.org/docs/handbook"&gt;Typescript&lt;/a&gt;&lt;br&gt;
&lt;a href="https://en.wikipedia.org/wiki/TypeScript"&gt;Wikipedia&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.pexels.com/photo/computer-c-code-276452/"&gt;Photo by Pixabay&lt;/a&gt;&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Exploring Network Graph Visualization: Graphology and Sigma.js</title>
      <dc:creator>Gabrielle J.</dc:creator>
      <pubDate>Tue, 15 Aug 2023 03:43:20 +0000</pubDate>
      <link>https://dev.to/gabetronic/exploring-network-graph-visualization-graphology-and-sigmajs-5fcg</link>
      <guid>https://dev.to/gabetronic/exploring-network-graph-visualization-graphology-and-sigmajs-5fcg</guid>
      <description>&lt;p&gt;Graphology and Sigma.js are great libraries for those who want to learn to create interactive network graphs with JavaScript and Typescript.&lt;br&gt;
Both projects are easy to install, and feature comprehensive, interdependent libraries for data modeling and graph visualizations. While Graphology handles &lt;em&gt;what&lt;/em&gt; a graph will do, Sigma.js is responsible for the &lt;em&gt;how&lt;/em&gt; the graph is experienced online.&lt;/p&gt;
&lt;h4&gt;
  
  
  Graphology
&lt;/h4&gt;

&lt;p&gt;Graphology holds a reference implementation as well as a Graph object itself. A reference implementation combines all of the standardized requirements and common practices into one program. Examples of some of those requirements include graph layouts, metrics and algorithms that focus on community detection. &lt;/p&gt;

&lt;p&gt;Important to the concept of a reference implementation, is testing, which is also included.  Testing also provides you with some valuable training wheels while learning. &lt;/p&gt;

&lt;p&gt;In tandem with its customized graph data structure, Graphology supplies properties and methods created by both the developers and contributors.  &lt;/p&gt;

&lt;p&gt;Here's an example of creating a new instance of the program's Graph object and some added properties, attributes and methods:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let graph = new Graph();

// a method to add nodes 
graph.addNode('Trantor');

// a setter attribute for that node
graph.setNodeAttribute('Hari Seldon', {school: "Streeling University"});

// a property that tells you the type of graph 
graph.type; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One of the more intuitive features is the auto-generation of node keys: nodes require keys to help the graph recognize and store any optional information you may pass to it. By auto generating keys while you create nodes, you have the option to add more information later whenever you're ready to do so. &lt;/p&gt;

&lt;p&gt;Leading into sigma.js, graphology includes event handler methods for interacting with users once your network graph is rendered.&lt;/p&gt;

&lt;h4&gt;
  
  
  Sigma.js
&lt;/h4&gt;

&lt;p&gt;As mentioned earlier, Sigma.js handles how a graph is experienced; in other words, it manages the rendering process and any graphical user interactions on your website.  &lt;/p&gt;

&lt;p&gt;Here are a few highlights:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;uses the popular JavaScript graphics API, WebGL &lt;/li&gt;
&lt;li&gt;renders medium to large graphs&lt;/li&gt;
&lt;li&gt;utilizes a plug-ins library for help with customization&lt;/li&gt;
&lt;li&gt;it's open-sourced!&lt;/li&gt;
&lt;li&gt;provides intuitive documentation and ample demos&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In their interdependence, Graphology and Sigma.js provide great functionality for visualizing and interacting with network graphs capable of holding thousands of connections.  They also do a good job at providing guidelines for those interested in diving into the realm of network data analysis.  Hopefully this article has given you insight on some of the exciting graph tech available to you.  &lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

&lt;h5&gt;
  
  
  Sources
&lt;/h5&gt;

&lt;p&gt;Guillaume Plique. (2021). Graphology, a robust and multipurpose Graph object for JavaScript. Zenodo. &lt;a href="https://doi.org/10.5281/zenodo.5681257"&gt;https://doi.org/10.5281/zenodo.5681257&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.sigmajs.org/"&gt;Sigma.js&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/jacomyal/sigma.js"&gt;Sigma.js on Github&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/graphology/"&gt;Graphology on Github&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://unsplash.com/photos/T9rKvI3N0NM?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditShareLink"&gt;Cover Photo by Shubham Dhage&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>typescript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Introductory Concepts in Network Analysis</title>
      <dc:creator>Gabrielle J.</dc:creator>
      <pubDate>Mon, 07 Aug 2023 13:49:18 +0000</pubDate>
      <link>https://dev.to/gabetronic/introductory-concepts-in-network-analysis-14kl</link>
      <guid>https://dev.to/gabetronic/introductory-concepts-in-network-analysis-14kl</guid>
      <description>&lt;p&gt;Whether or not you are a budding software developer, a historian interested in incorporating statistical analysis into your work, or a film fan who wants to know why that game &lt;a href="https://www.oracleofbacon.org/"&gt;Six Degrees of Kevin Bacon&lt;/a&gt; literally never fails in finding a path back to Bacon – If you haven't come across the term &lt;em&gt;network analysis&lt;/em&gt;, you've come to the right place!  &lt;/p&gt;

&lt;p&gt;This article is meant to introduce you to the amazing (yes, amazing) field of analyzing networks – and I don't just mean that famous one that starts with an F.  &lt;/p&gt;

&lt;p&gt;Theoretically, it is possible to relate everything everywhere as belonging to a network.  I suppose that’s why social networks like Facebook can be catnip for users who relish “going down the rabbit hole.”  A &lt;strong&gt;network&lt;/strong&gt;, after all, is just &lt;em&gt;a complex, interdependent system&lt;/em&gt;.  Even though this theory of ultimate interconnectivity is wildly unrealistic to implement as a research topic, networks are as much a part of human life as food &amp;amp; shelter.  Thus, it’s natural for us to want to study why networks are so important to our wellbeing.  With that, let's go over some of the concepts related to creating, designing and analyzing a network.&lt;/p&gt;

&lt;p&gt;The concrete version of a network, one we can manipulate and study, is a &lt;strong&gt;graph&lt;/strong&gt;, which is made up of nodes and edges.  Examining the explicit and implicit connections between places, people and things, is what nodes and edges are all about.   A &lt;strong&gt;node&lt;/strong&gt; is an entity: an example being you or me, or anybody you or I know.  An &lt;strong&gt;edge&lt;/strong&gt; is the relationship between you (the node) and --let's say, hypothetically, your two siblings, your two closest friends, your basketball coach from 7th grade, and that drugstore clerk who's always looks so happy.  All of these people are also nodes.&lt;/p&gt;

&lt;p&gt;The way a network is studied and designed depends on those edges. For example, you have more &lt;em&gt;experience&lt;/em&gt; with your two hypothetical siblings you grew up with,  than with the hypothetical drugstore clerk you see every other week. This &lt;em&gt;experience influences your behavior&lt;/em&gt; – whether you realize it or not.  This is what the concept of &lt;strong&gt;centrality&lt;/strong&gt; measures –  how influential a node is in relation to other nodes and within the network itself.  &lt;/p&gt;

&lt;p&gt;The &lt;em&gt;number of people you know&lt;/em&gt;, or &lt;strong&gt;node degree&lt;/strong&gt;, can affect centrality.  The fact that you &lt;em&gt;share similarities&lt;/em&gt; in DNA with your two siblings also adds &lt;strong&gt;weight&lt;/strong&gt; to the edges that represent your relationships with them. &lt;/p&gt;

&lt;p&gt;Considering that 7th grade coach, there will never be a time when you will be able to travel back in time to become their 7th grade coach – your relationship with them is considered &lt;em&gt;asymmetrical&lt;/em&gt;, also known as a &lt;strong&gt;directed edge&lt;/strong&gt;.  Conversely, &lt;strong&gt;undirected edges&lt;/strong&gt; represent &lt;em&gt;symmetrical&lt;/em&gt; relationships: an example of this would be if your two closest friends residing as nodes from that hypothetical network mentioned earlier, are also best friends with each other.&lt;/p&gt;

&lt;p&gt;Zooming out a little further, let's say you’re visiting Manhattan, &amp;amp; you wanted to find out where, and if, you'll have to trek up and down Manhattan to find all of the most popular theaters on your to-visit list. You'd pull out your phone and look at a map app, right?  Somewhere deep in the recesses of that application is a metric called a &lt;strong&gt;clustering coefficient&lt;/strong&gt;, which identifies &lt;em&gt;how clustered a group of nodes are&lt;/em&gt;.  Milliseconds later, this metric will have conveyed to the proper app components that communicate to you, that you do not, in fact, have to spend most of the day traveling; all you have to do is get to the Theatre District.  The map application itself is a powerful network &lt;strong&gt;visualization&lt;/strong&gt; designed to analyze and produce information about the New York public transportation network. &lt;/p&gt;

&lt;p&gt;For those of you still reading to figure out Kevin Bacon's elusive secret, I'm sorry to disappoint you, but he doesn't have one.  There's a scientific observation called the &lt;strong&gt;small world phenomenon&lt;/strong&gt;, that reports that although two nodes may not be directly connected, a short chain of edges belonging to other related nodes will ultimately bridge that gap between those two unconnected nodes. &lt;/p&gt;

&lt;p&gt;For those of you who are chess enthusiasts and/or budding developers, at some point you may have crossed paths with a problem called n-queens.  The possible &lt;em&gt;length of the n&lt;/em&gt; in that problem can be unsettling, just as &lt;strong&gt;dense&lt;/strong&gt; networks can be untenable to analysts.  A &lt;strong&gt;sparse&lt;/strong&gt; network is a much more favorable attribute for creating optimized metrics.  Related to the n-queens problem, is a style of computer programming called &lt;em&gt;constraint programming&lt;/em&gt;.  I won't spoil a potential learning opportunity, suffice it to say creating constraints on too much information makes analyzing it much more tenable.&lt;/p&gt;

&lt;p&gt;In summary, there are many moving parts and factors to be considered when examining a network.  Although network science may seem like a daunting field of work, if you relate its concepts to how we live -- how we have always lived throughout history -- you can discover how exciting and interesting network analysis can be.  Hopefully, this article has helped introduce you to a few, important concepts that help developers, historians, chess fanatics, and many others analyze networks.  I also hope this article illustrates just a bit about how much thought goes into designing the networks we use everyday – from transportation, to infectious disease tracking, to the lifespan of on- and offline communities (RIP GeoCities).  &lt;/p&gt;

&lt;p&gt;Feel free to give me feedback or just chat with me about this subject, and check out the sources list below for more information.  Thanks for reading!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://towardsdatascience.com/network-analysis-d734cd7270f8"&gt;Loem, M. (2022, January 7). What is Network Analysis? - Towards Data Science&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ci.nii.ac.jp/ncid/BB10743884"&gt;Caldarelli, G., &amp;amp; Catanzaro, M. (2012). Networks: A very short introduction.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://unsplash.com/photos/yhNVwsKTSaI?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditShareLinkt"&gt;Cover Photo by José Martín Ramírez Carrasco&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>networks</category>
      <category>graphs</category>
      <category>analytics</category>
    </item>
    <item>
      <title>Ruby: An Intro for the Curious-Minded</title>
      <dc:creator>Gabrielle J.</dc:creator>
      <pubDate>Mon, 19 Jun 2023 14:14:03 +0000</pubDate>
      <link>https://dev.to/gabetronic/ruby-an-intro-for-the-curious-minded-20c6</link>
      <guid>https://dev.to/gabetronic/ruby-an-intro-for-the-curious-minded-20c6</guid>
      <description>&lt;p&gt;If you're new to programming, Ruby is a great language to start learning.  Ruby is a general-purpose, object-oriented programming language known for its readability and flexibility. It's primarily used for web application development, and is strongly associated with the popular web application framework Ruby on Rails.  &lt;/p&gt;

&lt;p&gt;Designed by Yukihiro Matsumoto in the early 1990s, Ruby was created primarily to accommodate the needs of &lt;br&gt;
&lt;a href="https://www.codecademy.com/catalog/language/ruby?utm_source=ccblog&amp;amp;utm_medium=ccblog&amp;amp;utm_campaign=ccblog&amp;amp;utm_content=what_is_ruby_used_for_blog"&gt;"humans, not machines"&lt;/a&gt;. This article aims to break down why Ruby is something you should consider adding to your roster of useful things to learn as a budding programmer.  &lt;/p&gt;

&lt;p&gt;As mentioned earlier, Ruby has many advantages.&lt;br&gt;&lt;br&gt;
The same way that dictionaries are updated to include new words, Ruby also allows you to change how the language itself is used.  You can use Ruby on many different operating systems.  It is useful in many different types of professions - software development (both server- &amp;amp; client-side), development operations (aka DevOps), quality control &amp;amp; database management, amongst many others. Ruby developers are &lt;a href="https://survey.stackoverflow.co/2023/#technology-top-paying-technologies"&gt;one of the highest-paid developers&lt;/a&gt; in the market, &lt;a href="https://survey.stackoverflow.co/2023/#technology-most-popular-technologies"&gt;even though Ruby is not as well known&lt;/a&gt; as JavaScript, Python, or TypeScript. &lt;/p&gt;
&lt;h3&gt;
  
  
  Basic Syntax:
&lt;/h3&gt;

&lt;p&gt;Here's an example of assigning a value to a variable and printing it.  Notice that the variables are not explicitly declared, and the simplicity of its print statement:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_Numeric = 115
myBoolean = true   
my_string = "Hello World"

puts my_string   // prints Hello World
puts 'Hi ' * 3   // prints Hi Hi Hi

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

&lt;/div&gt;



&lt;h4&gt;
  
  
  Methods, Conditionals, and Arrays
&lt;/h4&gt;

&lt;p&gt;Much like in JavaScript, methods are called after the variable and a dot.&lt;br&gt;
Notice that the space between the array items doesn't affect the output, and the use of zero-indexing and bracket notation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;list = [3,2, 100, -54]
puts list.sort   //   prints -54, 2, 3, 100

daytime = 'During daylight savings time, the sun is still out at 8 AM.'
daytime.gsub('AM', 'PM') //  .gsub finds and replaces all occurrences of the 1st parameter with the second parameter

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

&lt;/div&gt;



&lt;p&gt;The first variable in the example below is an array with three elements. Using the index [1], you can access the second element. &lt;/p&gt;

&lt;p&gt;The second variable points to a hash, which is a collection of key-value pairs. You can access the value next to the AM key by typing person[:AM].&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;veggies = ["cucumber", "celery", "lettuce"]
puts veggies[1]  # Output: celery

person = { name: "August", AM: "Good Morning!", PM: "Good Night!" }

puts person[:AM]  # Output: "Good Morning!"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And here is a simple control flow conditional statement and a loop:&lt;/p&gt;

&lt;p&gt;The first block of code checks if y is greater than 5 and prints the corresponding message. The second block uses the times method to iterate five times, printing the iteration number.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;y = 2

if y &amp;gt; 2
  puts "y is greater than 2"
else
  puts "y is less than or equal to 2"
end

5.times do |i|
  puts "Iteration #{i+1}"
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;In this article, we explored the fundamentals of why Ruby is a relevant and popular addition to your arsenal of knowledge and provided code examples to help you realize how simple and flexible Ruby can be.  I hope this has been a beneficial and exciting introduction to Ruby.  &lt;/p&gt;

&lt;p&gt;Happy Coding!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://unsplash.com/photos/OqtafYT5kTw?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Photo Credit: Ilya Pavlov @ Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>ruby</category>
      <category>beginners</category>
    </item>
    <item>
      <title>An Intro to Structured Query Language(SQL)</title>
      <dc:creator>Gabrielle J.</dc:creator>
      <pubDate>Mon, 12 Jun 2023 07:45:59 +0000</pubDate>
      <link>https://dev.to/gabetronic/an-intro-to-structured-query-languagesql-11m7</link>
      <guid>https://dev.to/gabetronic/an-intro-to-structured-query-languagesql-11m7</guid>
      <description>&lt;p&gt;SQL, or 'Structured Query Language' is a well-known, standardized programming language used to access and manipulate relational databases. &lt;/p&gt;

&lt;h3&gt;
  
  
  How do you say it?
&lt;/h3&gt;

&lt;p&gt;It's been in use for more than 35 years, and can be pronounced either as 'sequel,' or as the acronym S.Q.L.&lt;/p&gt;

&lt;h3&gt;
  
  
  What's a 'relational database'?
&lt;/h3&gt;

&lt;p&gt;Technically known as a relational database management system, or RDBMS, this type of database(there are others - non-relational, graph, etc.) stores multiple collections of related data entries. &lt;/p&gt;

&lt;p&gt;The collections are called tables. Much like the tables that you can insert into a data processing document, a database table consists of columns and rows.  In this case, rows are called records.  &lt;/p&gt;

&lt;h3&gt;
  
  
  What does SQL do?
&lt;/h3&gt;

&lt;p&gt;SQL can define and manipulate both tables and databases, send queries to RDBMS &amp;amp; retrieve the specified data, control user access privileges, and control the version of the data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Who uses it?
&lt;/h3&gt;

&lt;p&gt;SQL skills are particularly useful if you are interested in careers that focus on data science or analysis, database administration, or database design &amp;amp; architecture. But web developers also use RDBMS &amp;amp; SQL -- alongside several other programming languages -- quite often to create websites that need or produce lots of data.&lt;/p&gt;

&lt;p&gt;Amazon's subsidiary AWS, gives an example of why SQL is popular:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;[..] developers learn and use SQL because it integrates well with different programming languages. For example, they can embed SQL queries with the Java programming language to build high-performing data processing applications with major SQL database systems such as Oracle or MS SQL Server." &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;-- &lt;a href="https://aws.amazon.com/what-is/sql/"&gt;'What is SQL (Structured Query Language)?'&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What can you write with SQL?
&lt;/h3&gt;

&lt;p&gt;Basic components of SQL are easy to learn due to their simplicity, and are categorized as commands, statements, queries; more complex components include stored procedures, and user-defined functions. Since this article is a simple introduction to SQL, it will not cover the more advanced components, but suffice it to say there are plenty of resources out there if you want to learn more!&lt;/p&gt;

&lt;p&gt;Here are some simple definitions and corresponding examples of basic SQL components:  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Commands&lt;/strong&gt; - reserved keywords that communicate broad directives&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE TABLE;  // creates a table
REVOKE james3_user;  // revokes a user's access privilege 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Statements&lt;/strong&gt; - commands with additional descriptive language elements, including functions and conditionals&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SET first_name = 'Gabriel';  // sets a user's first name to Gabriel 


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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Queries&lt;/strong&gt; - a group of statements and keywords&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;UPDATE User  
SET first_name = 'Jabriel'
WHERE first_name = 'Gabriel'
COMMIT; 
 // updates the spelling of all users whose first name is Gabriel

SELECT first_name, age
FROM wagstaff_students
WHERE age &amp;lt; 17 &amp;amp;&amp;amp; age &amp;gt; 15; 
// selects the name and age for all students whose age between 15 and 17

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  How do you write it?
&lt;/h3&gt;

&lt;p&gt;The main things to remember about SQL syntax are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;A semicolon always ends a command or a statement&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Statements are NOT case-sensitive, although writing keywords/commands in upper-case, &amp;amp; column/row names in lower-case is expected&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT * FROM wagstaff_students;
// selects all of the contents of a table called wagstaff_students

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

&lt;/div&gt;



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

&lt;p&gt;I hope this article has helped you understand and appreciate the fundamentals of SQL.  To summarize, SQL is a popular programming language specifically created to interact with databases that store relational data.  &lt;/p&gt;

&lt;p&gt;Because it's been around for so long, SQL can be used alongside many different front-end and back-end programming languages, as well as different open-source and corporate-owned relational database management systems.  &lt;/p&gt;

&lt;p&gt;It is useful for anyone learning full-stack web development or data structures and analysis, and is quite easy to learn considering the simplicity of its commands and statements.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Photo Credit&lt;/em&gt;: &lt;a href="https://unsplash.com/photos/juqYjifAYaU"&gt;Photo by Mark Boss @ Unsplash&lt;br&gt;
&lt;/a&gt; &lt;br&gt;
&lt;em&gt;Accessible Image Description&lt;/em&gt;: Person leaning on fence inside building&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>sql</category>
      <category>database</category>
    </item>
    <item>
      <title>Lexical vs. In-Memory Scope in JavaScript</title>
      <dc:creator>Gabrielle J.</dc:creator>
      <pubDate>Fri, 05 May 2023 19:39:12 +0000</pubDate>
      <link>https://dev.to/gabetronic/lexical-vs-in-memory-scope-in-javascript-1245</link>
      <guid>https://dev.to/gabetronic/lexical-vs-in-memory-scope-in-javascript-1245</guid>
      <description>&lt;p&gt;In programming, the concepts of lexical and in-memory scopes are two important tenets used to determine where a variable can be used in a program.  Every programming language has its own scoping rules – this article covers JavaScript’s rules.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lexical Scope
&lt;/h2&gt;

&lt;p&gt;A very efficient definition of scope is laid out by &lt;a href="https://www.freecodecamp.org/news/javascript-lexical-scope-tutorial/"&gt;Oluwatobi Sofela&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Scope refers to the area where an item (such as a function or variable) is visible and accessible to other code.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;An item is said to be lexically scoped when it's first declared.  In other words, its accessibility is created at the same time it is created.  Lexical scoping can help to avoid naming conflicts, and it keeps variables localized to where they are needed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var hasLexicalScope;   // a variable

function example(){
  console.log('I have lexical scope as well')
}   // a function declaration

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

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Within the category of lexical scope, there are three sub-categories&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;block scope (think, a conditional or a loop)&lt;/li&gt;
&lt;li&gt;function scope &lt;/li&gt;
&lt;li&gt;global scope&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Variables defined in either a block of code or a function declaration can only be used in that block or function, because that's the area where they were created.  Any attempt otherwise, will result in a reference error. &lt;/p&gt;

&lt;p&gt;Conversely, if a variable is not block- or function-scoped, it has global scope -- it is accessible from anywhere in its program.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let isGloballyScoped = "example";
console.log(isGloballyScoped); // prints example


function isFunctionScoped() {
  let message = "I can only be accessed from inside my 
  function !";
}
console.log(message); // prints Reference Error: message is 
not defined 


if (1 === 2) {
  var isBlockScoped = "I can only be accessed from inside 
  my code block!";
}
console.log(isBlockScoped); // prints Reference Error:
isBlockScoped is not defined 

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

&lt;/div&gt;






&lt;h2&gt;
  
  
  In-Memory Scope
&lt;/h2&gt;

&lt;p&gt;In-memory scope refers to the availability of a variable or function while it's being executed.  This means, that when a function or a variable is running, its information is temporarily stored in memory, in a structure referred to as an execution context. In-memory scoping can make it easier to share data between different parts of the code.&lt;/p&gt;

&lt;p&gt;If you've heard the term &lt;em&gt;call-stack&lt;/em&gt;, you already known what an execution context is! &lt;/p&gt;

&lt;p&gt;A variable can be accessed from any part of the code that is called by the same execution context. It's important to note that every time a function is called, a new execution context is created.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function outer() {
  const message = "Hello, world!";

  function inner() {
    console.log(message); // This will also log "Hello, world!"
  }

  setTimeout(inner, 1000); 
}

outer();

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

&lt;/div&gt;



&lt;p&gt;In this example, the variable &lt;code&gt;message&lt;/code&gt; is still declared inside the &lt;code&gt;outer&lt;/code&gt; function, but it is also accessible inside the &lt;code&gt;inner&lt;/code&gt; function, which is called by the &lt;code&gt;setTimeout&lt;/code&gt; function after a delay of 1000 milliseconds. Since &lt;code&gt;inner&lt;/code&gt; is called by the same call stack as &lt;code&gt;outer&lt;/code&gt;, it can access the &lt;code&gt;message&lt;/code&gt; variable even though it is not in its lexical scope.&lt;/p&gt;

&lt;p&gt;To sum up, the main difference between lexical and in-memory scope is that lexical scoping is determined at compile-time and remains fixed at runtime, whereas in-memory scoping is determined at runtime and can be changed during the execution of the program.  &lt;/p&gt;

&lt;p&gt;I hope this article has provided you clarity on this crucial topic in computing, &amp;amp; thank you for reading!&lt;/p&gt;




&lt;h4&gt;
  
  
  &lt;a href="https://www.pexels.com/photo/photo-of-led-signage-on-the-wall-942317/"&gt;Photo by Tim Mossholder from Pexels&lt;/a&gt;
&lt;/h4&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Conditional Statements: A Quick Intro</title>
      <dc:creator>Gabrielle J.</dc:creator>
      <pubDate>Fri, 10 Mar 2023 16:48:27 +0000</pubDate>
      <link>https://dev.to/gabetronic/conditional-statements-a-quick-intro-705</link>
      <guid>https://dev.to/gabetronic/conditional-statements-a-quick-intro-705</guid>
      <description>&lt;p&gt;Image Description: &lt;a href="" class="article-body-image-wrapper"&gt;&lt;img alt="A large wooden hand controls white strings tied to a small wooden mannequin's limbs"&gt;&lt;/a&gt; Photo by &lt;a href="https://unsplash.com/@agni11?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Sivani Bandaru&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/bczrpU9n8f4?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Think back to all of the police procedural dramas you may have binged on...the one thing that always gets the criminal to confess is the detective's line of questioning.  The questions flow in a logical, controlled manner, slowly narrowing what the criminal can truthfully speak to. &lt;/p&gt;

&lt;p&gt;With conditional statements, you can mirror your favorite detective's method of manually controlling the flow of what JavaScript should evaluate next. &lt;/p&gt;

&lt;p&gt;This post covers the most basic of conditionals -- &lt;em&gt;if...else statements&lt;/em&gt; and &lt;em&gt;switch statements&lt;/em&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  If...else statements
&lt;/h3&gt;

&lt;p&gt;There are three stages to if...else statements. &lt;/p&gt;

&lt;p&gt;The first stage is an &lt;em&gt;if-statement&lt;/em&gt;. It says if the code you write resolves to true, then execute the code block attached to the statement.  &lt;/p&gt;

&lt;p&gt;Here is an example of this process in action:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let x = "Sunday";

// if x equals either Monday or Tuesday,
if(x === "Monday" || x === "Tuesday"){

//execute this code
  console.log("It's the start of the week.");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;If the if-statement evaluates to false, a new condition and code block are outlined in the &lt;em&gt;else-if statement&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Although there can only be one if-statement, you can write many else-if statements depending on your line of questioning.  &lt;/p&gt;

&lt;p&gt;The else-if statement follows the same logic as the if-statement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//else if x equals Wednesday or Thursday,
else if(x === "Wednesday" || x === "Thursday"){

//execute this code
  console.log("It's the middle of the week.");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;The final statement, the &lt;em&gt;else statement&lt;/em&gt;, provides a set of instructions to be executed in the event that all statements before it evaluate to false.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//if all else fails, execute this code
else{
  console.log("It's the weekend, I'm taking a break!");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Switch Statements
&lt;/h3&gt;

&lt;p&gt;Based on whether the conditions are true or false, a switch statement can present many different conditions and instructions to follow.  &lt;/p&gt;

&lt;p&gt;Read the code below to get a step-by-step example of a switch statement’s structure.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let y = "cerulean blue";

// the variable y is an expression that the statement will try to match with each case 
switch(y){

//if y matches this case,
  case "vermilion":

//execute this code
    console.log("These are half off!");

//break statements stop the evaluation, and point JavaScript towards the next case 
    break;

//you can group cases together if you want them to produce the same outcome
  case "black":
  case "forest green": 
    console.log(`Do you mean this one?`)
    break;
  case "cerulean blue":
    console.log("Is this it?");
    break;

//default statements serve the same purpose as the else statement - if all else fails,       
  default:
    //execute this code
    console.log("Sorry, we're out of stock in that color!");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;And that’s it!  &lt;/p&gt;

&lt;p&gt;Hopefully, this article has given you a quick and easy rundown of what conditional statements are – a line of controlled questioning developed by you, the developer, that allows JavaScript to take different actions based on its evaluation of the conditions you’ve given it. &lt;/p&gt;

&lt;p&gt;I appreciate your time spent reading this, and if you have feedback, let me know!&lt;/p&gt;

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