<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sarah O’Brien on Medium]]></title>
        <description><![CDATA[Stories by Sarah O’Brien on Medium]]></description>
        <link>https://medium.com/@sarbot?source=rss-4d8ead75a2e5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*XGwJgORw0cZZ9UW2fFrsfA.jpeg</url>
            <title>Stories by Sarah O’Brien on Medium</title>
            <link>https://medium.com/@sarbot?source=rss-4d8ead75a2e5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 02:50:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sarbot/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[So you want to be a better developer?]]></title>
            <link>https://levelup.gitconnected.com/so-you-want-to-be-a-better-developer-1f9894a1e991?source=rss-4d8ead75a2e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f9894a1e991</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[motivation]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Sarah O’Brien]]></dc:creator>
            <pubDate>Sat, 01 Dec 2018 14:19:05 GMT</pubDate>
            <atom:updated>2019-01-11T12:28:50.786Z</atom:updated>
            <content:encoded><![CDATA[<h3>So you want to be a better developer? — Tips for your journey from junior to senior software engineer.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*5INViibAjl_5Da5ECtzo2Q.jpeg" /></figure><p>Recently at work my colleague and I have been tasked with creating a learning path for junior developers who want to learn the front end. This is something we are still working on but it got me thinking about my journey and how I got from a junior developer, who knew relatively little, to a senior developer who knows a little bit more.</p><p>After college I went straight into work. Working within a team of experienced developers a couple of things quickly became apparent:</p><ul><li>What I learned in college barely scratched the surface</li><li>If I wanted to be a good developer it would be a life-long learning journey</li><li>There was a lot I didn’t know and <em>even more I didn’t know I didn’t know</em></li></ul><p>That last point is the most important lesson I learned very early on in my career. Firstly, <strong><em>just say you don’t know</em></strong> if you don’t know something. It’s so much better than just pretending and it means you will actually learn more. Secondly, “<strong>You don’t know what you don’t know</strong>”, it sounds funny but once you realise it and embrace it, it can be quite powerful. For me, it drove my curiosity. It made me ask questions, delve deep into topics and try to figure out not only the things I knew I needed to learn but also identify the things I had not yet discovered I needed to learn.</p><p>So what did I do? Well at times I felt extremely overwhelmed, “how the heck was I going to ever be as good as the developers around me?”. There was just too much to learn. Spoiler alert for all you new developers, <strong>there will always be too much to learn</strong>. It’s the nature of our industry. It’s what makes it fun and exciting, and also terrifying and exhausting. The key is to do your best not to let it get to you and just focus on getting better at whatever skill you’ve selected. For me it was JavaScript. While my strength at the time was Java because I had done a lot of it in college, my passion was for the web and front end. I knew if I wanted to go down that road the first priority was JavaScript, So I’d identified the first area of focus, what now?</p><h4>Learn the Rules</h4><p>Remember you can learn all the frameworks you want but if you don’t have a good grasp on the fundamentals of the underlying language you won’t be properly equipped to deal with issues as they arise. Do you ever hear people complain about a language, like “Ugh I hate JavaScript, it doesn’t make sense.” Well it doesn’t make sense because you don’t understand it yet. If you take the time to delve into the problem and figure it out, it will most definitely make sense. Trying to work with something when you don’t fully understand the basics can be extremely frustrating. Which is why my most important recommendation if you take nothing else away from this is to <strong>learn the basics. </strong>This goes for any language. Spend time really getting to grips with the language and all its nuances.</p><h4>Don’t be afraid to ask questions</h4><p>This one is key. I know how intimating it can be, feeling like you are the only person in a room who doesn’t “get” something. That insecurity might prevent you from ever asking the necessary questions to help you understand. But you have to push through it, <strong>ask all the questions. </strong>If you are working as part of a team, ask your teammates. If you are self-learning, ask the internet. Just ask the question. Remember there is no such thing as a stupid question. There is no need to struggle alone when you could simply reach out and ask for help.</p><h4>Practice. Practice. Practice.</h4><p>You can read as many books as you want, and watch all the YouTube tutorials there are, but the best way to learn is through doing. Practice your craft. And most importantly be consistent about it. That’s the best way to progress quickly. Practice. Learn. Practice more. Learn more. You don’t need to have some grand project to work on either, do a daily kata or find something cool on a website and try to implement it. Some good resources for inspiration are the katas on <a href="https://www.codewars.com/">codewars</a> and the challenges on <a href="https://www.reddit.com/r/dailyprogrammer/">reddit daily programmer</a>. The point is to just practice. I used to challenge myself to solving a kata a day, usually in the morning. The more you do, the faster you build your skill and it’s also a lot of fun. You can also learn a lot from looking at other peoples solutions and how you could have improved yours.</p><h4>Find someone who knows more than you</h4><p>If you can identify a mentor, they can be invaluable to building your skill. Someone who you can ask questions, discuss concepts with and who can help you on your journey. This could be a fellow colleague or a friend in a similar field, basically anyone who you can look at and say I want to know what they know.</p><h4>Be Persistent</h4><p>This is not an easy path, it’s a long road of learning and then when the new thing comes out… learning some more. It can feel overwhelming but as you get more experienced it does get easier. Just keep at it. Persistence is the most important quality in any developer. Persist through the problems, persist through that imposter syndrome, persist through the mistakes. It’s all just one big learning experience. Persist and you will triumph.</p><p>If you’ve made it this far thanks for reading my ramblings, I hope it helps in some way and best of luck on your coding journey :)</p><figure><a href="https://levelup.gitconnected.com/"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JaoZbi7tTKJ5vL7i2OAYMQ.png" /></a></figure><p><a href="https://gitconnected.com/learn">Learn to Code - Find Programming Tutorials | gitconnected</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f9894a1e991" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/so-you-want-to-be-a-better-developer-1f9894a1e991">So you want to be a better developer?</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sorting in JavaScript]]></title>
            <link>https://medium.com/@sarbot/sorting-in-javascript-a9c04f865267?source=rss-4d8ead75a2e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9c04f865267</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[javascript-for-beginners]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[code]]></category>
            <dc:creator><![CDATA[Sarah O’Brien]]></dc:creator>
            <pubDate>Tue, 24 Jul 2018 07:31:49 GMT</pubDate>
            <atom:updated>2018-07-24T07:36:47.895Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gA9oaF0zV-PnIEg4rtxQVw.jpeg" /></figure><p>JavaScript arrays have a bunch of nifty features, one of which is the sort method.</p><p>The sort method will sort the items in an array and return the array.</p><p>By default the sort order is determined by converting each item to strings and comparing their unicode value.</p><pre>const names = [‘Buffy’, ‘Xander’, ‘Angel’, ‘Willow’, ‘Giles’, ‘Anya’];</pre><pre>names.sort();</pre><pre>// result: [“Angel”, “Anya”, “Buffy”, “Giles”, “Willow”, “Xander”]</pre><p>Cool that worked, seems pretty easy when our value is a string. What about numerical values though?</p><p>Let’s take an example, say we have an array of random numbers; let’s call them user ages for context. We have a requirement to sort the user ages from youngest to oldest.</p><pre>const ages = [16, 24, 61, 31, 17, 39, 27, 8, 12, 82, 48, 42, 26, 46, 76, 84, 89, 46, 62, 28];</pre><pre>ages.sort(); // no custom function provided</pre><pre>// result: [12, 16, 17, 24, 26, 27, 28, 31, 39, 42, 46, 46, 48, 61, 62, 76, 8, 82, 84, 89]</pre><p>Hmmm this looks okay but wait I’m pretty sure 8 doesn’t come after 76 numerically!</p><p>Without the custom function, each item is converted to a string and sorted based on their Unicode characters which does not work here as we are comparing numerical values not strings.</p><p>Don’t worry though we can just provide a custom compare function to determine our sort order.</p><p>The compare function has two arguments, typically these arguments are referred to as a and b but you can name them whatever you’d like.</p><p>Let’s create our sort function:</p><pre>const customSort = ages.sort((a, b) =&gt; {<br>if(a &gt; b){<br> return 1;<br>}else{<br> return -1;<br>}<br>});<br>// result: [8, 12, 16, 17, 24, 26, 27, 28, 31, 39, 42, 46, 46, 48, 61, 62, 76, 82, 84, 89]</pre><p>That looks better, but what are we actually doing here? The sort function will run over our array taking two arguments at a time, compare them and then move onto the next two until the sort is complete.</p><p>In our function we are saying, if a is greater than b then return 1, this will sort a to an index higher than b, otherwise return -1, this will sort a to an index lower than b.</p><p>Cool! What about sorting arrays of objects? Don’t worry we can sort objects no problem, we first need to identify what we want to sort by, let’s take this array of objects:</p><pre>const objects = [{name: ‘Buffy’, year: 1981}, {name: ‘Angel’, year: 1727}, {name: ‘Anya’, year: 860}, {name: ‘Spike’, year: 1850}];</pre><p>Say we want to sort by year of birth, and we want to sort from youngest to oldest. Here we just need to specify the property we are comparing in our custom function.</p><pre>const customSort = objects.sort((a, b) =&gt; {<br>if(a.year &gt; b.year){<br>return -1;<br>}else{<br>return 1;<br>}<br>});</pre><p>Because we want youngest to oldest this time we just reverse the logic and return -1 if the a.year is greater than b.year and 1 if the a.year is less than b.year.</p><p>And that’s it, that’s the JavaScript sort function! Thanks for reading. Hope this explanation helped you on your journey with JavaScript. If it did maybe give it a clap or leave a comment :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9c04f865267" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CSS, margin vs. padding.]]></title>
            <link>https://medium.com/@sarbot/css-margin-vs-padding-8b305fc3d433?source=rss-4d8ead75a2e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b305fc3d433</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[styling]]></category>
            <dc:creator><![CDATA[Sarah O’Brien]]></dc:creator>
            <pubDate>Fri, 19 Jan 2018 21:21:04 GMT</pubDate>
            <atom:updated>2018-01-19T23:28:16.208Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*HFg_xXXr7Dpq9USU57Hbjw.jpeg" /></figure><p>When I was a newbie to CSS, I used to get margin and padding confused all the time. This is information I now take for granted because I know it and it’s like second nature, recently though I was working on a project with more junior developers and I noticed they were consistently using margin and padding incorrectly, I realised it might seem obvious to me but to those starting out with CSS it can be confusing. I hope to explain them both here and provide some clarity for any one who is confused, as I once was.</p><h3>Margin:</h3><p>Margin is a CSS property for defining space around an element, so outside the element. An example might be creating space between two divs. The example below shows two divs without any margin, so there is no space between them.</p><p>Example:</p><pre>&lt;div&gt;<br>This div has no margin!<br>&lt;/div&gt;</pre><pre>&lt;div class=”space”&gt;<br> This div has a margin!!<br>&lt;/div&gt;</pre><pre>div {<br> border: 2px solid #000;<br> width: 100px;<br> background-color: #2471A3;<br> color: #fff;<br> font-family: Arial;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/127/1*4uNwyisNZNAOZjYHPbWM7A.png" /><figcaption>No margin or padding.</figcaption></figure><p>Now let’s add a margin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/147/1*e7LmxbmnYFtm5ynhwHYeBg.png" /><figcaption>We added a margin.</figcaption></figure><pre>.space{<br> margin: 20px;<br>}</pre><p>We can add a margin to all sides by setting the property and giving it one value like above, or we can specify exactly which sides and use multiple values, the properties are margin-top, margin-bottom, margin-right, margin-left, or for short we can give the margin property multiple values and it will apply it to each side. e.g. margin: 20px 10px 20px 10px; will apply a margin of 20px to the top, 10px to the right, 20px to the bottom and 10px to the left. It applies it in clockwise direction, TRBL, (top, right, bottom, left).</p><h3>Padding</h3><p>Padding is for creating space around an elements content, so inside the element. Looking at our simple example above there’s now space between our divs but the content inside still looks pretty squashed. We can fix this by adding some padding. We’ll modify our space class to add padding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/201/1*_b1tLIE25_2p9Gp4eQJTtw.png" /><figcaption>We added some padding.</figcaption></figure><pre>.space{<br> margin: 20px;<br> padding: 20px;<br>}</pre><p>Like margin, we can add padding to all sides by specifying one value, or specify multiple values, or use the explicit property for each side.</p><p>To summarise <strong>margin</strong> is <strong><em>outside</em></strong> the element and <strong>padding</strong> is <strong><em>inside</em></strong> the element. I hope this makes things a bit clearer. Happy Coding :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b305fc3d433" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Declaring variables with JavaScript & ES6]]></title>
            <link>https://medium.com/@sarbot/declaring-variables-with-javascript-es6-ab71c0a60768?source=rss-4d8ead75a2e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab71c0a60768</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[beginner-javascript]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Sarah O’Brien]]></dc:creator>
            <pubDate>Thu, 10 Aug 2017 22:16:40 GMT</pubDate>
            <atom:updated>2017-08-11T06:12:28.699Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5bIGafTbCbY3BG5akMJGgQ.jpeg" /></figure><p>ES6 has been around for a while now, and brought with it a lot of cool changes for JavaScript. One of those changes is how we <br>declare variables. We now have three options: var, let and const. This post is going to attempt to explain them in a simple and hopefully helpful way. Let’s start.</p><h3><strong>var</strong></h3><p>Before ES6 we used the var keyword. A variable declared with var can be initialized immediately but doesn’t need to be. Lets take a look at an example:</p><pre>var superhero = &#39;Batman&#39;; // we initialized the variable immediately<br>var villain;</pre><pre>if(superhero === &#39;Batman&#39;){<br>    villain = &#39;The Joker&#39;; // we initialized the variable later<br>}</pre><p>With var the variable is declared on either the global scope or within function scope. For example:</p><pre>var name = &#39;Bob&#39;;</pre><pre>function getName(){<br> var name = &#39;Bill&#39;;<br>  return name;<br>}</pre><pre>console.log(getName()); //logs Bill</pre><pre>console.log(name); //logs Bob<br></pre><p>In the example above ‘Bob’ is declared on the global scope but even though we are using the same variable name, ‘Bill’ is declared on the function scope<br>and so logging name will result in ‘Bob’ while logging getName() will result in ‘Bill’.</p><h3>let</h3><p>ES6 gave us the let keyword. let works similarly to var, variables can be either immediately initialized or not. With let we get block level declaration scope. Let’s take a look at an example:</p><pre>function varScoped(){</pre><pre>  var num = 1;<br>  <br>  if(num === 1){<br>   var num = 2;<br>    console.log(&#39;I am within function scope&#39;,num); //logs 2<br>  }<br>  console.log(&#39;I am within function scope too&#39;,num); //logs 2<br>   <br>}</pre><pre>function letScoped(){<br> <br>  let num = 1;<br>  <br>  if(num === 1){<br>   let num = 2;<br>    console.log(&#39;I am within block scope&#39;,num); //logs 2<br>  }<br>  console.log(&#39;I am within function scope&#39;,num); //logs 1<br>}</pre><p>In the first function above we are declaring our variable with var, so as discussed earlier variables will be at function scope. Even though it might seem like we are re-declaring <em>num</em> in the if block, we are overriding our previous declaration and so <em>num </em>logs as 2 both inside and outside the if block.</p><p>In the second function we are declaring with let, because let gives us block level scope our <em>num </em>variable within the if block is on a different scope to the <em>num </em>variable outside it, they don’t interfere with each other and so <em>num </em>logs as 2 inside the if block and retains it’s value of 1 outside the if block.</p><h3>const</h3><p>Last but not least we have const. Unlike var or let a const needs a value assigned to it on declaration.</p><p>So we cannot do this:</p><pre>const num;<br>num = 5;</pre><p>We need to do this:</p><pre>const num = 5;</pre><p>Declaring a variable with const means this value will not change and cannot be reassigned within that block scope. Let’s look at an example:</p><pre>function constScopedA(){</pre><pre>const num = 5;</pre><pre>if(num === 5){<br>    num += 1; // this will throw an error: Uncaught TypeError: Assignment to constant variable.<br>   }<br>}</pre><p>In the above example an error is thrown when we try to reassign the variable <em>num</em>. The variable identifier cannot be reassigned.</p><p>However as const, like let, is also block scoped, we can do this:</p><pre>function constScopedB(){</pre><pre>const num = 5;</pre><pre>if(num === 5){<br>   const num = 6; <br>    console.log(num); //log 6<br>  }<br>  console.log(num); //log 5<br>}</pre><p>The <em>num </em>variable within the if block is on a different scope to the <em>num </em>variable within the function and so we get no error here. We have two different <em>num </em>constants on two different scopes.</p><p>An important note about const is that you can change a const value but not the reference. So for instance if you declare an object as a const you can change the objects contents. So for example:</p><pre>function constObject(){<br> <br>  const person = {name: &#39;Bob&#39;};<br>  <br>  person.name = &#39;Bill&#39;;<br>  console.log(person.name); //logs Bill</pre><pre>}</pre><p>In the above example we can update the name property of <em>person </em>even though <em>person </em>is a constant, const variables are not immutable. However we cannot create a new reference to <em>person</em>.</p><pre>function constObject(){<br> <br>  const person = {name: &#39;Bob&#39;};<br>  const person = {name: &#39;Bill&#39;};<br>  <br>  console.log(person.name); //throws error Identifier &#39;person&#39; has already been declared</pre><pre>}</pre><p>The function above will throw a syntax error because we already declared a constant called <em>person</em>.</p><p>So that’s it, a basic summary of variable declaration with JavaScript and ES6. I hope you found it helpful :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab71c0a60768" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>