<?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: Joshua Rutkowski </title>
    <description>The latest articles on DEV Community by Joshua Rutkowski  (@josh).</description>
    <link>https://dev.to/josh</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%2F232669%2F6c8738ca-6ef4-4641-a5b7-abbecfdf667a.jpeg</url>
      <title>DEV Community: Joshua Rutkowski </title>
      <link>https://dev.to/josh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/josh"/>
    <language>en</language>
    <item>
      <title>Which Star Trek technologies do you want to see come to life?</title>
      <dc:creator>Joshua Rutkowski </dc:creator>
      <pubDate>Fri, 27 Sep 2019 14:51:43 +0000</pubDate>
      <link>https://dev.to/josh/which-star-trek-technologies-do-you-want-to-see-come-to-life-4mj6</link>
      <guid>https://dev.to/josh/which-star-trek-technologies-do-you-want-to-see-come-to-life-4mj6</guid>
      <description>&lt;p&gt;On September 8, 1966, NBC aired the first episode of a new TV series about a starship on a five year mission of space exploration. Since then, the Star Trek universe has coninued to feature amazing "futuristic" technologies.&lt;/p&gt;

&lt;p&gt;Some technologies that we've now seen developed: &lt;/p&gt;

&lt;p&gt;✔️ Tablet computers&lt;br&gt;
✔️ Tricorders (mobile phones)&lt;br&gt;
✔️ Voice-interface computers&lt;br&gt;
✔️ Wearable computers/communicators&lt;br&gt;
✔️ Portable memory&lt;/p&gt;

&lt;p&gt;What are some things seen in Star Trek that you'd like to see finally developed? &lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
    <item>
      <title>A 4-day workweek?</title>
      <dc:creator>Joshua Rutkowski </dc:creator>
      <pubDate>Fri, 27 Sep 2019 11:13:32 +0000</pubDate>
      <link>https://dev.to/josh/a-4-day-workweek-1j4j</link>
      <guid>https://dev.to/josh/a-4-day-workweek-1j4j</guid>
      <description>&lt;p&gt;Recently, I came across the following article on &lt;a href="https://www.vox.com/2019/9/13/20862246/future-of-work-4-day-workweek"&gt;The case for a 4-day workweek&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;What are your thoughts? How would your productivity alter by working one less day per week but getting paid the same? 💵&lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
    <item>
      <title>Intro to Swift: Strings and Arithmetic</title>
      <dc:creator>Joshua Rutkowski </dc:creator>
      <pubDate>Fri, 27 Sep 2019 10:35:41 +0000</pubDate>
      <link>https://dev.to/josh/intro-to-swift-strings-and-arithmetic-17a8</link>
      <guid>https://dev.to/josh/intro-to-swift-strings-and-arithmetic-17a8</guid>
      <description>&lt;p&gt;In this lesson, you’ll learn some of the fundamentals for using strings and arithmetic in Swift. &lt;/p&gt;

&lt;h4&gt;
  
  
  Objectives:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Learn to create static strings using string literal syntax&lt;/li&gt;
&lt;li&gt;Learn to concatenate strings&lt;/li&gt;
&lt;li&gt;Learn to use string interpolation to include variable values in a string&lt;/li&gt;
&lt;li&gt;Learn to use arithmetic operators to add, subtract, multiply, and divide variables&lt;/li&gt;
&lt;li&gt;Learn to use comments to make code easier to understand&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Note: This lessons roughly follows along Lambda School's iOS 101 precourse work. For additional information on Lambda School's iOS Development course, &lt;a href="https://lambdaschool.com/courses/ios-development"&gt;click here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Learn to create static strings using string literal syntax
&lt;/h1&gt;

&lt;p&gt;A string is a series of characters, such as "hello, world" or "starship". 🚀&lt;/p&gt;

&lt;p&gt;Swift strings are represented by the String type. The simplest way to create a string in Swift is to use a string literal. A string literal is a sequence of characters surrounded by double quotation marks ("). For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Benjamin Sisko"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Note that Swift infers a type of &lt;code&gt;String&lt;/code&gt; for the &lt;code&gt;name&lt;/code&gt; constant because it’s initialized with a string literal value. In the above example,  "Benjamin Sisko" is a string literal. You use string literals to initialize string constants or variables, but you can also use them anywhere a string is required. &lt;/p&gt;

&lt;h3&gt;
  
  
  Multi-line String Literals
&lt;/h3&gt;

&lt;p&gt;If you need a string that spans several lines, use a multiline string literal—a sequence of characters surrounded by three double quotation marks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;picardQuotation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"""
Someone once told me that time was a predator that stalked us all our lives. 
I rather believe that time is a companion who goes with us on the journey 
and reminds us to cherish every moment, because it will never come again. 

What we leave behind is not as important as how we've lived. 
After all Number One, we're only mortal.
"""&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;It’s important that the string start on the next line after the opening quotes, and that the closing quotes also are on the line after the end of the string.&lt;/p&gt;

&lt;h1&gt;
  
  
  Learn to concatenate strings
&lt;/h1&gt;

&lt;p&gt;Concatenation refers to combining two or more strings together to make a new string. To concatenate strings in Swift, you use the + operator.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;string1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Live long"&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;string2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"prosper"&lt;/span&gt;

&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;spockGreeting&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;string1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" and "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;string2&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;spockGreeting&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;//Live long and prosper&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  Learn to use string interpolation to include variable values in a string
&lt;/h1&gt;

&lt;p&gt;String interpolation allows you create a string that includes the value of constants or variables. Let's say you have an integer that represents the number of starships Starfleet has. 🚀&lt;/p&gt;

&lt;p&gt;You want to print a string that says “Starfleet has ___ starships.”. String interpolation can be used to create this string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;numberOfShips&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;450&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;stringToPrint&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Starfleet has &lt;/span&gt;&lt;span class="se"&gt;\(&lt;/span&gt;&lt;span class="n"&gt;numberOfShips&lt;/span&gt;&lt;span class="se"&gt;)&lt;/span&gt;&lt;span class="s"&gt; starships."&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stringToPrint&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;//Startfleet has 450 starships.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;In the example above, the value of &lt;code&gt;numberOfShips&lt;/code&gt; is inserted into a string literal as &lt;code&gt;\(numberOfShips)&lt;/code&gt;. This placeholder is replaced with the actual value of &lt;code&gt;numberOfShips&lt;/code&gt; when the string interpolation is evaluated to create an actual string.&lt;/p&gt;

&lt;h1&gt;
  
  
  Learn to use arithmetic operators to add, subtract, multiply, and divide variables
&lt;/h1&gt;

&lt;p&gt;There are four basic arithmetic operators: add (+), subtract (-), multiply (*), and divide (/). You can use them directly on numbers, or on constants or variables. &lt;/p&gt;

&lt;h3&gt;
  
  
  Addition, subtraction, and multiplication
&lt;/h3&gt;

&lt;p&gt;These operators work the way you’d expect. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;answer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;14&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;

&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;birthYear&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1901&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;currentYear&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2019&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;currentYear&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;birthYear&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Division
&lt;/h3&gt;

&lt;p&gt;Remember &lt;a href="https://dev.to/josh/intro-to-swift-1d50"&gt;from our previous lesson&lt;/a&gt; that &lt;code&gt;Int&lt;/code&gt; (and &lt;code&gt;UInt&lt;/code&gt;) values can only store whole numbers. When you divide two &lt;code&gt;Ints&lt;/code&gt;by each other, the result will also be an &lt;code&gt;Int&lt;/code&gt;, and will be the result of the division rounded down to the nearest whole number.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; 
&lt;span class="nf"&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;span class="c1"&gt;// 2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If you’re doing division and need fractional values, you should use floating point numbers (&lt;a href="https://dev.to/josh/intro-to-swift-1d50"&gt;see previous lesson&lt;/a&gt; on type annotations):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Double&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Double&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;
&lt;span class="nf"&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;span class="c1"&gt;// 2.5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  Learn to use comments to make code easier to understand
&lt;/h1&gt;

&lt;p&gt;You should always strive to write code that is clear and easy for humans to understand. Usually, this should mean that the code itself is nicely written, well-formatted, your variables have carefully chosen names, etc. &lt;/p&gt;

&lt;p&gt;However, sometimes, it’s useful to be able to write little comments to explain what a particular part of the code is doing. Comments are notes to you or another future reader of the code, but the compiler ignores them.&lt;/p&gt;

&lt;p&gt;There are two ways to create comments in Swift. You can create a comment on the same line as some code by prefixing your comment with two forward slashes ():&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;birthYear&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1988&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;currentYear&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2019&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;currentYear&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;birthYear&lt;/span&gt; &lt;span class="c1"&gt;// Calculate current age&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Anything after the slashes will be ignored until the next line break.&lt;/p&gt;

&lt;p&gt;If you want to write a comment that spans multiple lines, you can put your comments between /*and */:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="cm"&gt;/* This is a longer comment.
It has multiple lines.
The compiler ignores everything here.
*/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  Challenge
&lt;/h1&gt;

&lt;p&gt;Now it's your turn! Go ahead and try the following challenges and post your results below! Don't have macOS to run your Swift code? No worries, head on over to &lt;a href="//www.repl.it"&gt;repl.it&lt;/a&gt; - an online Swift Editor and IDE!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;String Literals&lt;/strong&gt;: Create a string literal constant introducing yourself. Your introduction should include your name, where you're from, what you like to do for fun, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;String Concatenation&lt;/strong&gt;: Create a constant for your favorite vacation destination. Using string concatenation, print out a string that says "I love to travel to [favorite travel destination]."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;String Interpolation&lt;/strong&gt;: Using the constant you created above, print out the same string: "I love to travel to [favorite travel destination]." using string interpolation&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Calorie Goal&lt;/strong&gt;: Below you have constants for the number of calories you burned each day over the last week. Using simple arithmetic find the average number of calories burned. Add 100 calories to the average and use string interpolation to print out "Your new move goal for the week is [your calculated goal].&lt;/p&gt;

&lt;p&gt;&lt;code&gt;let mondayCalories = 340&lt;/code&gt;&lt;br&gt;
&lt;code&gt;let tuesdayCalories = 420&lt;/code&gt;&lt;br&gt;
&lt;code&gt;let wednedayCalories = 200&lt;/code&gt;&lt;br&gt;
&lt;code&gt;let thursdayCalories = 625&lt;/code&gt;&lt;br&gt;
&lt;code&gt;let fridayCalories = 500&lt;/code&gt;&lt;br&gt;
&lt;code&gt;let saturdayCalories = 1_090&lt;/code&gt;&lt;br&gt;
&lt;code&gt;let sundayCalories = 300&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Like this post?
&lt;/h4&gt;

&lt;p&gt;You can find more by following me on twitter 😄: &lt;a href="https://twitter.com/joshuarutkowski"&gt;@joshuarutkowski&lt;/a&gt;&lt;/p&gt;

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

</description>
      <category>ios</category>
      <category>swift</category>
      <category>codenewbie</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Intro to Swift: Constants and Variables</title>
      <dc:creator>Joshua Rutkowski </dc:creator>
      <pubDate>Wed, 25 Sep 2019 21:36:55 +0000</pubDate>
      <link>https://dev.to/josh/intro-to-swift-1d50</link>
      <guid>https://dev.to/josh/intro-to-swift-1d50</guid>
      <description>&lt;p&gt;This lesson is a companion to my Twitter ✨Intro to Swift✨ crash course - Check it out! 👌&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1176952198334439425-656" src="https://platform.twitter.com/embed/Tweet.html?id=1176952198334439425"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1176952198334439425-656');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1176952198334439425&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;The lesson introduces you to the Swift programming language and mainly covers constants and variables and the print statement.&lt;/p&gt;

&lt;p&gt;Objectives for this lesson:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learn to use Xcode to create a playground&lt;/li&gt;
&lt;li&gt;Learn to use &lt;code&gt;print()&lt;/code&gt; to output text to the console&lt;/li&gt;
&lt;li&gt;Learn to use constants (&lt;code&gt;let&lt;/code&gt;) to store values&lt;/li&gt;
&lt;li&gt;Learn to use variables (&lt;code&gt;var&lt;/code&gt;) to store and change values&lt;/li&gt;
&lt;li&gt;Learn when to use &lt;code&gt;var&lt;/code&gt; vs &lt;code&gt;let&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Learn to use different types of variables and constants, including &lt;code&gt;Int&lt;/code&gt;, &lt;code&gt;Float&lt;/code&gt;, &lt;code&gt;Bool&lt;/code&gt;, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The lesson concludes with the following Challenge:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Create variables and constants for various parts about you, such as your name, your hometown, your favorite color and food, and anything else you think someone would be interested to know about you. Think about which of these should be variables, and which should be constants. Try to come up with at least 8 constants and variables in total.&lt;/p&gt;

&lt;p&gt;Print each of these using &lt;code&gt;print()&lt;/code&gt; statements and inserting the variable or constant in the parentheses. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Note: This lessons follows along Lambda School's iOS 101 precourse work. For additional information on Lambda School's iOS Development course, &lt;a href="https://lambdaschool.com/courses/ios-development" rel="noopener noreferrer"&gt;click here&lt;/a&gt;.&lt;/em&gt;   &lt;/p&gt;

&lt;h1&gt;
  
  
  Learn to use Xcode to create a playground
&lt;/h1&gt;

&lt;p&gt;Xcode includes a feature called playgrounds. Playgrounds provides a testing ground that renders developer code in real time.&lt;/p&gt;

&lt;p&gt;To start a new playground, open Xcode and select "Get started with a playground." Don't have macOS or Xcode? No worries, head on over to &lt;a href="https://repl.it" rel="noopener noreferrer"&gt;repl.it&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F9hnzspp43wl4bb19x90e.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F9hnzspp43wl4bb19x90e.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Learn to use &lt;code&gt;print()&lt;/code&gt; to output text to the console
&lt;/h1&gt;

&lt;p&gt;In its simplest form, a print statement looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Text you want to output here"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Xcode, the &lt;code&gt;print()&lt;/code&gt; function prints its output in Xcode’s “console” pane, as seen below.&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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fe6z306s81gqxkvm32zp0.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fe6z306s81gqxkvm32zp0.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Learn to use constants (&lt;code&gt;let&lt;/code&gt;) to store values
&lt;/h2&gt;

&lt;p&gt;Constants associate a name (such as &lt;code&gt;numberOfPizzaSlicesEaten&lt;/code&gt; or &lt;code&gt;welcomeMessage&lt;/code&gt;) with a value of a particular type (such as the number 4 or the string "Hello"). The value of a constant can’t be changed once it’s set.&lt;/p&gt;

&lt;p&gt;Constants must be declared before they’re used. You declare constants with the &lt;code&gt;let&lt;/code&gt; keyword:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;numberOfPizzaSlicesEaten&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code can be read as: "Declare a new constant called &lt;code&gt;numberOfPizzaSlicesEaten&lt;/code&gt;, and give it a value of 8." &lt;/p&gt;

&lt;p&gt;A note about naming: You can name constants anything you like, with a few small restrictions. The biggest one to remember is that constant names can’t start with a number (though they can contain a number elsewhere). The names you choose for your constants are important. Writing code that is easy for you (and other humans) to read and understand is a vital part of being a good programmer. So choose names that are concise but very clearly convey the purpose of a constant. You should avoid the temptation to abbreviate names. An example of a poorly written constant:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;numberOfZaSlicesEaten&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You may understand that "Za" means "Pizza" - however, it may be difficult for another person reviewing your code to understand the reference. Also, no self-respecting person uses "za." 🍕&lt;/p&gt;

&lt;h1&gt;
  
  
  Learn to use variables (&lt;code&gt;var&lt;/code&gt;) to store and change values
&lt;/h1&gt;

&lt;p&gt;Like a constant, variables associate a name with a value of a particular type.  Unlike a constant, variables can be given new values as the program runs. To create a variable, use a &lt;code&gt;var&lt;/code&gt; statement.&lt;/p&gt;

&lt;p&gt;Here’s an example of how constants and variables can be used to track the number of pizza slices a user has eaten:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;numberOfPizzaSlicesEaten&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;
&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;currentPizzaSlice&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the maximum number of allowed pizza slices to be eaten is declared as a constant, because the maximum value never changes. The current pizza slice counter is declared as a variable, because this value must be incremented after each slice is eaten.&lt;/p&gt;

&lt;h1&gt;
  
  
  Learn when to use &lt;code&gt;var&lt;/code&gt; vs &lt;code&gt;let&lt;/code&gt;
&lt;/h1&gt;

&lt;p&gt;Rule of thumb: If you have a value that needs to change, you should use a variable. If you have a value that never changes, use a constant.&lt;/p&gt;

&lt;p&gt;You might think that always using variables makes sense, because you can change them if you need to, or leave them the same. In fact, many languages don’t have constants, and only use variables. However, this is not a good idea in practice.&lt;/p&gt;

&lt;p&gt;In fact, as you read and write more and more Swift you’ll notice that variables are actually quite rarely used. As a rule of thumb, you should always make your values constants with &lt;code&gt;let&lt;/code&gt;. If, and only if, you actually need a value that can change, should you change your value to a variable.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you have a value that needs to change, you should use a variable. If you have a value that never changes, use a constant.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Learn to use different types of variables and constants, including Int, Float, Bool, etc.
&lt;/h1&gt;

&lt;p&gt;Normally, &lt;a href="https://docs.swift.org/swift-book/LanguageGuide/TheBasics.html#ID322" rel="noopener noreferrer"&gt;Swift is able to figure out, or infer the type of a value based on context&lt;/a&gt;. It’s clear that 42 is an integer, or &lt;code&gt;Int&lt;/code&gt;, not a string. Similarly, “Hello” is obviously not a number, it’s a &lt;code&gt;String&lt;/code&gt;. This feature is called type inference and is one of the things that makes Swift concise and nice to write. &lt;/p&gt;

&lt;p&gt;You can provide a type annotation when you declare a constant or variable, to be clear about the kind of values the constant or variable can store. Write a type annotation by placing a colon after the constant or variable name, followed by a space, followed by the name of the type to use.&lt;/p&gt;

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

&lt;p&gt;This example provides a type annotation for a variable called &lt;code&gt;typeOfPizzaEaten&lt;/code&gt;, to indicate that the variable can store String values:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;typeOfPizzaEaten&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"margherita"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The colon in the declaration means “…of type…,” so the code above can be read as: “Declare a variable called &lt;code&gt;typeOfPizzaEaten&lt;/code&gt; that is of type &lt;code&gt;String&lt;/code&gt;, and give it the value &lt;code&gt;"margherita"&lt;/code&gt;.”&lt;/p&gt;

&lt;p&gt;The phrase “of type String” means “can store any String value.” Think of it as meaning “the type of thing” (or “the kind of thing”) that can be stored.&lt;/p&gt;

&lt;h3&gt;
  
  
  Number Types
&lt;/h3&gt;

&lt;p&gt;There are actually multiple number types, including &lt;code&gt;Int&lt;/code&gt;, &lt;code&gt;UInt&lt;/code&gt;, &lt;code&gt;Float&lt;/code&gt;, and &lt;code&gt;Double&lt;/code&gt;. &lt;code&gt;Int&lt;/code&gt; is short for integer and is a whole number that can be either positive or negative. &lt;code&gt;UInt&lt;/code&gt; is an unsigned integer, and is a whole number but it can only be positive. In other words, it can’t have a minus sign. You’ll see both types used in Swift, but &lt;code&gt;Int&lt;/code&gt; is more common, and is the default. &lt;code&gt;Float&lt;/code&gt; and &lt;code&gt;Double&lt;/code&gt; are both kinds of floating point numbers. &lt;/p&gt;

&lt;p&gt;Floating point numbers are numbers with a decimal point like 3.14. The difference between &lt;code&gt;Float&lt;/code&gt; and &lt;code&gt;Double&lt;/code&gt; is their precision, and the maximum value they can store. &lt;code&gt;Double&lt;/code&gt; is more precise and can store larger numbers than a &lt;code&gt;Float&lt;/code&gt;. However, it also takes up twice as much memory space as a &lt;code&gt;Float&lt;/code&gt;. You’ll see both types used in Swift, but &lt;code&gt;Double&lt;/code&gt; is more common, and is the default.&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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F2mje90cgigxirncg5agi.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F2mje90cgigxirncg5agi.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Boolean
&lt;/h3&gt;

&lt;p&gt;Another common type is &lt;code&gt;Bool&lt;/code&gt;, which is short for boolean. Boolean values can only be either true or false. We could create a boolean variable like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;pizzaIsAwesome&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Challenge
&lt;/h1&gt;

&lt;p&gt;Let's put our knowledge of constants, variables, and type annotations together, and see if we can complete the Challenge:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Create variables and constants for various parts about you, such as your name, your hometown, your favorite color and food, and anything else you think someone would be interested to know about you. Think about which of these should be variables, and which should be constants. Try to come up with at least 8 constants and variables in total.&lt;/p&gt;

&lt;p&gt;Print each of these using &lt;code&gt;print()&lt;/code&gt; statements and inserting the variable or constant in the parentheses. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Give it a shot before scrolling down! 😉&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;myAge&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;UInt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;78&lt;/span&gt; 
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;myFavoriteColor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Aquamarine Blue"&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;myFavoriteFood&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Sushi"&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Arthur"&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Curry"&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;birthYear&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1941&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;homeTown&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Atlantis"&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;university&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"School of Hard Knocks"&lt;/span&gt;
&lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;occupation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Lighthouse Keeper"&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;birthYear&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;myFavoriteFood&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;myFavoriteColor&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;homeTown&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;university&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;occupation&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

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

&lt;/div&gt;



&lt;h1&gt;
  
  
  Bonus Challenge
&lt;/h1&gt;

&lt;p&gt;Now it's your turn!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Create a constant called &lt;code&gt;introduction&lt;/code&gt;. This should be a readable sentence or paragraph that includes all of the constants and variables you made and combines them into a single string.&lt;/p&gt;

&lt;p&gt;Hints: Look up string interpolation in Swift to learn how to turn variables into text. Google is your friend here. 😉&lt;/p&gt;

&lt;p&gt;Note: We will cover &lt;a href="https://docs.swift.org/swift-book/LanguageGuide/StringsAndCharacters.html#ID292" rel="noopener noreferrer"&gt;string interpolation&lt;/a&gt; in detail in a later lesson, so don't worry if you don't already know it, or find it confusing at first.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Like this post?
&lt;/h4&gt;

&lt;p&gt;You can find more by following me on twitter 😄: &lt;a href="https://twitter.com/joshuarutkowski" rel="noopener noreferrer"&gt;@joshuarutkowski&lt;/a&gt;&lt;/p&gt;

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

</description>
      <category>ios</category>
      <category>swift</category>
      <category>codenewbie</category>
      <category>challenge</category>
    </item>
    <item>
      <title>Is English a necessary skill for a developer? Why or why not?</title>
      <dc:creator>Joshua Rutkowski </dc:creator>
      <pubDate>Sun, 22 Sep 2019 20:19:39 +0000</pubDate>
      <link>https://dev.to/josh/is-english-a-necessary-skill-for-a-developer-why-or-why-not-4l1f</link>
      <guid>https://dev.to/josh/is-english-a-necessary-skill-for-a-developer-why-or-why-not-4l1f</guid>
      <description>&lt;p&gt;Like the title says - is English a necessary skill for a developer? What do you think? &lt;/p&gt;


&lt;div class="ltag__user ltag__user__id__"&gt;
    &lt;div class="ltag__user__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F99mvlsfu5tfj9m7ku25d.png" alt="[deleted user] image"&gt;
    &lt;/div&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;[Deleted User]&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>discuss</category>
    </item>
    <item>
      <title>Accepted to Lambda School's iOS Development Course!</title>
      <dc:creator>Joshua Rutkowski </dc:creator>
      <pubDate>Thu, 19 Sep 2019 14:36:46 +0000</pubDate>
      <link>https://dev.to/josh/accepted-to-lambda-school-s-ios-development-course-306h</link>
      <guid>https://dev.to/josh/accepted-to-lambda-school-s-ios-development-course-306h</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rSFk9Br1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/co1v99yob6ibtit7o9fk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rSFk9Br1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/co1v99yob6ibtit7o9fk.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Very excited to announce that I was accepted into Lambda School’s iOS Development Course. So excited to be accepted into a top-tier software engineering program!&lt;/p&gt;

&lt;p&gt;I chose the start date of October 28th for the Part-Time program and I’m very excited about this new journey. Working 40+ hours a week and participating in the iOS course part-time is going to be challenge - but the sacrifice is worth it!&lt;/p&gt;

&lt;p&gt;For anyone who is in Lambda or is an alumni, please, feel free to follow and send encouraging words.&lt;/p&gt;

&lt;p&gt;I'll be documenting my journey - stay tuned!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.twitter.com/joshuarutkowski"&gt;Follow along on Twitter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ios</category>
      <category>coding</category>
      <category>vetswhocode</category>
    </item>
  </channel>
</rss>
