<?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: Kristbjörg Ósk</title>
    <description>The latest articles on DEV Community by Kristbjörg Ósk (@kristbjorgosk).</description>
    <link>https://dev.to/kristbjorgosk</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%2F476659%2F7559dee6-bef3-4730-9c28-822febf7c576.jpeg</url>
      <title>DEV Community: Kristbjörg Ósk</title>
      <link>https://dev.to/kristbjorgosk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kristbjorgosk"/>
    <language>en</language>
    <item>
      <title>How you explain the basics of internet to a 5y old</title>
      <dc:creator>Kristbjörg Ósk</dc:creator>
      <pubDate>Wed, 25 Nov 2020 14:14:25 +0000</pubDate>
      <link>https://dev.to/kristbjorgosk/intro-to-networking-internet-basics-4l0</link>
      <guid>https://dev.to/kristbjorgosk/intro-to-networking-internet-basics-4l0</guid>
      <description>&lt;p&gt;You are at home about to visit a website in your computer, what goes on behind the scene so the browser will display the website for your is like this: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Browser - dns server - data center - optical fiber cables - router - browser.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Let's break it down. The dns server is a server that keeps all the domain names and ip addresses together, when you enter an ip address the browser needs to know what ip address in behind the domain name, signal is sent to the dns server from your browser and the dns server finds the matching ip address and forwards it to the data center. Dns server is like a phonebook, it keeps each domain and their ip address together. &lt;/p&gt;

&lt;p&gt;The data center sends back the data you need via optical fiber cable, it travels in a light pulse and may need to travel even under sea to get to you.&lt;br&gt;
There are about 8 millions data centers all around the world but you may want to access data from different data centers depending on what you are browsing, so it is pretty obvious that the data needs to travel a long way so you can display the data in your browser. &lt;/p&gt;

&lt;p&gt;The optical fiber cable is connected to the router in your home and from the router it finally reaches your browser and you can display the data / website. &lt;/p&gt;

&lt;p&gt;If you are browsing the internet in your mobile a signal containing the data will be sent from the data server to a cell tower and from the tower to your mobile. &lt;/p&gt;




&lt;p&gt;When you are sending for example an email or photo to your friend, the data is broken into pieces, the pieces are called packages. When all the packages have reached their destination they are reassembled so your friend can view it. This is done with &lt;strong&gt;TCP or Transmission Control Protocol&lt;/strong&gt;, it makes sure to break the data in small bits so it can be sent and makes sure that the packages are reassembled correctly, so it does not allow the packages to arrive in different order. Because of TCP you can be sure that an email you have sent will arrive to your friend just the same as you wrote it and the words have not been mixed up. &lt;/p&gt;




&lt;p&gt;When browsing the internet you may have noticed that some links start with &lt;strong&gt;http&lt;/strong&gt; but others with &lt;strong&gt;https&lt;/strong&gt;. The “s” stands for security, it will protect your data so hackers can not easily access your personal information. This is important for example when you are shopping online and writing your card detail or when you are in your online bank. &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Traditional Web Hosting&lt;/strong&gt; is when you buy a space on a server that you share with others websites/applications. You will pay for a set amount of space and if your website is getting more traffic then before you need to buy additional space on the server (the server is located in one of the data centers we talked about above).&lt;br&gt;
&lt;strong&gt;Cloud Computing&lt;/strong&gt; is new technology and is more flexible, you pay for as much space on a server as you need to host your website, if the traffic increases you will automatically get more space to handle the traffic and if the traffic goes down your space decreases. &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Static website&lt;/strong&gt; is a website that is built with only html and css, it has no interaction other then hyperlinks and forms and is simple to build while a &lt;strong&gt;dynamic website&lt;/strong&gt; is more complex and built with for example, javascript and php to interact with the user depending on what action the user picks. &lt;/p&gt;

</description>
      <category>computerscience</category>
    </item>
    <item>
      <title>Bit of an overview of Functional Programming</title>
      <dc:creator>Kristbjörg Ósk</dc:creator>
      <pubDate>Tue, 24 Nov 2020 17:15:09 +0000</pubDate>
      <link>https://dev.to/kristbjorgosk/bit-of-an-overview-of-functional-programming-3977</link>
      <guid>https://dev.to/kristbjorgosk/bit-of-an-overview-of-functional-programming-3977</guid>
      <description>&lt;h5&gt;
  
  
  Functional programming (FP) is a way of writing code in a more organized way, the code will be easier to read, prove and test.
&lt;/h5&gt;




&lt;p&gt;FP is all about functions, &lt;em&gt;pure functions&lt;/em&gt; but sometimes it is inevitable to write &lt;em&gt;impure functions&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pure functions&lt;/strong&gt;  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Same input, same output &lt;/li&gt;
&lt;li&gt;Have no side effect &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Impure functions&lt;/strong&gt;  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Data is changed inside the function
&lt;/li&gt;
&lt;li&gt;The function needs to interact with data outside the function
&lt;/li&gt;
&lt;li&gt;You modify an object or reassign a variable. &lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;The fundamentals of functional programming are recursion and composition.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Recursion&lt;/strong&gt; - when a function calls itself &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Composition&lt;/strong&gt; - when functions are chained together or when function execution is passed into a function. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Composition is how we generate a higher order function - high order functions are a bit different in FP than you might be used to. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;High order functions&lt;/strong&gt; or methods are functions that accept functions as arguments or return functions. &lt;br&gt;
You are most likely familiar with &lt;strong&gt;loop()&lt;/strong&gt; but in FP you shouldn't use that but instead use &lt;strong&gt;map()&lt;/strong&gt;, &lt;strong&gt;reduce()&lt;/strong&gt; and &lt;strong&gt;filter()&lt;/strong&gt; for example. &lt;br&gt;
The reason for this is because when using &lt;strong&gt;loop()&lt;/strong&gt; you are recreating a new array each time and that will first of all make you have an unnecessary amount of data &amp;amp; you are going against the “rules” of FP by &lt;em&gt;changing&lt;/em&gt; the data. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Instead you want to copy the array and add data to the copy &lt;em&gt;not&lt;/em&gt; to the original array&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This can be done with &lt;strong&gt;map()&lt;/strong&gt; or &lt;strong&gt;reduce()&lt;/strong&gt;. &lt;br&gt;
&lt;strong&gt;Map()&lt;/strong&gt; method is for when you want to get all of the values from the array and &lt;strong&gt;reduce()&lt;/strong&gt; is for when you want to get one value from the array. &lt;br&gt;
The same goes for objects, when creating a new object you should use &lt;strong&gt;object.assign()&lt;/strong&gt;. &lt;br&gt;
Like you are probably familiar to &lt;strong&gt;push()&lt;/strong&gt;, &lt;strong&gt;pop()&lt;/strong&gt; and &lt;strong&gt;splice()&lt;/strong&gt; methods to add, take out or change an object. In functional programming you should use &lt;strong&gt;concat()&lt;/strong&gt; to add and &lt;strong&gt;array.filter()&lt;/strong&gt; to take out an object or change it. &lt;br&gt;
It is the same reason as goes for the array, you don't want to change the original data, instead you want to make a copy and amend the copy. &lt;/p&gt;




&lt;p&gt;You should know that it is &lt;em&gt;impossible&lt;/em&gt; to have only 100% pure functions in your code, especially if you are doing a big or complex project, then you most likely want to interact with data outside the function for example. And that is totally okay, it will only make coding more difficult than it is if you put yourself in a box and try to code only pure functions, let’s remember the functionality of the code needs to work. It is a good rule to have 80% of your code in pure functions and the rest can be impure functions. If most of the code is pure it will make it way easier to maintain, change and debug and you won't have to worry about breaking the code somewhere else as the purse function will not affect any other functions in your code. &lt;/p&gt;

&lt;h4&gt;
  
  
  This is only the tip of the iceberg and you can dive way deeper in functional programming but this should give you a bit of an overview of the idea behind it.
&lt;/h4&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>What to keep in mind when choosing font style and size.. </title>
      <dc:creator>Kristbjörg Ósk</dc:creator>
      <pubDate>Mon, 28 Sep 2020 15:11:14 +0000</pubDate>
      <link>https://dev.to/kristbjorgosk/what-to-keep-in-mind-when-choosing-font-style-and-size-4nnm</link>
      <guid>https://dev.to/kristbjorgosk/what-to-keep-in-mind-when-choosing-font-style-and-size-4nnm</guid>
      <description>&lt;h4&gt;
  
  
  Why are fonts so important?
&lt;/h4&gt;

&lt;p&gt;When you visit a new website the first thing you do is read the content before clicking on anything. If the text is hard to read, with complicated font style (handwritten / romantic), not enough space between lines plus the font size is too small, then you don't even bother browsing that site. I mean why would you if you can barely read the content. &lt;/p&gt;

&lt;h4&gt;
  
  
  First of all, the font style.
&lt;/h4&gt;

&lt;p&gt;Some people recommend using max 2-3 font styles and other recommend up to 4. &lt;/p&gt;

&lt;p&gt;When it comes down to it, it all depends on what kind of website you are designing and how large is it. &lt;br&gt;
If it is a very large website you might get away with using 4 font style but if the site is rather small then &lt;em&gt;less is more&lt;/em&gt;. &lt;/p&gt;

&lt;h4&gt;
  
  
  The idea behind using 4 font style is this,
&lt;/h4&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* one for the headline, 
* one for the subtitle, 
* one for the body 
* and at last one for quotes. 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Using the same font for the whole website is perfectly fine and often even better. The website will look more &lt;strong&gt;professional, trustworthy and consistent&lt;/strong&gt;.&lt;br&gt;
If there are too many font style used it might end up looking unprofessional, messy and confuse the reader. If you need some ideas on what fonts to pair together &lt;a href="https://fontpair.co"&gt;this&lt;/a&gt; website could be great help. &lt;/p&gt;

&lt;p&gt;If you end up choosing &lt;em&gt;one&lt;/em&gt; font style, it doesn't mean the website will look flat as some fonts have &lt;em&gt;large font families&lt;/em&gt;. If you choose one of the font with &lt;em&gt;large families&lt;/em&gt; you have all kinds of font weight in regular, italic, bold etc to choose from. &lt;br&gt;
When designing a large website, it is often recommended using fonts with &lt;em&gt;large font family&lt;/em&gt; to be consistent, specially in the long run, &lt;a href="https://fonts.google.com/?selection.family=Alegreya%7CAlegreya+Sans%7CMerriweather%7CMerriweather+Sans%7CNunito%7CNunito+Sans%7CQuattrocento%7CQuattrocento+Sans%7CRoboto%7CRoboto+Mono%7CRoboto+Slab&amp;amp;vfonly=true"&gt;here&lt;/a&gt; you can see fonts that have &lt;em&gt;large font families&lt;/em&gt; (variable fonts). &lt;/p&gt;

&lt;p&gt;When choosing the right font style for the website you are designing, keep in mind who the site is for, who are the customers and what is the company‘s brand about. &lt;br&gt;
You might find a cool handwritten font and it could be tempting to use it but be careful. Be sure the font you choose is &lt;strong&gt;readable&lt;/strong&gt;, most people find it hard and even annoying to read text with different kinds of writing style then they are used to and don't bother reading it. &lt;br&gt;
The picture here below shows a good example of what different font style are appropriate for different companies. &lt;/p&gt;

&lt;h5&gt;
  
  
  Have in mind, what is the purpose of the website, what do you want the customer to feel like when they land on the page?
&lt;/h5&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vjjmuIqc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/kfwdh6x0pj6hdi6tqxjk.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vjjmuIqc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/kfwdh6x0pj6hdi6tqxjk.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;picture from &lt;a href="https://www.crazyegg.com/blog/psychology-of-fonts-infographic/"&gt;The Daily Egg&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  When it comes to the font size
&lt;/h4&gt;

&lt;p&gt;keep in mind there are all kinds of people that visits the website and some of them have bad vision. &lt;/p&gt;

&lt;p&gt;It is very important to choose the right font size both for mobile and desktop, here below you can see the recommended font size for h1 and body for different kind of devices. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--n2nagfp9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lj460rctarizlmank359.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n2nagfp9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lj460rctarizlmank359.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EdNPo0_d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gsblpp9wxdh84vbro1c6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EdNPo0_d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gsblpp9wxdh84vbro1c6.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(charts made by me)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;As well you need to think about the line height, so the text is not all cramped together. If the line height is right the text is easier to read and it is better skimming it. Many people today don't bother or don't have time to read the text word by word and instead skims quickly through it to find the information they are looking for. &lt;/p&gt;

</description>
      <category>design</category>
      <category>ux</category>
      <category>fonts</category>
    </item>
  </channel>
</rss>
