<?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: Simon Barker</title>
    <description>The latest articles on DEV Community by Simon Barker (@allthecode).</description>
    <link>https://dev.to/allthecode</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%2F660288%2F158e5068-f04d-4db4-80f9-41c751d1014d.png</url>
      <title>DEV Community: Simon Barker</title>
      <link>https://dev.to/allthecode</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/allthecode"/>
    <language>en</language>
    <item>
      <title>The missing WeatherKit REST API Docs</title>
      <dc:creator>Simon Barker</dc:creator>
      <pubDate>Fri, 10 Jun 2022 09:23:55 +0000</pubDate>
      <link>https://dev.to/allthecode/the-missing-weatherkit-rest-api-docs-1ci6</link>
      <guid>https://dev.to/allthecode/the-missing-weatherkit-rest-api-docs-1ci6</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/7mg42_Fix9k"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.apple.com/weatherkit/get-started/"&gt;WeatherKit&lt;/a&gt; is Apple's new weather data service, announced at WWDC 2022 it is the their answer to privacy focussed weather data. Not only have they created this for use in native iOS Swift apps but they have also created a REST API so that web developers are able to access it as well.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://developer.apple.com/documentation/weatherkitrestapi"&gt;WeatherKit REST API Documentation&lt;/a&gt; is fairly limited on how to get this set up so here is a guide to get up you up and running with Apple's WeatherKit. In fact, I had a labs call with two Apple engineers to get this working which was pretty cool. We will build a simple ExpressJS server and a index.html page to display weather for a set location.&lt;/p&gt;

&lt;h2&gt;
  
  
  WeatherKit REST API setup
&lt;/h2&gt;

&lt;p&gt;The REST API requires a signed JWT to be attached to each request. To set this up you need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A paid developer account&lt;/li&gt;
&lt;li&gt;An App Identifier&lt;/li&gt;
&lt;li&gt;A key&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can set up an App Identifier on the &lt;a href="https://developer.apple.com/account/resources/identifiers/list"&gt;Identifiers&lt;/a&gt; page of your developer account. You need to create a new &lt;code&gt;App ID&lt;/code&gt; of type App, give it a &lt;code&gt;Bundle ID&lt;/code&gt; in reverse-domain name style, so &lt;code&gt;com.myapp.weather&lt;/code&gt; or similar, and then make sure you select WeatherKit from the App Services tab. This App Identifier can take about 30 minutes to propagate through Apple's systems.&lt;/p&gt;

&lt;p&gt;For the key you go to the &lt;a href="https://developer.apple.com/account/resources/authkeys/list"&gt;Keys&lt;/a&gt; page in your developer account and add a new key with WeatherKit selected. Remember to download the key file you get at the end!&lt;/p&gt;

&lt;h2&gt;
  
  
  WeatherKit REST API JWT
&lt;/h2&gt;

&lt;p&gt;Now you have your key and App Identifier we can create a server to sign that key. You will be signing the JWT yourself so you will need a backend/server where you can execute your code, as always &lt;strong&gt;do not expose your key to the browser or client&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So, let's create a little ExpressJS server. Comments in the code explain what is going on. I'm assuming you know how to use &lt;a href="https://expressjs.com/"&gt;ExpressJS&lt;/a&gt; already.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;axios&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;axios&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;fs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;jwt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;jsonwebtoken&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;cors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;cors&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cors&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// This is the key file you downloaded from Apple&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;privateKey&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;readFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;YOUR KEY FILE FROM DEVELOPER CENTER.p8&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// Creating the signed token needs specific data&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;jwt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sign&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;APP ID&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// the reverse URL App Id you made above&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="nx"&gt;privateKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;jwtid&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;YOUR TEAM ID.YOUR APP ID&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// you can find your TeamID in the top right corner of your developer account, then put a `.` and then put in your reverse URL App Id&lt;/span&gt;
      &lt;span class="na"&gt;issuer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;TEAM ID&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// find your TeamID in your developer account&lt;/span&gt;
      &lt;span class="na"&gt;expiresIn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;1h&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// give it 1 hour of validity&lt;/span&gt;
      &lt;span class="na"&gt;keyid&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;KEY ID&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// this is the ID for the key you created&lt;/span&gt;
      &lt;span class="na"&gt;algorithm&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ES256&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// this is the algorithm Apple used&lt;/span&gt;
      &lt;span class="na"&gt;header&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// see details below for this&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;YOUR TEAM ID.YOUR APP ID&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// log your token so you can decode it and manually check it's ok, more below on this&lt;/span&gt;
  &lt;span class="c1"&gt;//console.log(token);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://weatherkit.apple.com/api/v1/weather/en/51.677612/-2.937941?dataSets=currentWeather&amp;amp;timezone=Europe/London&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;// add the token to your headers&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;Authorization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`Bearer &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="c1"&gt;// get the data&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;weatherData&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;axios&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// prove we have data&lt;/span&gt;
  &lt;span class="c1"&gt;//console.log(weatherData);&lt;/span&gt;

  &lt;span class="c1"&gt;// return the data to your front end&lt;/span&gt;
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;weatherData&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;port&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Example app listening on port &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;port&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your decoded JWT needs to look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;header&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;alg&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ES256&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;typ&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;JWT&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;kid&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;KEY_ID&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;TEAM_ID.APP_ID&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="c1"&gt;// this is the bit that has been tricking people up&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;payload&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;subject&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;APP_ID&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;iat&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1654823790&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;exp&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1654827390&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;iss&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;TEAM_ID&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;jti&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;TEAM_ID.APP_ID&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;signature&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;d98jNki1tXX3mSYOAPp-Wpds8kEbGJ-lhKPtasdfSqoDyiJ2WbeI6U73UWCYWQgISlDOzaXdI5rSrSFcrg5g&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To get &lt;code&gt;id&lt;/code&gt; in the header I needed to set it manually when creating the JWT, Apple is looking for &lt;code&gt;id&lt;/code&gt; in the header and depending on your JWT signing library of choice that may not (probably won't) be there by default.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;YOUR TEAM ID.YOUR APP ID&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// see details below for this&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  WeatherKit REST API Front end
&lt;/h2&gt;

&lt;p&gt;To call the serve end point you can use the code below in an &lt;code&gt;index.html&lt;/code&gt; to make a simple front end that starts with default data and then adds in the data from weather kit.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script
      &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdnjs.cloudflare.com/ajax/libs/axios/1.0.0-alpha.1/axios.min.js"&lt;/span&gt;
      &lt;span class="na"&gt;integrity=&lt;/span&gt;&lt;span class="s"&gt;"sha512-xIPqqrfvUAc/Cspuj7Bq0UtHNo/5qkdyngx6Vwt+tmbvTLDszzXM0G6c91LXmGrRx8KEPulT+AfOOez+TeVylg=="&lt;/span&gt;
      &lt;span class="na"&gt;crossorigin=&lt;/span&gt;&lt;span class="s"&gt;"anonymous"&lt;/span&gt;
      &lt;span class="na"&gt;referrerpolicy=&lt;/span&gt;&lt;span class="s"&gt;"no-referrer"&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdn.tailwindcss.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;http-equiv=&lt;/span&gt;&lt;span class="s"&gt;"X-UA-Compatible"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"IE=edge"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Document&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container max-w-3xl mx-auto p-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-3xl text-center font-bold text-gray-700"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;All The Code&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt;
        &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"shadow-lg shadow-black/40 w-[400px] p-4 mx-auto mt-10 rounded flex flex-col gap-y-6"&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h2&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-xl font-bold text-center"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Current Weather&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-7xl font-black text-center"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"temperature"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;0&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"font-thin"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&lt;span class="ni"&gt;&amp;amp;#8451;&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"flex flex-row justify-between"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"flex flex-col text-center w-1/3"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"wind"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-3xl font-bold"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;17.5&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-3xl"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Wind&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"flex flex-col text-center w-1/3"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"uv"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-3xl font-bold"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;0&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-3xl"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;UV&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"flex flex-col text-center w-1/3"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-3xl font-bold"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"cloud"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;81&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;%&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-3xl"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Cloud&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-center mt-10"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        Weather data provided by
        &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://weather-data.apple.com/legal-attribution.html"&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Apple WeatherKit&lt;span class="nt"&gt;&amp;lt;/a&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
&lt;span class="nx"&gt;axios&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http://localhost:3000&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Access-Control-Allow-Origin&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;*&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;temp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;temperature&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="nx"&gt;temp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;currentWeather&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;temperature&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;parseFloat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;currentWeather&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;temperature&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;temp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-blue-500&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;temp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-red-500&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;wind&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
      &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;currentWeather&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;windSpeed&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;uv&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;currentWeather&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;uvIndex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;cloud&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
      &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;currentWeather&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cloudCover&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When this page loads it will request weather data from Apple via your server with a sign JWT 😊&lt;/p&gt;

&lt;p&gt;If you want to see this widget in action you can see it on &lt;a href="https://allthecode.co/blog/post/setting-up-weatherkit-rest-api-in-node-js"&gt;this page&lt;/a&gt; on my site&lt;/p&gt;

&lt;p&gt;If you're still learning to code and some, or all of this, doesn't make sense then head over to &lt;a href="https://allthecode.co/"&gt;All The Code&lt;/a&gt; where I teach people how to be amazing web developers. Join my mailing list for a free coding quick start guide and weekly tip and advice.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>api</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How To Get A Job After Coding Bootcamp</title>
      <dc:creator>Simon Barker</dc:creator>
      <pubDate>Tue, 19 Apr 2022 22:04:49 +0000</pubDate>
      <link>https://dev.to/allthecode/how-to-get-a-job-after-coding-bootcamp-2h2g</link>
      <guid>https://dev.to/allthecode/how-to-get-a-job-after-coding-bootcamp-2h2g</guid>
      <description>&lt;p&gt;Congratulations you have completed your coding bootcamp. You've come a long way since you decided to learn to code all those months ago, you can now create a web or native app, solve complicated user interface issues and have even learned about this weird thing called Git!&lt;/p&gt;

&lt;p&gt;Now that you have finished your coding bootcamp it's time to start looking for a job.&lt;/p&gt;

&lt;p&gt;If you went to a good bootcamp they should have dedicated some time to this part. Knowing how to code and knowing how to get a coding job are sadly slightly different skills. So ideally they will have taught you how to look for a developer job at companies that are open to hiring coding bootcamp graduates and they should have explained about how to showcase your skills in the best way possible, how to talk about the projects you have made and how to show these companies that you have the skills and experience they need.&lt;/p&gt;

&lt;p&gt;If they didn't cover that kind of thing or their advice isn't working for you, then never fear, here are my top tips for coding bootcamp graduates to get a job after they graduate.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Software Developer
&lt;/h2&gt;

&lt;p&gt;Stop using Junior, Aspiring or any other word to indicate you are new to the field, in your LinkedIn title or resume. It will be very obvious from your work history that you are new, so you don't need to lead with it. You are a Software Developer, you may not have much experience yet but it's not for you to pigeon hole yourself as junior, mid or senior. Don't put yourself on the back foot from the first moment someone reads your profile.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Coding Bootcamp Graduate Projects
&lt;/h2&gt;

&lt;p&gt;During your coding bootcamp you should have made at least one reasonable sized project. Let's get that online, hosted at a domain in a state that is useable for someone to go and have a play with. It doesn't matter if it's not the most exciting app in the world. So long as it works and it was made by you then it shows you can code.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. More Projects
&lt;/h2&gt;

&lt;p&gt;One project from your coding bootcamp is great but ideally as a coding bootcamp graduate looking for a job, you should still be coding and making projects. If you've stopped then it's time to roll your sleeves back up and keep honing those skills. You want at least one project up and running on a domain, or in an app store, that you made on your own after your coding bootcamp finished.&lt;/p&gt;

&lt;p&gt;I have three rules for portfolio projects. They need to be small, complete and functional. Small doesn't mean tiny, it should still have taken a few weeks to make. But it doesn't need to be the start of the next great startup to come out of your country! It does also need to be functional. People need to be able to use it, to test it and play around with what you've made, screen shots don't cut it I'm afraid. Finally it needs to be complete, no dead ends or obviously missing features, someone should be able to feel like they are using a small and useful tool/app.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Projects First
&lt;/h2&gt;

&lt;p&gt;A company will hire you because they believe you can build useful software to solve their problems. Since you haven't yet done that for any other company you need to lead with the next best thing, the software you have written for your portfolio projects! While you might be most proud of your education, or your previous work history, it's not the thing that will get you the job. Showing you can code is what will do that. So put that first in a section called "Relevant Projects" and put a few bullet points about what each project is, how you made it and the technologies used. These should be front and center on your resume, your LinkedIn and your portfolio site. If you're looking for project ideas here are &lt;a href="https://allthecode.co/blog/post/30-developer-portfolio-project-ideas"&gt;30 developer portfolio project ideas&lt;/a&gt; for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Stop Remaking Your Portfolio Site
&lt;/h2&gt;

&lt;p&gt;As a new developer it's tempting to make your own portfolio site. And then remake it, and then remake it again. Your portfolio site is not what will get you the job though. The projects on your portfolio site are. Unless you are an amazing designer it will almost certainly not be the best first impression so just use a pre-existing template and host it on Wordpress or Squarespace. Take the time you save here and make another project that shows you can use code to solve real problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Start Blogging
&lt;/h2&gt;

&lt;p&gt;It doesn't need to be much, just a short 500 word post each week shared on LinkedIn about what you learned that week or what you built. No one expects you to be an expert so don't be afraid that it will make you look bad, quite the opposite in fact. People on LinkedIn will see consistent posts created by you and start to comment and help. Eventually you can ask this network for a job and you'll quickly have people getting in touch.&lt;/p&gt;

&lt;p&gt;Don't believe me? Hear from Yusuf Chowdhury in &lt;a href="https://share.transistor.fm/s/81fd32ee"&gt;this episode&lt;/a&gt; of the &lt;a href="https://allthecode.co/podcast"&gt;All The Code podcast&lt;/a&gt; talk about how he used exactly this process to land his first 2 developer jobs without ever actually applying for them and instead being head hunted on LinkedIn, as a junior dev!&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Data Structures and Algorithms
&lt;/h2&gt;

&lt;p&gt;You leaned a lot on your coding bootcamp but one area you are likely to be weak on is your data structures and algorithms. These are taught extensively on computer science degrees but they can feel very abstract and lack direct applicability for a coding bootcamp to teach to the same level. You will have covered them to some extent but not to the depth that some employers need. It's worth investing some time in this area and taking a couple of weeks out from building projects to fill in some gaps in this area. The two best resources here are &lt;a href="//Educative.io"&gt;Educative.io&lt;/a&gt; which has great courses targeting fundamentals like this and &lt;a href="https://bigmachine.io/products/the-imposters-handbook/"&gt;The Imposters Handbook&lt;/a&gt; which was specifically written by Rob to help fill in the technical blanks that self taught developers and coding bootcamp graduates often have.&lt;/p&gt;

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

&lt;p&gt;Getting a job after a coding bootcamp can feel like an uphill battle at times. What you have to remember is that while you have learned the skills required to be a software developer, you need to take some time to present that to the world in a way that shows your future employer that you really can do that job.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>career</category>
    </item>
    <item>
      <title>5 Best books for software developers</title>
      <dc:creator>Simon Barker</dc:creator>
      <pubDate>Mon, 18 Apr 2022 13:37:32 +0000</pubDate>
      <link>https://dev.to/allthecode/5-best-books-for-software-developers-37m9</link>
      <guid>https://dev.to/allthecode/5-best-books-for-software-developers-37m9</guid>
      <description>&lt;p&gt;The best books for software developers is a hard list two write, there are so many excellent books for software developers across so many domains that it's almost hard to find any bad books. That being said there are some clear standouts that people hold in very high regard and they are books that all software developers should read at least once, if not many times, in their career.&lt;/p&gt;

&lt;p&gt;So, if you're looking for top books for software developers to improve your skills and knowledge, no matter where you are in your career, then here are the 5 books that have had the most meaningful impact on my career as a software developer.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. &lt;a href="https://amzn.to/3jPrUyc"&gt;The Phoenix Project&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://amzn.to/3jPrUyc" rel="noopener noreferrer"&gt;&lt;br&gt;
    &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sxRCfXRD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://allthecode.co/_next/image%3Furl%3D%252Fimages%252Fblog%252Fbooks%252Fphoenix.jpg%26w%3D750%26q%3D75" alt="Image alt" width="328" height="490"&gt;&lt;br&gt;
  &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Learn DevOps in this fun fiction book, it’s a really enjoyable book even before you consider all the great lessons it teaches around DevOps and how you modernize an old and failing system to become a positive force for a business.&lt;/p&gt;

&lt;p&gt;Follow our intrepid new head of IT operations as he navigates a disastrous release, gets the teams work in progress under control and learns the 3 ways of DevOps from a strange, almost mystical outsider. 10/10, I have recommended it many friends and colleagues and all have enjoyed it, even those that aren't software developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. &lt;a href="https://amzn.to/38SEpGR"&gt;Clean Code&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://amzn.to/38SEpGR" rel="noopener noreferrer"&gt;&lt;br&gt;
    &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7mbrx28Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://allthecode.co/_next/image%3Furl%3D%252Fimages%252Fblog%252Fbooks%252FCC.jpg%26w%3D750%26q%3D75" alt="Image alt" width="371" height="490"&gt;&lt;br&gt;
  &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As relevant today as the day it first came out learn about Bob Martin's career and how he has improved his developer skills through multiple companies and projects. Some of these ideas are now mainstays in the software developer industry and many developers have adopted his practices to great success.&lt;/p&gt;

&lt;p&gt;My particular favorite suggestion is having known sections of code that you can produce on demand that can be used as daily practice, he calls them Code Katas and they can help get you into the coding mood when you are perhaps struggling to get going.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. &lt;a href="https://amzn.to/3ryc2Et"&gt;The Unicorn Project&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://amzn.to/3ryc2Et" rel="noopener noreferrer"&gt;&lt;br&gt;
    &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LmZkGUyh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://allthecode.co/_next/image%3Furl%3D%252Fimages%252Fblog%252Fbooks%252Funicorn.jpg%26w%3D750%26q%3D75" alt="Image alt" width="330" height="490"&gt;&lt;br&gt;
  &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sibling to The Phoenix Project that happens roughly in parallel. This focuses on how a developer, new to a failing project, begins to get a handle on things. Our senior developer uses automation, functional programming and strong team work and collaboration to set up new systems and upgrade legacy code to support the future growth of the company.&lt;/p&gt;

&lt;p&gt;Software developers of any level will appreciate the problems that she has to deal with and some of it might ring a little too close to home. Another page turner, although much more specific to software development than The Phoenix Project.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. &lt;a href="https://bigmachine.io/products/the-imposters-handbook/"&gt;The Imposters Handbook&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://bigmachine.io/products/the-imposters-handbook/" rel="noopener noreferrer"&gt;&lt;br&gt;
    &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--l8gAOJRo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://allthecode.co/_next/image%3Furl%3D%252Fimages%252Fblog%252Fbooks%252Fimposters.jpg%26w%3D750%26q%3D75" alt="Image alt" width="327" height="490"&gt;&lt;br&gt;
  &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Delightful summaries of CS concepts for every level of software developer. I'm self taught and so, like every self taught software developer, I have some gaps in my knowledge that is considered standard for people who have done a computer science degree.&lt;/p&gt;

&lt;p&gt;If you want to get a high level understanding of the concepts taught on a software developer focussed degree then this book can form the cornerstone of that. Written by a self taught developer who set out to fill in his own blanks, this is an enjoyable book that will make you a better software developer.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. &lt;a href="https://amzn.to/38ZfYYt"&gt;The Pragmatic Programmer&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://amzn.to/38ZfYYt" rel="noopener noreferrer"&gt;&lt;br&gt;
    &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--G_wMhx7H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://allthecode.co/_next/image%3Furl%3D%252Fimages%252Fblog%252Fbooks%252Fpragmatic.jpg%26w%3D750%26q%3D75" alt="Image alt" width="375" height="490"&gt;&lt;br&gt;
  &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you've ever heard the terms "Rubber Ducking" or "DRY" when talking to other software developers and wondered where those terms came from then this is the place. This book is probably one of the most famous and iconic books on software development. This book is a series of tips and examples collated together for you to dip in and out of throughout your career.&lt;/p&gt;

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

&lt;p&gt;There we have it, the 5 books for software developers that have had the most impact on my career. If you are starting your journey to becoming a software developer or perhaps you are already in a software developer role and looking at how to get ahead then these books are the best places to set your career in the right direction.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: some of these links are affiliate links and if you purchase the book I may get a small commission, which is pretty awesome and a great way of supporting what I do at &lt;a href="https://allthecode.co"&gt;All The Code&lt;/a&gt;, joining my &lt;a href="https://allthecode.co/newsletter"&gt;newsletter&lt;/a&gt; is another great way to support me 😄&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>career</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How To Learn New Skills As A Developer: A Framework</title>
      <dc:creator>Simon Barker</dc:creator>
      <pubDate>Thu, 10 Mar 2022 12:20:23 +0000</pubDate>
      <link>https://dev.to/allthecode/how-to-learn-new-skills-as-a-developer-a-framework-4lhe</link>
      <guid>https://dev.to/allthecode/how-to-learn-new-skills-as-a-developer-a-framework-4lhe</guid>
      <description>&lt;p&gt;A conversation in my favourite developer Slack the other day inspired this post 😀 &lt;/p&gt;

&lt;p&gt;Learning new skills as a developer is a key skill to have, and while you are a junior developer it’s a great time to “learn how to learn” new skills. Learning skills like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;new programming languages&lt;/li&gt;
&lt;li&gt;new frameworks&lt;/li&gt;
&lt;li&gt;new technologies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;is something you will need to do on a regular basis throughout your software developer career. Being able to learn new skills will help unlock pay rises, promotions and work on exciting projects.&lt;/p&gt;

&lt;p&gt;The problem is that you can’t always take the same approach you did when you first learnt to code. Learning to code is a very “bottom up” learning activity. You need to learn fundamental concepts and spend a long time working though difficult and challenging things. This is why learning to code is So. Time. Consuming. Taking many months or even years.&lt;/p&gt;

&lt;p&gt;You can’t set aside that amount of time whenever you need to learn a new framework or programming language. You need a quicker way to learn, something called “top down” learning. This is where you skim a topic to get a feel for it and then dive into the specific areas you need to learn whilst also working with it in an active project.&lt;/p&gt;

&lt;p&gt;To achieve this, you need a framework! &lt;/p&gt;

&lt;p&gt;This framework is designed to help you learn new software developer skills, it is not designed to help you learn how to code. If you don’t yet know how to code then you need a different approach to actually learn how to code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Learn new skills framework
&lt;/h2&gt;

&lt;p&gt;Here’s a tried and tested way for software developers to learn new skills:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Find a video explaining the concept.&lt;/li&gt;
&lt;li&gt;Go through it at 2x speed to understand the broad 50,000 ft view. Take notes on things you don’t understand and draw parallels to things you do understand from previous learnings.&lt;/li&gt;
&lt;li&gt;Take a look at the docs and skim through those, seeing if there’s any deviation from the video to make sure the video you watched was accurate.&lt;/li&gt;
&lt;li&gt;Now that you have an all encompassing view of the subject, with notes about things you don’t understand, you can start diving into the subtopics until you’re comfortable with your level of understanding.&lt;/li&gt;
&lt;li&gt;Take as much or as little time as you need to at this stage. Dive into the theory or reasoning behind why choices are made to the level that you feel you need. If you are only lightly working with something you may not need to go too deep, but if the skill is going make up a core part of your work then taking the time to go deeper, and understand the fundamentals is important.&lt;/li&gt;
&lt;li&gt;Start to build something as early as possible, if they have a quick start project then spin that up. If you have a project you have inherited from another developer then start poking around with that by changing things and seeing what breaks. Start to mesh the theory you are learning, with the practical applications of the code you have in front of you.&lt;/li&gt;
&lt;li&gt;As you start to gain more comfort with the project and the code you are dealing with, you can determine the best way to be guided. You can either methodically work through the documentation/learning plan or you can be guided by the project you are making and problems as they arise.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  If you get stuck learning a new software developer skill
&lt;/h2&gt;

&lt;p&gt;If you get stuck when learning a new software skill or feel like you aren’t making any progress, then don’t force it. Sometimes you need to switch learning paths and have another go. This is perfectly natural so don’t let it demotivate you.&lt;/p&gt;

&lt;p&gt;When learning a really big topic, or something quite different, then taking a more foundational approach can be quicker in the long run. For instance, if you have learnt JavaScript and suddenly find yourself needing to learn Rust, then a top down approach is going to be challenging because there are so many new concepts in learning Rust that you just won’t have covered in with JavaScript.&lt;/p&gt;

&lt;p&gt;The trick is knowing if you are making progress or if you are spinning your wheels. This is why it’s important to have a project in active development when learning a new software developer skill. That way you can see the progress you are making and avoid getting stuck in tutorial hell instead of actually learning a new skill as a software developer.&lt;/p&gt;

&lt;p&gt;Get more developer career advice like this by joining &lt;a href="https://careerswitchtocoding.com/"&gt;my mailing list at Career Switch To Coding&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Finally, A special thanks to Sean for providing the inspiration to this post, he’s awesome and you should go follow him on &lt;a href="https://twitter.com/AtSeansHandle"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>career</category>
      <category>codenewbie</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>CodeNewbies: Don’t let your past determine your future</title>
      <dc:creator>Simon Barker</dc:creator>
      <pubDate>Sat, 22 Jan 2022 13:08:10 +0000</pubDate>
      <link>https://dev.to/allthecode/codenewbies-dont-let-your-past-determine-your-future-1idc</link>
      <guid>https://dev.to/allthecode/codenewbies-dont-let-your-past-determine-your-future-1idc</guid>
      <description>&lt;p&gt;We often feel a debt to our past selves. We stay on a path because it’s the path we’ve always been on and changing course makes us feel like our past self was wrong.&lt;/p&gt;

&lt;p&gt;If there is one thing that humans hate, it is the feeling of being wrong.&lt;/p&gt;

&lt;p&gt;Just because you spent the first half of your life dedicated to being a biologist, physiotherapist or postman doesn’t mean that you can’t make a change.&lt;/p&gt;

&lt;p&gt;Don’t let where you have been decide where you go next, if you want to change to being a developer then draw a line in the sand and realise that no time was wasted, you weren’t wrong for pursuing something else and now you’re making a change.&lt;/p&gt;

&lt;p&gt;Take what you have learned in your previous career and apply that to tech, if you spent years working in a client facing role you’re going to be excellent at working with users on product improvement, if you spent years reading legal documents you’ll be great at whizzing through documentation and Grokking a new library quicker than other devs.&lt;/p&gt;

&lt;p&gt;I have a PhD in electrical engineering and often feel I should be using it in some way. The truth is I am, just not the bits you would expect:&lt;/p&gt;

&lt;p&gt;✍️ I wrote the better part of 200,000 words over my PhD and now I write on the internet every day &lt;br&gt;
🎙 I have given dozens of presentations and now I have a &lt;a href="https://podcasts.apple.com/id/podcast/career-switch-to-coding/id1577364291?uo=4"&gt;podcast&lt;/a&gt;&lt;br&gt;
📊 I managed my own time and projects and now I run a business &lt;a href="https://careerswitchtocoding.com/"&gt;teaching developers how to land early career jobs&lt;/a&gt;&lt;br&gt;
👨‍💻 I taught myself to code and now I code everyday &lt;/p&gt;

&lt;p&gt;Embrace your past and use it to spring into your new developer career.&lt;/p&gt;

&lt;p&gt;You can see this and some comments on Instagram as well:&lt;br&gt;
&lt;/p&gt;
&lt;div class="instagram-position"&gt;
  &lt;iframe id="instagram-liquid-tag" src="https://www.instagram.com/p/CY_3boBDisI/embed/captioned/"&gt;
  &lt;/iframe&gt;
  
&lt;/div&gt;


</description>
      <category>codenewbie</category>
      <category>career</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Become A Better Developer Today: Quick Wins</title>
      <dc:creator>Simon Barker</dc:creator>
      <pubDate>Thu, 09 Sep 2021 20:01:53 +0000</pubDate>
      <link>https://dev.to/allthecode/become-a-better-developer-today-quick-wins-4ll8</link>
      <guid>https://dev.to/allthecode/become-a-better-developer-today-quick-wins-4ll8</guid>
      <description>&lt;p&gt;Here are some common mistakes you might be making daily that are slowing you down, holding you back and building tech debt.&lt;/p&gt;

&lt;p&gt;🧪 &lt;strong&gt;Not writing tests&lt;/strong&gt;. Get used to writing these sooner rather than later. You don’t need to go full Test Driven Development (TDD) but at least be comfortable. I should have started earlier!&lt;/p&gt;

&lt;p&gt;📄 &lt;strong&gt;Not documenting code&lt;/strong&gt;. Coming back to old code is a nightmare without good docs, I can’t remember how code I wrote last week works so after 1 year I have no chance.&lt;/p&gt;

&lt;p&gt;🧰 &lt;strong&gt;Not breaking out common code into a reusable library&lt;/strong&gt;. Reusable code is your toolbox, it saves you time, effort and complexity. Start building your personal toolbox or your teams toolbox now.&lt;/p&gt;

&lt;p&gt;🍱 &lt;strong&gt;Forgetting to split projects into smaller modules&lt;/strong&gt;. Good organisation is the best way to keep a codebase sensible and manageable, it doesn’t come for free though so you have to work at it.&lt;/p&gt;

&lt;p&gt;🏛 &lt;strong&gt;Not using external libraries&lt;/strong&gt;. Build on other peoples code and don’t write everything from scratch, this lets you move faster, benefit from others work and you can focus on your core business logic.&lt;/p&gt;

&lt;p&gt;💅 &lt;strong&gt;Not using an auto code formatter&lt;/strong&gt;. Worrying about how to format and layout your code should be the last thing on your mind, get used to auto format on save and you will love it!&lt;/p&gt;

&lt;p&gt;🤖 &lt;strong&gt;Not automating&lt;/strong&gt;. There is a knack in knowing when to automate, too early in a process and you risk automating the wrong thing and having to change it, too late and you'll have an overly complex process to automate that will take weeks to sort out. If you've done the same thing 3 times in a short period of time (measured in weeks) then it's time to automate it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;None of these on their own will derail a software project but all of them can add friction to the development process and slow you down. Pick one and implement it in your current project today.&lt;/p&gt;

&lt;h3&gt;
  
  
  One more win
&lt;/h3&gt;

&lt;p&gt;Head over to &lt;a href="https://careerswitchtocoding.com/"&gt;Career Switch To Coding&lt;/a&gt; and join my mailing list for regular tips and a free chapter of my book 😀 &lt;/p&gt;

</description>
      <category>career</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>5 Interviews, 7 hours: Lessons From Not Getting A Big Tech Job Offer</title>
      <dc:creator>Simon Barker</dc:creator>
      <pubDate>Wed, 08 Sep 2021 17:35:05 +0000</pubDate>
      <link>https://dev.to/allthecode/5-interviews-7-hours-lessons-from-not-getting-a-big-tech-job-offer-12a4</link>
      <guid>https://dev.to/allthecode/5-interviews-7-hours-lessons-from-not-getting-a-big-tech-job-offer-12a4</guid>
      <description>&lt;p&gt;Earlier this year I broke one of my rules and interviewed with a tech company you &lt;em&gt;HAVE&lt;/em&gt; heard of, they aren't a FAANG but if the next tier down had an awkward acronym then they would be in that. I applied because I used this company's product daily for the better part of a decade and genuinely like it. It's well made, solves a huge pain point in the market and they have a loyal and growing user base.&lt;/p&gt;

&lt;p&gt;I need to stress how much I like this company's product because I genuinely don't think applying for Big Tech is worth the time and effort (doubly so for non-traditional programmers like me) due to the number of rounds and the puzzle like coding tests they tend to use. I was making a big exception with this one.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Application
&lt;/h2&gt;

&lt;p&gt;I applied for a Senior Backend role, spent around 90 minutes on the initial application and then thought I would never hear back as, quite honestly, I didn't think I would cut the mustard on what they were looking for. I have a PhD in Electrical Engineering but I am a 100% self taught developer and they are big enough that "CS Degree" could easily be one of their initial filters. Given how the process went, they probably should, but more on that later.&lt;/p&gt;

&lt;p&gt;Well, 24 hours after applying I had a request to book a coding test! To say I was excited is probably an understatement, I was grinning from ear to ear for the next day or so.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The Coding Test
&lt;/h2&gt;

&lt;p&gt;The first coding test was very enjoyable. The problem was to make an algorithm where, given an array of numbers like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[1,2,3,6,7,8,12,13]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I needed to produce a number of ranges to "describe" the series, so the above would be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[[1,3],[6,8],[12,13]]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I initially didn't understand the requirements so I asked for it to be explained another way and the interviewer said "think of it like a compression algorithm" at which point it clicked.&lt;/p&gt;

&lt;p&gt;I used a two pointer approach leaving one pointer looking at the start of the range and the other pointer traversing until the next number was greater than "the number I'm at + 1".&lt;/p&gt;

&lt;p&gt;Had a fun chat at the end with the interviewer, asked about their deployment times, team make up and what their favourite thing about the company was.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lesson&lt;/strong&gt;: if you don't get the task on the first read ask for another interpretation rather than sweating and stewing on what you're supposed to do.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Overall: 9/10, would do again.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The Life Story
&lt;/h2&gt;

&lt;p&gt;I was invited to the next stage a few days later and asked to arrange an hour to discuss my life and what brought me to this point. This was a non-technical discussion with an internal recruiter that was very enjoyable and overran by 10 minutes. I made two errors here that, while didn't damage my application I don't think, certainly made the interview more challenging.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;I went to an odd but interesting 6th form college (last two years before university) and I started there, I planned to cover this in a couple of minutes and then move on. The problem was that this was 17 years ago and the interviewer got very interested in it. I spent nearly 10 minutes covering off the period of my life between 16 to 18 and immediately left me feeling pressed for time and added some stress.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Due to the above I then rushed some later sections and didn't really do them justice when those sections were far more relevant.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Lesson&lt;/strong&gt;: Leave space for the recruiter to derail you, stick to relevant times in your life initially and if time allows reveal less relevant parts later on. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Overall: 7/10, would do again but would plan less content.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Technical Conversation
&lt;/h2&gt;

&lt;p&gt;I was invited to the next 3 stages in one go, blocking out a whole afternoon for 3 calls. The first was a technical chat with a principal engineer about a project of my choosing.&lt;/p&gt;

&lt;p&gt;I felt like this went well however this was the first time I made a real misstep that I was later told contributed to me not getting the role. I am a talker, I can often get on a bit of a roll and not leave enough opportunity for others to interject, apparently I did this in this interview and the interviewer felt I lacked some self-awareness.&lt;/p&gt;

&lt;p&gt;Wether I agree is somewhat irrelevant since it was how they felt and I am aware enough of my personality to know I do this sometimes. In person it is much easier for me to pick up on the body language that indicates someone else wants to talk, on a video call when sharing my screen this is all but impossible for me. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lesson&lt;/strong&gt;: Leave intentional breaks to allow the interviewer to interject and ask questions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Suggestion for interviewer&lt;/strong&gt;: Don't raise your standing desk and awkwardly track you head up at the same time just after asking your first main question, it's incredibly distracting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Overall: 7/10, it was an enjoyable experience and it was fun to talk about what I had spent the last 8 months working on.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Coding test 2
&lt;/h2&gt;

&lt;p&gt;This. Went. Badly.&lt;/p&gt;

&lt;p&gt;This interview is why I didn't get the job, I knew it half way through and my experience in this interview is why I just don't think self taught devs should apply to Big Tech unless you are prepared to waste a lot of time.&lt;/p&gt;

&lt;p&gt;This was a "Pair Programming" test, in reality it was a coding test just like the first round and I was asked to implement Conway's Game of Life.&lt;/p&gt;

&lt;p&gt;In speaking to lots of people afterwards this is apparently a common task to be set on degrees and in coding bootcamps, I had never even heard of it, let alone solved it before. I was also told by a number of that they thought it was "a bit harsh" to ask in an interview. I don't really have an opinion, I trust the interview knows what they are looking for.&lt;/p&gt;

&lt;p&gt;I stumbled my way to a solution in 50 minutes, went down two dead ends, didn't understand a suggestion from the interviewer and generally wasn't proud of the code I had written.&lt;/p&gt;

&lt;p&gt;When asked what else I would do at the end of this I said: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I would significantly restructure this code, given that this is a solved problem I would research the best solution and implement it that way to get the best result". &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The follow up question was "if this wasn't a known problem with a solution what would you do if this were a work task" I said I would speak to my team to see if they had seen something similar and have someone review where I had gotten to and make suggestions.&lt;/p&gt;

&lt;p&gt;Apparently this answer didn't make up for the code I had written as the feedback I was given was "Inelegant solution and poorly structured code" 🤷‍♂️ I will come back to this line at the end ....&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lesson&lt;/strong&gt;: try to cover off as many of the potential interview puzzles ahead of time so you are reimplementing a solution rather than solving it for the first time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Overall: 1/10 I really didn't enjoy this interview.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Final Coding Test
&lt;/h2&gt;

&lt;p&gt;After a 20 minute break I had one more round to go. It never even crossed my mind to back out but my brain was fried and I was not feeling confident.&lt;/p&gt;

&lt;p&gt;This interview was to implement and LRU Cache. I hadn't come across this before either but this is the kind of programming that is right up my alley. A known set of requirements, a tangible problem to be solved and a clear outcome.&lt;/p&gt;

&lt;p&gt;I really enjoyed this test, it actually did almost feel like pair programming as well. The interviewer was very friendly, we had some side chat about Swift (even though I was testing in JS) and their experience with it which helped ease me back into a relaxed coding mode.&lt;/p&gt;

&lt;p&gt;I was told in feedback that the solution I chose was their least favourite approach however that was fine because I discussed all of my reasons, the trades offs I knew I was making and why they were probably ok given the end use case.&lt;/p&gt;

&lt;p&gt;I was also told that in response to the previous interviewers line of "Inelegant solution and poorly structured code" this interviewer said "Did we interview the same candidate?" which is nice.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lesson&lt;/strong&gt;: never quit a process until it's over, if I had walked away after the previous interview I wouldn't have experienced this one, I would have had a sour taste in my mouth over the whole thing and I would have missed out on an hour and a bit with an awesome person who I thoroughly enjoyed my time with.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Overall: 10/10 would chat with again just for fun.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Feedback
&lt;/h2&gt;

&lt;p&gt;After 5 days I got an email to say I was unsuccessful and that I could have a 15 minute chat if I liked to hear why.&lt;/p&gt;

&lt;p&gt;I have weaved that feedback into the above narrative and it was very welcome. At the start of the call the recruiter asked if I had any ideas on why I didn't get an offer and I said "Conway's Game of Life" with a grin on my face, they chuckled (nicely) and said "yeah, pretty much".&lt;/p&gt;

&lt;p&gt;They they also told me about talking too long in the technical conversation which was extra useful information.&lt;/p&gt;

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

&lt;p&gt;Overall I am glad I went through this process however, I don't intend to apply to a company with a lengthy interview process again. This took up 7 hours of my time and, while the process was managed well, the people were nice and I gained some experience, I still ultimately fell down on a puzzle that if I had a CS degree I would probably have come across before.&lt;/p&gt;

&lt;p&gt;Outside of this I've had 10 job offers in the past 2 years off the back of 2 to 3 round interview processes so it is totally possible to get job offers without the hoops described above.&lt;/p&gt;

&lt;p&gt;If you want more of this sign up to my mailing list at &lt;a href="https://careerswitchtocoding.com/"&gt;Career Switch To Coding&lt;/a&gt;&lt;/p&gt;

</description>
      <category>career</category>
      <category>programming</category>
      <category>codenewbie</category>
      <category>devjournal</category>
    </item>
    <item>
      <title>Could #buildInPublic Get You A Job?</title>
      <dc:creator>Simon Barker</dc:creator>
      <pubDate>Tue, 07 Sep 2021 14:34:06 +0000</pubDate>
      <link>https://dev.to/allthecode/could-buildinpublic-get-you-a-job-4j50</link>
      <guid>https://dev.to/allthecode/could-buildinpublic-get-you-a-job-4j50</guid>
      <description>&lt;p&gt;#buildInPublic is all the rage at the moment in the IndieHackers scene and I think it is a great thing for new developers looking for a job to do as well. Basically keep your side project code in a public GitHub repo and tell people about it. Talk about what you are making, the choices you made and what you are finding tricky.&lt;/p&gt;

&lt;p&gt;This idea is probably mortifying to you, that’s ok. Putting our code out into the world is scary, you will make mistakes and have some questionable design decisions BUT, it will give you one thing that is vital when you are coding in a job and that is the experience of knowing other people can, and will, view your code.&lt;/p&gt;

&lt;p&gt;In any good software team, your code will be reviewed by a team member before it is merged into the main codebase. This is an opportunity to catch mistakes, make sure one other person knows what you are doing and for them to make constructive comments on how to improve it.&lt;/p&gt;

&lt;p&gt;Coding in public means you can ask other people to look at your code to simulate this- ask other coders on Reddit, Instagram, Slack/Discord, StackExchange etc. if they can take a look. Start with a small specific function and if you build a rapport you can ask them to look wider at the repo. Don’t expect masses of depth but even 5 minutes of a senior developer looking at your code can really improve your skills.&lt;/p&gt;

&lt;p&gt;Getting used to this sooner rather than later ticks this off and makes it a complete non issue at the interview. I have been asked a number of times, “a team member has made a suggestion on your code, how would you handle this?” If you have had your code in public for a while you will have this question sorted and won’t be phased by it.&lt;/p&gt;

&lt;p&gt;If you want more like this go sign up to the &lt;a href="http://careerswitchtocoding.com"&gt;CareerSwitchToCoding.com&lt;/a&gt; mailing list and get a free chapter of my book 😀&lt;/p&gt;

</description>
      <category>career</category>
      <category>webdev</category>
      <category>codenewbie</category>
      <category>programming</category>
    </item>
    <item>
      <title>6 Tips To Beat The Take Home Coding Test</title>
      <dc:creator>Simon Barker</dc:creator>
      <pubDate>Mon, 06 Sep 2021 17:09:05 +0000</pubDate>
      <link>https://dev.to/allthecode/6-tips-to-beat-the-take-home-coding-test-6od</link>
      <guid>https://dev.to/allthecode/6-tips-to-beat-the-take-home-coding-test-6od</guid>
      <description>&lt;p&gt;Take home coding tests are seen by many as the ideal alternative to stressful in person live tests. While that may be true to a certain extent, it doesn't mean that there aren't pitfalls to be wary of, here are my 6 top tips for making sure you crack your next take home test:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Make sure you know exactly when the test is due&lt;/strong&gt;, they might be casual about it but see if you can nail them to a deadline. This would be expected in a job and so you should do the same here, it actually works in your favour as well, if they want it done in 24 hours and you had been thinking "I'll get to it at the weekend" you can now re-asses.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Don’t be afraid to ask questions about it if you need to&lt;/strong&gt;. It’s unlikely that they have covered off literally everything in the spec. If you are short on time and just want to get started then add a comment to the readme about an assumption you made that saved you asking a question.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add a readme, explain your thinking and approach&lt;/strong&gt;. At the end of the readme add some notes on what you found challenging and how you would improve it. Make sure the readme contains all steps required to get the project up and running so that they can run it locally if they want to.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ideally host it as a Github repo and send them the link to it&lt;/strong&gt;. Emailing projects with many files zipped up can be flaky.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flag best practice breaches&lt;/strong&gt;. If you go down the Github route and have passwords or API tokens in your code then highlight in the readme, or in a comment, that you know this is bad practice but for the purposes of the test you have included them. If the test specifically tells you not to do this then don’t, however that’s getting beyond what I think would be expected of in a reasonable take home test.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Don’t solve more than they ask for&lt;/strong&gt;, the idea here is that you have been given a task to do to assess your coding skills and your ability to follow instructions. By all means do a good job but this isn’t the time to “express yourself”.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There you have it, everything you need to make sure your next take home test.&lt;/p&gt;

&lt;p&gt;If you want more like this head over to &lt;a href="http://careerswitchtocoding.com"&gt;CareerSwitchToCoding.com&lt;/a&gt; and sign up to the mailing list for a free chapter from my book 😀&lt;/p&gt;

</description>
      <category>career</category>
      <category>programming</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>"Smallest Unit of Learning": Dealing with the ever expanding world of development</title>
      <dc:creator>Simon Barker</dc:creator>
      <pubDate>Sun, 05 Sep 2021 17:09:04 +0000</pubDate>
      <link>https://dev.to/allthecode/smallest-unit-of-learning-dealing-with-the-ever-expanding-world-of-development-2am9</link>
      <guid>https://dev.to/allthecode/smallest-unit-of-learning-dealing-with-the-ever-expanding-world-of-development-2am9</guid>
      <description>&lt;p&gt;There is so much to learn and know in software development that it can be overwhelming. When you first set out to learn it's like you're a child in the middle of a huge field full of toys that you know are amazing but have no idea how to play with, or what they even do.&lt;/p&gt;

&lt;p&gt;As you progress through your career this feeling subsides a little bit as you build the foundational skills that let you pick up a toy and think "huh, this looks like that other toy I played with last week but it's red and made from cork instead of plastic" and you can muddle your way though.&lt;/p&gt;

&lt;h2&gt;
  
  
  More technology to learn than time to learn it
&lt;/h2&gt;

&lt;p&gt;The problem that remains through all of our careers is that there is significantly more to learn than any one person can hope to cover in a life time. In fact I would go so far as to say that many developers already interact with enough different technologies each day that even learning all of those properly is a lifetimes work.&lt;/p&gt;

&lt;p&gt;For example, gone are the days where a web developer could hold the entirety of that industry's knowledge in their head. 20 years ago when the web was first taking on a form that would be recognizanble as what we have today, it was probably possible to know everything about how it worked. Now, that just isn't the case, we have layer upon layer of abstraction running so deep that we've made a technological Mariana trench, and we are still digging!&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do as a code newbie?
&lt;/h2&gt;

&lt;p&gt;Depending on where you are in your career I see two options. If you are new to coding and still finding your feet, then focus on fundamentals. I'm not one of these militant people who says you must master data structures and algorithms before even looking at things like React or Django but I do think it's important to know where you would like to work for the first portion of your career and focus on the fundamentals in that area to begin with. &lt;/p&gt;

&lt;p&gt;If you want to be a front end web developer then HTML/CSS, JS and React are probably your best initial focusses. f you want to be an iOS developer then you want to learn Swift, UIKit and a smattering of SwiftUI.&lt;/p&gt;

&lt;p&gt;Don't hop around too much or get distracted by the new and the shiny, you will keep picking up and putting down toys and never really learn how to enjoy one fully. All those other technologies will be there to pick up in the future, and having good fundamentals in one area will actually transfer very well into other technologies - you are rarely starting from scratch again.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do if you're mid career?
&lt;/h2&gt;

&lt;p&gt;If you are mid career, like me, then you have probably already been through a few cycles of "learn it all" and "I don't want to touch a keyboard for a second longer than needed" already. I have oscillated between fear of missing the next big thing and just wanting to go back to using JQuery many times already.&lt;/p&gt;

&lt;p&gt;The thing that I have recently found that helps is to not force myself to learn everything new just because the whole world seems to be focussing on it. Instead look at what my current job, or the next job I want, actually need and then make something fun in that technology.&lt;/p&gt;

&lt;p&gt;This is hard if the next thing I need to learn is a bit boring or specific to a larger scale application but if it's a new flavour of database or front end tech then I will spin up an old project I know pretty well and reimplement some, or all, of it in said new technology. These projects are small, fun and useful to my life, so I usually quite enjoy pottering about with them because I don't need to think through the business logic too much and can focus on the fun of learning a new thing.&lt;/p&gt;

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

&lt;p&gt;Regardless of where you are on your coding journey you will feel pressure to learn and to keep up but don't loose sight of the end goal, which is to make products and solve problems. With a few exceptions it doesn't really matter what technology you use and hopping between them isn't all that hard once you have a good grasp in one area. Find enjoyment in the learning process and don't try to take on too much, focus on the smallest next unit of learning that can add value to your daily work.&lt;/p&gt;

</description>
      <category>career</category>
      <category>codenewbie</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Stop! Put Down That Ternary, Lines Are Free</title>
      <dc:creator>Simon Barker</dc:creator>
      <pubDate>Sat, 04 Sep 2021 08:20:49 +0000</pubDate>
      <link>https://dev.to/allthecode/stop-put-down-that-ternary-lines-are-free-2pf9</link>
      <guid>https://dev.to/allthecode/stop-put-down-that-ternary-lines-are-free-2pf9</guid>
      <description>&lt;h2&gt;
  
  
  Variable Names
&lt;/h2&gt;

&lt;p&gt;We have all opened up code that looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fds&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fda&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;fdb&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;gtr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and wondered if the original author hated the universe, was a genuine genius or was somehow allergic to typing. There is nothing in that code to indicate what those variable relate to or how &lt;code&gt;fds&lt;/code&gt; might be useful in the future.&lt;/p&gt;

&lt;p&gt;The variable names are meaningless to our brain and remembering these letter groupings while tracing their use through the code adds a huge amount of cognitive load. &lt;/p&gt;

&lt;p&gt;Fortunately we have, in the main, moved away from this type of variable naming. It was ripe in the Fortran and early C days but now we use more descriptive names that show the intent of the code and it is much easier follow along. If a variable is called &lt;code&gt;maxWidth&lt;/code&gt; it is much easier to understand and remember than &lt;code&gt;mW&lt;/code&gt;. It's the different between holding a group of letters in your head vs the concept of what it represents, are brains are pretty terrible at the former but excellent at the latter.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ternaries and Destructuring
&lt;/h2&gt;

&lt;p&gt;Whilst we have clearly improved when it comes to naming variables there is an area of coding that we are going backwards in, and that is the desire for smaller and smaller files - even at the cost of legibility.&lt;/p&gt;

&lt;p&gt;Small composable blocks of code is a great ideal to aim for, having 45 tabs open in a code editor isn't always ideal but it probably is better than 3 files of 2,000+ lines each. However, I would rather have those 3 big files to wrangle than dozens or hundreds of the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;header&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;personId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;storeId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;locationId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;stockUnit&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;msg&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;isAdmin&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;All Allowed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;isManager&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Some Allowed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;isAlien&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Run&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Not Allowed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In isolation the above examples are reasonably understandable (I've chosen fairly simple examples) however, amongst a full application, surrounded by other business logic and less straightforward variable names, both of these can be written in a longer, more understandable manner. Let's take that ternary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Not Allowed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;isAdmin&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;All Allowed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;isManager&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Some Allowed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;isAlien&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Run&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above is considerably longer but much easier to read. The added vertical space is a more than worthwhile tradeoff in the aid of readability to me.&lt;/p&gt;

&lt;p&gt;We should be striving to write code that is understandable to the newest and least experienced members of the team. Business logic is where the complexity should lie in code, not in the syntax itself. When a new developer or new team member is reading unfamiliar code they should be focussing all of their efforts on understanding the what the code does and not the exotic structures used to save a few lines.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rise of ternary
&lt;/h2&gt;

&lt;p&gt;Ternary operators have always been a bit of syntactic sugar to make very simple &lt;code&gt;if/else&lt;/code&gt; statements shorter. I would agree that an &lt;code&gt;if/else&lt;/code&gt; that takes up only 5 lines and is very simple should be simplified, however the rise in ternary in the Javascript world over the last decade is starting to get out of hand. I'm starting to see multi level ternaries with &lt;code&gt;map&lt;/code&gt; and &lt;code&gt;find&lt;/code&gt; in them where that all important &lt;code&gt;:&lt;/code&gt; of the ternary becomes impossible to spot.&lt;/p&gt;

&lt;p&gt;I think this has happened thanks to React, more specifically JSX, and it's liberal use of ternary statements for conditional rendering. I don't want this to become a rant on JSX (which at worst I would say I am ambivalent on) but let's not let JSX practices bleed in to JS/TS and other best practice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Take Away
&lt;/h2&gt;

&lt;p&gt;Code for legibility and not brevity. We moved away from terse and incomprehensible variable names, let's not regress with the equivalent with syntax.&lt;/p&gt;

&lt;p&gt;If you want a selfish motivation then I ask: would you rather new team members just understand the code you wrote or spend the rest of your days in that company answering questions about it?&lt;/p&gt;

&lt;h2&gt;
  
  
  Update
&lt;/h2&gt;

&lt;p&gt;As some awesome people have highlighted in the comments below, I got this code wrong and the ternary to &lt;code&gt;if/else&lt;/code&gt; is wrong. I wrong this code specifically for the article, didn't test it properly and only thought about one of the variables was true, in which case a switch statement on an enum would have been better. I still stand by multi-level ternaries being worse than a &lt;strong&gt;correct&lt;/strong&gt; if/else equivalent however in this case I choose a poor example.&lt;/p&gt;

</description>
      <category>career</category>
      <category>webdev</category>
      <category>codenewbie</category>
      <category>programming</category>
    </item>
    <item>
      <title>30 Developer Portfolio Project Ideas</title>
      <dc:creator>Simon Barker</dc:creator>
      <pubDate>Fri, 03 Sep 2021 16:30:26 +0000</pubDate>
      <link>https://dev.to/allthecode/30-developer-portfolio-project-ideas-3kh5</link>
      <guid>https://dev.to/allthecode/30-developer-portfolio-project-ideas-3kh5</guid>
      <description>&lt;p&gt;It's hard to know what projects to make when trying to flesh out your portfolio, often we get caught up thinking it needs to be something unique. Projects need to be small, complete and functional, making your own take on any of these well trodden paths would be a great project for your portfolio. Each idea has a suggested rough tech stack you could use but in reality you could make all of these in pretty much any technology.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Straw Poll Web App - React, NestJS&lt;/li&gt;
&lt;li&gt;Pokedex - Angular, PokeApi.co&lt;/li&gt;
&lt;li&gt;Weather App - SwiftUI, &lt;a href="http://openweathermap.org/api"&gt;openweathermap.org/api&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Tweet Scheduler - JS/HTML/CSS and Supabase&lt;/li&gt;
&lt;li&gt;Workout creator- Kotlin, Android&lt;/li&gt;
&lt;li&gt;Timer Web App - React&lt;/li&gt;
&lt;li&gt;Reminders text message - Vue, Twilio&lt;/li&gt;
&lt;li&gt;Crypto Tracker - Angular, ExpressJS&lt;/li&gt;
&lt;li&gt;Chat Web App - React, socket.io, NestJS&lt;/li&gt;
&lt;li&gt;File Uploader Plugin - Angular, Ruby&lt;/li&gt;
&lt;li&gt;IMDB Ratings Scraper - HTML/CSS, Python&lt;/li&gt;
&lt;li&gt;Egg Timer - HTML/CSS, JS, CapacitorJS&lt;/li&gt;
&lt;li&gt;Meme Maker - UIKit, Swift&lt;/li&gt;
&lt;li&gt;Colour Picker App from Camera - Flutter, Dart&lt;/li&gt;
&lt;li&gt;Tax Calculator - Angular&lt;/li&gt;
&lt;li&gt;Slack Plugin - JS&lt;/li&gt;
&lt;li&gt;Shopify Theme - NodeJS, React, GraphQL&lt;/li&gt;
&lt;li&gt;Wordpress Plugin - HTML/CSS, JS, PHP&lt;/li&gt;
&lt;li&gt;Instagram Post Maker - Kotlin, Android&lt;/li&gt;
&lt;li&gt;Todo List CLI App - Python&lt;/li&gt;
&lt;li&gt;Notes App - UIKit, AppKit&lt;/li&gt;
&lt;li&gt;Flash Card App - SwiftUI&lt;/li&gt;
&lt;li&gt;GitHub Timeline - Vue&lt;/li&gt;
&lt;li&gt;Conway's Game Of Life - HTML/CSS, JS&lt;/li&gt;
&lt;li&gt;Expenses Tracker - React, Electron&lt;/li&gt;
&lt;li&gt;Currency Converter - React&lt;/li&gt;
&lt;li&gt;Clone an App - same tech&lt;/li&gt;
&lt;li&gt;URL Shortener - HTML/CSS, JS, Lavarel&lt;/li&gt;
&lt;li&gt;Mine Sweeper - PhaserJS&lt;/li&gt;
&lt;li&gt;Habit Tracker - Swift, UIKIt&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>career</category>
      <category>codenewbie</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
