<?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: Sebastien Sanz de Santamara</title>
    <description>The latest articles on DEV Community by Sebastien Sanz de Santamara (@sebsanzdesant).</description>
    <link>https://dev.to/sebsanzdesant</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%2F175326%2Fb3bf3ebd-83dc-4ebe-9235-c77ad4621992.jpeg</url>
      <title>DEV Community: Sebastien Sanz de Santamara</title>
      <link>https://dev.to/sebsanzdesant</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sebsanzdesant"/>
    <language>en</language>
    <item>
      <title>An Intro to Debian &amp; Ubuntu</title>
      <dc:creator>Sebastien Sanz de Santamara</dc:creator>
      <pubDate>Mon, 16 Sep 2019 16:43:04 +0000</pubDate>
      <link>https://dev.to/sebsanzdesant/debian-ubuntu-a-beginners-intro-1h40</link>
      <guid>https://dev.to/sebsanzdesant/debian-ubuntu-a-beginners-intro-1h40</guid>
      <description>&lt;p&gt;Taking a brief look into two popular linux operating systems, Debian and Ubuntu. &lt;/p&gt;

&lt;p&gt;As a newcomer, peeking at the current state of the linux operating system world may induce a degree of vertigo. &lt;/p&gt;

&lt;p&gt;Generally the world is simple when choosing a computer operating system, most everyone pics a side with Mac OS and Windows, and then Linux. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lU_zb4D3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/t9w3t1wny3003d8q88ik.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lU_zb4D3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/t9w3t1wny3003d8q88ik.gif" alt="" width="500" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While Apple &amp;amp; Microsoft focus their resources on delivering updates to only one version of their operating systems at a time (Windows XP, 98, 7, or Mac OS 9, Snow Leopard, Mojave, etc..), Linux distributions is a vast chasm of myriads of instances, flavors, and mutations of the OS; each engineered to do different things.. or more often then not, do the same things differently. &lt;/p&gt;

&lt;p&gt;Linux distributions is so rich and diverse, it resembles the vastness of code repositories found on versioning control services like Github. In fact, its no surprise that the Git versioning system was created by Linus Torvalds, the creator of the Linux kernel. &lt;/p&gt;

&lt;p&gt;There are a gazillion-trillion linux distributions available. Actaully 898:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--44jxEbr---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/zvsrsc8uqr41bcqcy849.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--44jxEbr---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/zvsrsc8uqr41bcqcy849.png" alt="" width="880" height="635"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Today we're going to take a comparative look at two most popular of distributions, Ubuntu, and its original parent OS called Debian. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.debian.org/"&gt;Debian&lt;/a&gt; is one of the first original Linux distros developed in 1993, and &lt;a href="https://ubuntu.com/"&gt;Ubuntu&lt;/a&gt;, a fork of Debian, came into light in 2004, 11 years later.&lt;/p&gt;

&lt;h1&gt;
  
  
  Releases
&lt;/h1&gt;

&lt;p&gt;Version releases for these to flavors are noticeably different. While Debian has been around for longer, its latest version rests at 10, while Ubuntu has nearly twice the amount. This is because Debian is supported by a volunteer-based community that strictly adheres to an open-source ethos. Ubuntu, while also open source driven, is actively maintained by Canonical, a private company that also sells enterprise style services.&lt;/p&gt;

&lt;p&gt;Debian always has at least three releases in active maintenance:  stable (currently Buster), testing (Bullseye) and (Sid) unstable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--P3mMEijm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/48b9r1oe0dd0aoxfxr8p.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P3mMEijm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/48b9r1oe0dd0aoxfxr8p.jpg" alt="" width="880" height="587"&gt;&lt;/a&gt;&lt;br&gt;
Debian Unstable is permanently named Sid after the boy next door in Toy Story 1 who liked to destroy toys. Use at your own risk!&lt;/p&gt;

&lt;p&gt;Ubuntu abides by a strict release schedule but with more frequency introducing a release every six months and an LTS – Long Term Support release every two years.&lt;/p&gt;

&lt;h1&gt;
  
  
  Compatibility and Management
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--V4QE0QSJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/6wdkcnt89qa2uwqej98h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--V4QE0QSJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/6wdkcnt89qa2uwqej98h.png" alt="" width="761" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Both flavors use the same software packaging system called "apt", but the difference lies with the delivery and inclusion (or not) of proprietary software. Debian explicitly promotes free and open source software and hardware drivers, and does not include proprietary software by default. &lt;/p&gt;

&lt;p&gt;This means that Debian, in certain occasions, can be restrictive to what type of hardware or apps you want to use with it, and while there are work-arounds, the process is not for the faint of heart. &lt;/p&gt;

&lt;p&gt;On the other hand, Ubuntu bundles a variety of open, closed, free, or licensed software giving more flexibility. &lt;/p&gt;

&lt;h1&gt;
  
  
  Performance
&lt;/h1&gt;

&lt;p&gt;For me , an appealing factor about a Linux distro is the efficient use of resources and often lightning fast performance compared to Windows or Mac. &lt;/p&gt;

&lt;p&gt;Ubuntu is noticeably faster then Windows or Mac, but slow compared to Debian. This is because Ubuntu's desktop environment and specific items like its Accounts features and GUI does affect performance. Debian on the other hand, is just bare-bones, thus super fast and lightweight at the expense of a kinder/gentler user experience. &lt;/p&gt;

&lt;h1&gt;
  
  
  Which one is better?
&lt;/h1&gt;

&lt;p&gt;Like all things development/programming/code, it depends on the problem you are trying to solve. &lt;/p&gt;

&lt;p&gt;Ubuntu provides a solid desktop experience that competes with the likes of Windows or Mac, but sacrifices some the open-source ethos that Linux, as a concept, stands up to. Canonical is a privately owned company that does in fact provide services at cost. &lt;/p&gt;

&lt;p&gt;Debian provides strict security and low use of resources, all while adhering and being maintained by the open-source community, at the cost of ease of use.. &lt;/p&gt;

&lt;p&gt;In general the latter is an ideal environment for a more experienced user who wants much more control and configuration, while the former is an ideal solution to the consumer / beginner user looking to get their feet wet.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>ubuntu</category>
      <category>debian</category>
    </item>
    <item>
      <title>Rails Setup on Ubuntu 19.04</title>
      <dc:creator>Sebastien Sanz de Santamara</dc:creator>
      <pubDate>Thu, 13 Jun 2019 19:31:13 +0000</pubDate>
      <link>https://dev.to/sebsanzdesant/rails-setup-on-ubuntu-19-04-disco-dingo-2ccl</link>
      <guid>https://dev.to/sebsanzdesant/rails-setup-on-ubuntu-19-04-disco-dingo-2ccl</guid>
      <description>&lt;p&gt;Around this time last year we soft released the first version of &lt;a href="https://rivet.es/"&gt;Rivet&lt;/a&gt;, a marketplace designed to find and activate resources for the development of creative practices. &lt;/p&gt;

&lt;p&gt;I asked our developer, the amazing &lt;a href="https://frnsys.com/"&gt;Francis Tseng&lt;/a&gt;, to teach me how to setup a local development environment so that I could &lt;em&gt;a)&lt;/em&gt; make copy edits to our view templates and &lt;em&gt;b)&lt;/em&gt; learn how the system works with the (at the time) far fetched idea that one day I could maintain the product and build new features. &lt;/p&gt;

&lt;p&gt;The first challenge was to get my hands on a Unix based operating system. This meant I either had to setup a Linux distro via a Virtual Machine on my Windows machine, or just wipe the hard drive and go full Linux. &lt;/p&gt;

&lt;p&gt;Since I like to do things the hard way, I chose the latter and after many(and i mean many) installs of various linux distros, I've settled, for the moment, with &lt;a href="https://ubuntu.com/"&gt;good old Ubuntu&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;As such, today I want to share how to setup a Ruby on Rails local development environment on a Linux machine running Ubuntu 19.04 Disco Dingo: &lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Install the latest version of Ruby.
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;There may be a need to work with older versions of the Ruby language depending on your project, no worries, you'll be able to add them after this initial setup with rbenv(see more below).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;First, we need to make sure you have all the dependencies required for both Ruby and Rails.&lt;/p&gt;

&lt;p&gt;In your terminal, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install curl
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

sudo apt-get update
sudo apt-get install git-core zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev nodejs yarn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Next:
&lt;/h2&gt;

&lt;p&gt;Install Ruby using the version managing tool called &lt;a href="https://github.com/rbenv/rbenv"&gt;rbenv&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;em&gt;Note&lt;/em&gt; you can also use another manager called &lt;a href="https://rvm.io/"&gt;rvm&lt;/a&gt;, but personally I had an easier experience with rbenv.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In your terminal, punch in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' &amp;gt;&amp;gt; ~/.bashrc
echo 'eval "$(rbenv init -)"' &amp;gt;&amp;gt; ~/.bashrc
exec $SHELL

git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' &amp;gt;&amp;gt; ~/.bashrc
exec $SHELL

rbenv install 2.6.3
rbenv global 2.6.3
ruby -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The last 3 lines are important here because once you have rbenv setup, you can install other versions of ruby and switch between them per your development needs.&lt;/p&gt;

&lt;p&gt;The below example will install ruby 2.5.1 and set it as the local version for a specific application you may be working on. &lt;em&gt;Make sure you're in the working folder of your app.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rbenv install 2.5.1
rbenv local 2.5.1

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

&lt;/div&gt;



&lt;p&gt;Last but not least, install Bundler so you can package ruby gems to your hearts content.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gem install bundler
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;rbenv users need to run &lt;code&gt;rbenv rehash&lt;/code&gt; in your terminal after installing bundler.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2 - Configure Git
&lt;/h2&gt;

&lt;p&gt;For versioning control of your code, we have to setup Git with your account info (for this tutorial, we're using a Github account):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global color.ui true
git config --global user.name "YOUR NAME"
git config --global user.email "YOUR@EMAIL.com"
ssh-keygen -t rsa -b 4096 -C "YOUR@EMAIL.com"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The last step generated a new SSH key for you and your machine. Copy the output of your key from the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat ~/.ssh/id_rsa.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and paste it in &lt;a href="https://github.com/settings/ssh"&gt;your Github settings here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then go back to your terminal to see if it works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -T git@github.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hi (username)! You've successfully authenticated, but GitHub does not provide shell access.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Installing Rails
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;gem install rails -v 6.0.0.rc1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Since we are using &lt;code&gt;rbenv&lt;/code&gt;, run the following command to make &lt;code&gt;rails&lt;/code&gt; executable available:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rbenv rehash&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;With Rails installed, you can run the &lt;code&gt;rails -v&lt;/code&gt; to check if the version installed installed correctly:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rails -v&lt;/code&gt;&lt;br&gt;
&lt;code&gt;# Rails 6.0.0.rc1&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Setup PostgreSQL
&lt;/h2&gt;

&lt;p&gt;Rails comes with SQLlite out of the box, very practical.. but if you want to deploy your app to a service like Heroku, you will need to use PostgreSQL. &lt;/p&gt;

&lt;p&gt;To set up PostgreSQL, first we'll need to add a repository to your machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install postgresql-11 libpq-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, you'll need to setup a user with permissions to create databases locally.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo -u postgres createuser username_of_ur_choice -s

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

&lt;/div&gt;



&lt;p&gt;You can also (not required) set a password for this user, then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo -u postgres psql
postgres=# \password username_of_ur_choice
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  And now, drum-roll...
&lt;/h2&gt;

&lt;p&gt;Lets create your first Rails app!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## Using SQLite
rails new myapp

## Using Postgres
rails new myapp -d postgresql

# Move into the application directory
cd myapp

# Note - If your Postgres is installed with a username/password, modify the
# config/database.yml file in your ruby app folder to include the username/password you defined when setting up postgresql

# Create the database
rake db:create

# Moment of truth
rails server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Go to &lt;a href="http://localhost:3000"&gt;http://localhost:3000&lt;/a&gt; on any browser of your Disco Dingo install to view your locally deployed install of Ruby on Rails! &lt;/p&gt;

&lt;p&gt;You should see: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xlRaWcwC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://edgeguides.rubyonrails.org/images/getting_started/rails_welcome.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xlRaWcwC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://edgeguides.rubyonrails.org/images/getting_started/rails_welcome.png" alt="Yay! You're on Rails"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that you're up and running, it's time to start building your awesome application/s.&lt;/p&gt;

</description>
      <category>ubuntu</category>
      <category>linux</category>
      <category>ruby</category>
      <category>rails</category>
    </item>
    <item>
      <title>Sinatra, No One Cares</title>
      <dc:creator>Sebastien Sanz de Santamara</dc:creator>
      <pubDate>Tue, 14 May 2019 15:21:09 +0000</pubDate>
      <link>https://dev.to/sebsanzdesant/no-one-cares-sinatra-a-ruby-micro-framework-3kio</link>
      <guid>https://dev.to/sebsanzdesant/no-one-cares-sinatra-a-ruby-micro-framework-3kio</guid>
      <description>&lt;p&gt;&lt;a href="http://sinatrarb.com/" rel="noopener noreferrer"&gt;Sinatra&lt;/a&gt; is a Ruby low-level micro-framework.&lt;/p&gt;

&lt;p&gt;What is a framework? Glad you asked!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A software framework is an &lt;a href="https://en.wikipedia.org/wiki/Abstraction_(computer_science)" rel="noopener noreferrer"&gt;abstraction&lt;/a&gt; in which &lt;a href="https://en.wikipedia.org/wiki/Software" rel="noopener noreferrer"&gt;software&lt;/a&gt; providing generic functionality can be selectively changed by additional user-written code, thus providing application-specific software. A software framework provides a standard way to build and deploy applications.&lt;br&gt;&lt;br&gt;
&lt;a href="https://en.wikipedia.org/wiki/Software_framework" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Software_framework&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Sinatra, as a framework, lets you &lt;a href="https://en.wikipedia.org/wiki/Create,_read,_update_and_delete" rel="noopener noreferrer"&gt;CRUD&lt;/a&gt; within a &lt;a href="https://restfulapi.net/" rel="noopener noreferrer"&gt;RESTful&lt;/a&gt; structure, thus Creating, Reading, Updating, and Deleting data via a web browser. It does this through standardized RESTful conventions like GET and POST. With Sinatra, you can make things like a simple website, blog, or barebones content management system.&lt;/p&gt;

&lt;p&gt;As our mod geared up towards Sinatra, some peers from earlier mods I’ve spoken to described this little framework with a slight tinge of disdain, as in “Eww, you’re going to start using Sinatra”. And any time someone made an icky face about Sinatra to a noob like myself, it reminded me of the album cover for Frank’s seminal work &lt;a href="https://en.wikipedia.org/wiki/No_One_Cares" rel="noopener noreferrer"&gt;“No One Cares”&lt;/a&gt;, a collection of heart-brake and love-struck songs depicting how even a staple like Sinatra himself, also gets no love.&lt;/p&gt;

&lt;p&gt;I couldn’t help correlating lonely Frank and the relationship some programmers might share with Sinatra versus Rails.&lt;/p&gt;

&lt;p&gt;But despite said pity party, lets take a look at some statistics showing how Sinatra actually holds it's own in the framework field.&lt;/p&gt;

&lt;p&gt;Sinatra's usage is only a &lt;a href="https://infinum.co/the-capsized-eight/analyzing-rubygems-stats-v2016" rel="noopener noreferrer"&gt;mere 95% less than Rails&lt;/a&gt; in 2016, but that means it’s being used by 5% of the Ruby framework market and that’s not a negligible number in any market. More so, it &lt;a href="http://bestgems.org/search?q=sinatra" rel="noopener noreferrer"&gt;ranks 73rd place&lt;/a&gt; in Ruby Gem usage in 2018. Not bad considering there are at total &lt;em&gt;152,505&lt;/em&gt; gems available.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1000%2F1%2AsSoL48R1roxvic0N25co7g.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1000%2F1%2AsSoL48R1roxvic0N25co7g.jpeg"&gt;&lt;/a&gt;from: &lt;a href="https://infinum.co/the-capsized-eight/analyzing-rubygems-stats-v2018" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://infinum.co/the-capsized-eight/analyzing-rubygems-stats-v2018" rel="noopener noreferrer"&gt;https://infinum.co/the-capsized-eight/analyzing-rubygems-stats-v2018&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This goes to show that Sinatra is a robust little tool, and therefore when comparing it with Ruby, would be more suited toward something like the below image:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AqNr0r_1DS6fkZyFjRuFN2Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AqNr0r_1DS6fkZyFjRuFN2Q.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here lies the importance of getting comfortable with Sinatra before jumping into larger frameworks. When your hardware store is closed or your power tools are broken, having a deeply rooted skillset to solve challenges (because you’ve solved them with a simpler tool like a foldable knife) is crucial. &lt;/p&gt;

&lt;p&gt;Beyond that, it also helps you understand and thus deeply appreciate a framework like Rails. Having a good base of experience with Sinatra will allow you to program better with larger, more complex tools. It will help you find solutions to bugs and challenges you'll hit in the future.&lt;/p&gt;

&lt;p&gt;Lastly, Sinatra is ideal for projects that don't require all the bells and whistles Rails provides. Sometimes you don't need an 18v lithium powered cordless hammer drill/driver, a pocket knife will do.&lt;/p&gt;

&lt;p&gt;Using Sinatra, through its simplicity, may even evoke the words of &lt;a href="https://www.amazon.com/gp/customer-reviews/RK1QZGY5AXJZV/ref=cm_cr_dp_d_rvw_ttl?ie=UTF8&amp;amp;ASIN=B00005UMTA" rel="noopener noreferrer"&gt;this Amazon reviewer&lt;/a&gt; for &lt;em&gt;“No One Cares”,&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Frank is so good that he can put you in the mood whether you were in that mood to begin with or not.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Check out &lt;a href="http://sinatrarb.com/wild.html" rel="noopener noreferrer"&gt;this awesome long list of apps, tools, and websites using Sinatra.&lt;/a&gt;&lt;/p&gt;

</description>
      <category>sinatra</category>
      <category>ruby</category>
      <category>frameworks</category>
    </item>
    <item>
      <title>Writing JOINS in SQL</title>
      <dc:creator>Sebastien Sanz de Santamara</dc:creator>
      <pubDate>Sun, 05 May 2019 20:33:19 +0000</pubDate>
      <link>https://dev.to/sebsanzdesant/writing-joins-in-sql-2jof</link>
      <guid>https://dev.to/sebsanzdesant/writing-joins-in-sql-2jof</guid>
      <description>&lt;p&gt;Week two at Flatiron School had us jumping straight into SQL. I was keen to learn more about SQL since I have experience running Wordpress sites, like the artist residency program I co-founded, &lt;a href="http://residencyunlimited.org"&gt;Residency Unlimited&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;I have spent unhealthy amounts of time googling SQL queries to figure out, for example, how to &lt;a href="https://stackoverflow.com/questions/12090643/is-it-possible-to-convert-wordpress-custom-post-type-to-normal-categories"&gt;assign single posts from one post-type to another&lt;/a&gt; in phpMyAdmin (and back again, yuck!).&lt;/p&gt;

&lt;p&gt;With a deeper grasp of databases and their management via SQL, I find it easier to grasp Object Orientated Programming and particularly value how &lt;a href="https://guides.rubyonrails.org/active_record_basics.html#crud-reading-and-writing-data"&gt;Active Record&lt;/a&gt; streamlines the process between a database and your code.&lt;/p&gt;

&lt;p&gt;Databases themselves are about as exhilarating as tanks of gas, but that’s ok, they don’t need to be exciting. Their purpose is to hold the fuel (in our case, content) that our car needs to function. SQL is a means to get the gas from tank to engine.&lt;/p&gt;

&lt;p&gt;Lets dive into SQL JOINs by observing the following situation:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--J8tcGSmL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ADF0XIwYg7Q869rfaEnCPOQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--J8tcGSmL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ADF0XIwYg7Q869rfaEnCPOQ.jpeg" alt="" width="880" height="473"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This diagram shows us how we can apply a JOIN to the above scenario.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iQNDUT0W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/880/1%2AtkL0F_oELYKwwCxlrgbGXg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iQNDUT0W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/880/1%2AtkL0F_oELYKwwCxlrgbGXg.png" alt="" width="880" height="674"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A JOIN in SQL returns rows from multiple tables by identification through these three sections: INNER, LEFT, and RIGHT.&lt;/p&gt;

&lt;p&gt;Let’s take a look at how different JOIN types do different things.&lt;/p&gt;

&lt;h3&gt;
  
  
  INNER JOIN
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--avts1Is8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/880/1%2ARoq-OQxi010NUBWh36AQgA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--avts1Is8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/880/1%2ARoq-OQxi010NUBWh36AQgA.png" alt="" width="880" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;INNER JOIN — or simply JOIN, can be used to find a match between two tables. Both tables need to share a key. This key is used to make the match. Non-matching results are discarded.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT \*
FROM TableD Dogs 
INNER JOIN TableC Car
ON Dogs.key = Car.key;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  LEFT JOIN
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wlS85gfJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/880/1%2AT4IoI65u3nBn2keU0vSm8A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wlS85gfJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/880/1%2AT4IoI65u3nBn2keU0vSm8A.png" alt="" width="880" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;LEFT JOIN — Returns all rows from the left table, and the matched rows from the right table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT \*
FROM TableD Dogs 
LEFT JOIN TableC Cars
ON Dogs.key = Cars.key;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g62wYZty--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/880/1%2A6gZu4qf-c-3bWWgZ7DXogg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g62wYZty--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/880/1%2A6gZu4qf-c-3bWWgZ7DXogg.png" alt="" width="880" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also add a WHERE clause to return only rows from the outer section:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT \*
FROM TableD Dogs 
LEFT JOIN TableC Cars
ON Dogs.key = Cars.key
WHERE Cars.key IS NULL;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  RIGHT JOIN
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Px4RkvW4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/880/1%2AlYwaXVtrx1Wt6U-V0ILbQQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Px4RkvW4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/880/1%2AlYwaXVtrx1Wt6U-V0ILbQQ.png" alt="" width="880" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;RIGHT JOIN — The same as LEFT, but in reverse. Returns all rows from the right table, and the matched rows from the left table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT \*
FROM TableD d 
RIGHT JOIN TableC c
ON c.key = d.key;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qs2LIs66--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/880/1%2AQ90C8gmhlxnygy7L5hR9aQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qs2LIs66--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/880/1%2AQ90C8gmhlxnygy7L5hR9aQ.png" alt="" width="880" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And like in the previous example, return only rows from the outer section.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT \*
FROM TableD Dogs 
RIGHT JOIN TableC Cars
ON Dogs.key = Cars.key
WHERE Dogs.key IS NULL;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  FULL OUTER JOIN
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I7gq6U6r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/880/1%2ASPde8BXaYD697DMciPZhAw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I7gq6U6r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/880/1%2ASPde8BXaYD697DMciPZhAw.png" alt="" width="880" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;FULL OUTER JOIN — Returns all rows when there is a match in ONE of the tables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT \*
FROM TableD Dogs 
FULL OUTER JOIN TableC Cars
ON Dogs.key = Cars.key;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pv8xwZ8X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/880/1%2AFkWYT9uS6h0TkJkH81Gd3g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pv8xwZ8X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/880/1%2AFkWYT9uS6h0TkJkH81Gd3g.png" alt="" width="880" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Just want OUTER JOINS, excluding INNER?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT \*
FROM TableD Dogs 
FULL OUTER JOIN TableC Cars
ON Dogs.key = Cars.key
WHERE Dogs.key IS NULL
OR Cars.key IS NULL;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Why is this important?
&lt;/h3&gt;

&lt;p&gt;It reflects the DRY (Don’t Repeat Yourself) rule.&lt;/p&gt;

&lt;p&gt;Only using INNER JOINs on every query returns a unique match discarding any non-matching entry. There is no way to know which dogs have never been in a car, or which car has never had a dog in it. You quickly find yourself going back and forth to find that specific information when you need it.&lt;/p&gt;

&lt;p&gt;Using LEFT, RIGHT or FULL JOINs provides more detail in one fell swoop, resulting in faster insight to what your database contains and how its contents are related.&lt;/p&gt;

&lt;h3&gt;
  
  
  Other JOINS
&lt;/h3&gt;

&lt;p&gt;There are other operators in SQL that help you parse rows. For example, using CROSS will join everything with everything, and UNION joins the results of two queries into one column and removes duplicate entries.&lt;/p&gt;

&lt;p&gt;Check out &lt;a href="https://www.w3schools.com/sql/sql_join.asp"&gt;SQL definitions on W3schools&lt;/a&gt; and try out your &lt;a href="https://www.hackerrank.com/domains/sql?filters%5Bsubdomains%5D%5B%5D=join"&gt;JOIN skills on Hack Array.&lt;/a&gt;&lt;/p&gt;

</description>
      <category>database</category>
      <category>sql</category>
      <category>joins</category>
    </item>
  </channel>
</rss>
