<?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: Andrew Lewell</title>
    <description>The latest articles on DEV Community by Andrew Lewell (@andrewlewell).</description>
    <link>https://dev.to/andrewlewell</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%2F266919%2F8068bcf2-701a-4122-ad55-24cb2e98d9b5.jpg</url>
      <title>DEV Community: Andrew Lewell</title>
      <link>https://dev.to/andrewlewell</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/andrewlewell"/>
    <language>en</language>
    <item>
      <title>A quick guide to Agile Software Development</title>
      <dc:creator>Andrew Lewell</dc:creator>
      <pubDate>Thu, 16 Jan 2020 20:54:24 +0000</pubDate>
      <link>https://dev.to/andrewlewell/a-quick-guide-to-agile-software-development-do2</link>
      <guid>https://dev.to/andrewlewell/a-quick-guide-to-agile-software-development-do2</guid>
      <description>&lt;h1&gt;What is Agile Software Development?&lt;/h1&gt;

&lt;p&gt;I am sure that most seasoned developers will be very familiar with Agile software development, but for those of you just starting out, this may be an unfamiliar practice. Since it's inception in circa 2001, Agile has grown to be one of the most popular methodologies for developing software, so it is important for aspiring developers like myself to understand it.&lt;/p&gt;

&lt;p&gt;So what is Agile Software Development? Agile Software Development is an umbrella term for a number of methodologies that encourage flexbility and rapid responses to evolving requirements. This is achieved through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;b&gt;Incremental, evolving software&lt;/b&gt; - agile methods split development into short iterations, or "sprints", that typically last from 1-4 weeks. This reduces the need for up-front planning and design, and the aim is to have a new feature or working product ready at the end of each sprint. 
&lt;/li&gt;
&lt;li&gt;
&lt;b&gt;Self-organising and cross-functional teams&lt;/b&gt; - often one agile team will cover planning, analysis, design, coding, and testing. This ensures that the entire team is aware of the bigger picture and how everything fits together.
&lt;/li&gt;
&lt;li&gt;
&lt;b&gt;Effective communication&lt;/b&gt; - a common practice in agile software development is the daily "scrum" (or stand-up). This involves team members sharing what they have been working on, what they plan on working on, and any issues they may have encountered. The benefit of this is that solutions can be found quickly to any roadblocks that are encountered, and that everyone is kept up-to-date on the status of the sprint.
&lt;/li&gt;
&lt;/ul&gt;

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

&lt;h1&gt;Agile vs Waterfall&lt;/h1&gt;

&lt;p&gt;The other prominent software development methodology is the Waterfall method. This typically involves a linear set of phases that each progress one after another, and are reliant on the previous phase being completed. As you can imagine, this does not offer as much flexbility as Agile, as each phase involves the completion of big tasks such as implementation or testing, and often requirements do change frequently during the production process, resulting in a lot of re-work and wasted resources. &lt;/p&gt;

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

&lt;h1&gt;Summary&lt;/h1&gt;

&lt;p&gt;In conclusion, Agile is a proven and effective software development methodology that favors small, efficient and flexible teams, working on products with ever-changing and evolving requirements. &lt;/p&gt;

&lt;p&gt;However, some larger scale organizations have found that Agile Software Development simply is not effective for their own dev teams for a number of reasons, so adopt a kind of hybrid approach, that mixes elements of both Agile and rigid plan-driven practices like the Waterfall method. &lt;/p&gt;


Regardless, it is clear that Agile Software Development has an important place in the tech sphere, and will be around for many years to come.

</description>
      <category>agile</category>
    </item>
    <item>
      <title>The Battle of (Web) Back-end</title>
      <dc:creator>Andrew Lewell</dc:creator>
      <pubDate>Sun, 01 Dec 2019 14:34:06 +0000</pubDate>
      <link>https://dev.to/andrewlewell/the-battle-of-web-back-end-396n</link>
      <guid>https://dev.to/andrewlewell/the-battle-of-web-back-end-396n</guid>
      <description>&lt;p&gt;Last week as I once again found myself marvelling at the ease of which Rails allows you to generate models and controllers with a simple command, I found myself wondering how it is possible that Ruby on Rails is not the most popular and commonly used programming language for back-end web development. &lt;/p&gt;

&lt;p&gt;I decided to do some research, and hopefully understand better the pros and cons of the various popular back-end web development languages. I am going to focus on 3 of the most beginner friendly languages at the moment which also happen to be probably the 3 most popular: Ruby on Rails, PHP, and Node.js. An honourable mention goes out to Python, Scala, Java, GoLang, and the many other back end languages out there. So without further ado..&lt;/p&gt;

&lt;h2&gt;Ruby on Rails&lt;/h2&gt;

&lt;p&gt;Ruby, along with it's popular and ubiquitous framework, Rails, is the back-end language I have been learning over the past couple of weeks. Despite having many advantages, it is not the most popular back-end language currently. &lt;/p&gt;

&lt;h3&gt;Advantages&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;b&gt;Generators&lt;/b&gt; - Rails allows you to generate a lot of code with simple one line commands. This saves a lot of time and allows an MVP to be built very quickly. 
&lt;/li&gt;
&lt;li&gt;
&lt;b&gt;Libraries&lt;/b&gt; - Ruby has a vast library of code that are accessible via the gems. Almost anything you can think of has been built already and is freely avaible as a gem. 
&lt;/li&gt;
&lt;li&gt;
&lt;b&gt;Readability&lt;/b&gt; - Ruby is a very succinct and readable language. This makes it a favourite for new coders and coding bootcamps. The easy to grasp syntax makes it easier to focus on learning the programming concepts themselves. 
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Disadvantages&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;b&gt;Speed&lt;/b&gt; - The biggest argument against Ruby on Rails is the run-time speed. It can be considered "slow" compared to some other languages such as Node.js, but realistically this is rarely going to be an actual issue for the majority of applications. Twitter famously migrated from Ruby to Scala as they had some scaling issues due to the massive surge in popularity of their website. 
&lt;/li&gt;
&lt;li&gt;
&lt;b&gt;Documentation&lt;/b&gt; - Some of the Ruby documentation can be shockingly bad, and often it is better to refer to previously asked questions on websites like Stack Overflow than to try and dig through the official documentation.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;PHP&lt;/h2&gt;

&lt;p&gt;PHP is officially the most commmonly used back-end language, with 83.1% of the market share in 2018 accoding to W3Techs.com. The massive market share comes down to it's age and staying power, being one of the oldest server side languages around, many websites and applications are built on it. Facebook was built on PHP for example. &lt;/p&gt;

&lt;h3&gt;Advantages&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;b&gt;Library support&lt;/b&gt; - There are variety of code snippets that allow PHP developers to automate common tasks such as session management, authentication and security. These libraries also allow applications to be built more quickly. 
&lt;/li&gt;
&lt;li&gt;
&lt;b&gt;Speed&lt;/b&gt; - PHP is considered relatively fast as it does not use many system resources. 
&lt;/li&gt;
&lt;li&gt;
&lt;b&gt;Popularity&lt;/b&gt; - The popularity of PHP itself also helps keep PHP relevant. As it is such a commonly used language, many new developers will learn PHP in order to increase their employment opportunities. 
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Disadvantages&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;b&gt;Scalability&lt;/b&gt; - PHP does not scale well with large applications. PHP code for huge apps will be difficult to maintain. 
&lt;/li&gt;
&lt;li&gt;
&lt;b&gt;Poor error handling&lt;/b&gt; - It is widely believed that the error handling offered by PHP is sub-par, especially in comparison to other languages. There is a lack of debugging tools which can hinder development. 
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Node.js&lt;/h2&gt;

&lt;p&gt;Node.js is a newer but increasingly popular technology. It is essentially a runtime environment for JavaScript which allows JavaScript to develop the server side of a web application as well as the front end. &lt;/p&gt;

&lt;h3&gt;Advantages&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;b&gt;Low barrier to entry&lt;/b&gt; - It is built around JavaScript which means front-end developers will have an easy time picking up Node.js. This also means the front-end and back-end can both be built by the same developers!
&lt;/li&gt;
&lt;li&gt;
&lt;b&gt;Great performance&lt;/b&gt; - Node.js is known to have great performance. Node.js interprets JavaScript via Google's V8 JavaScript engine, which converts JavaScript into machine code, which is run faster and more efficiently. 
&lt;/li&gt;
&lt;li&gt;
&lt;b&gt;Flexibility&lt;/b&gt; - Node.js is very flexible allowing developers more freedom when developing apps. This is in contrast to languages such as Ruby where there are much more strict guidelines enforced. 
&lt;/li&gt;
&lt;li&gt;
&lt;b&gt;In demand&lt;/b&gt; - Node.js is one of the most fashionable and fastest growing languages, making developers very much in demand. Although it is based on JavaScript, it still takes a while to become familiar with the intricacies of Node.js, meaning not all JS professionals will be able to work on Node.js projects immediately. 
&lt;/li&gt;
&lt;/ul&gt; 

&lt;h3&gt;Disadvantages&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;b&gt;Less library support&lt;/b&gt; - The code libraries of Node.js are less thorough than other popular languages. This means more manual coding has to be done during development. 
&lt;/li&gt;
&lt;li&gt;
&lt;b&gt;Bottlenecks with highly computational tasks&lt;/b&gt; - Without going into too much detail, Node.js struggles with CPU intensive tasks due to it being built on JavaScript which only uses one thread. Modern CPUs have multiple cores, which are the physical equivalent of a virtual thread. When given an intensive task, the CPU will usually split the task between threads to improve processing speed. Javascript however is designed to carry out front-end tasks which are generally not CPU intensive so only require one thread. 
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;As you can see, there are arguments to be made for and against all of the popular back-end programming languages. I think any of the above options would be a good option for a beginner learning to code - I am certainly enjoying learning Ruby on Rails, and will aim to learn Node.js in the not-so-distant future!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>A Beginner's Guide to Ruby Enumerables</title>
      <dc:creator>Andrew Lewell</dc:creator>
      <pubDate>Sun, 10 Nov 2019 13:33:29 +0000</pubDate>
      <link>https://dev.to/andrewlewell/a-beginner-s-guide-to-ruby-enumerables-217d</link>
      <guid>https://dev.to/andrewlewell/a-beginner-s-guide-to-ruby-enumerables-217d</guid>
      <description>&lt;p&gt;Ruby's Enumerable module is a collection of built-in methods that are used to iterate over collections of data. These powerful methods allow the user to manipulate arrays and hashes. Below is a brief look at some of the more commonly used Enumerables I have come across during my journey learning to code.&lt;/p&gt;

&lt;h4&gt;
  
  
  What are arrays and hashes?
&lt;/h4&gt;

&lt;p&gt;Before we dive into the Enumerables themselves, let's quickly recap on arrays and hashes. &lt;/p&gt;

&lt;p&gt;An array is a data structure consisting of a collection of elements, each identified by an index. Due to this index, an array can be considered an ordered list. In Ruby, arrays are denoted with square brackets. Indexes start at 0, so the first element would be index 0, second would be index 1, third would be index 2, etc. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;colours = ["red", "green", "blue"]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;A hash is a data structure consisting of a collection of keys and their corresponding value. Together, they are called a key value pair. They are similar to arrays, but have a key instead of a hidden integer index. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;british_weather = {temperature: "cold", rainfall: "lots"}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It is possible to nest both arrays inside hashes, and hashes inside arrays. This allows Ruby developers to map out almost any data set imaginable. &lt;/p&gt;

&lt;h4&gt;
  
  
  .each
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;.each&lt;/code&gt; method is used to iterate over elements in an array, or key value pairs in a hash.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;colours = ["red", "green", "blue"]
colours.each do |colour|
  puts "This is #{colour}!"
end 

#=&amp;gt; "This is red!"
#=&amp;gt; "This is green!"
#=&amp;gt; "This is blue!"
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;.each&lt;/code&gt; method (and many of the other Enumerable methods) takes in two arguments: an element and a block. The element is inside the pipes, and is used to indicate the individual element being used within the block in the current iteration. &lt;/p&gt;

&lt;p&gt;The block is everything within the &lt;code&gt;do&lt;/code&gt; and &lt;code&gt;end&lt;/code&gt; and this code is run on each element in the array. In this case, &lt;code&gt;puts "This is #{colour}!"&lt;/code&gt; is being run on &lt;b&gt;each&lt;/b&gt; element of the colours array. &lt;/p&gt;

&lt;p&gt;Note: it is possible to replace &lt;code&gt;do&lt;/code&gt; and &lt;code&gt;end&lt;/code&gt; with &lt;code&gt;{&lt;/code&gt; and &lt;code&gt;}&lt;/code&gt; to keep the code on one line. Using the &lt;code&gt;.each&lt;/code&gt; method with a hash is the same syntax, except both the key and value are part of the element argument.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;colours.each do { |colour| puts "This is #{colour}" }


hash.each do { |key, value| block }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;.each&lt;/code&gt; method is non-destructive, meaning it will &lt;b&gt;leave the original array/hash unchanged&lt;/b&gt;. But what if we need to modify the original array or hash? &lt;/p&gt;

&lt;h4&gt;
  
  
  .map
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;.map&lt;/code&gt; method behaves in a similar way to &lt;code&gt;.each&lt;/code&gt;, except that the original array is mutated based on the code within the block.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;colours = ["red", "green", "blue"]
colours.map { |colour| colour.capitalize }

#=&amp;gt; ["Red", "Green", "Blue"]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;In this example, the capitalize method is being used on each element of the array, mutating the original &lt;code&gt;colours&lt;/code&gt; array. &lt;/p&gt;

&lt;h4&gt;
  
  
  .reduce
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;.reduce&lt;/code&gt; method will combine all elements of an array or hash into a single value, based on a given block or a symbol operator.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;costs = [5, 5, 10, 2, 1]
costs.reduce(:+)

#=&amp;gt; 23
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;:+&lt;/code&gt; symbol operator here will add each element together, resulting in a total value. There are many different uses for &lt;code&gt;.reduce&lt;/code&gt; depending on the operator or code block passed in. &lt;/p&gt;

&lt;h4&gt;
  
  
  .select
&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;.select&lt;/code&gt; method returns &lt;b&gt;a new array&lt;/b&gt; with all elements from an array that return true for a given block.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
nums.select { |num| num &amp;gt; 5 }

#=&amp;gt; [6, 7, 8, 9, 10]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;.select&lt;/code&gt; method iterates over all numbers in the &lt;code&gt;nums&lt;/code&gt; array, and checks if the number is greater than 5. All elements that satisfy this logic are placed into a new array. &lt;/p&gt;

&lt;p&gt;The &lt;code&gt;.find&lt;/code&gt; method behaves in a similar way, but &lt;b&gt;returns the first element that satisfies the block&lt;/b&gt;, instead of an array of all elements that do. &lt;/p&gt;

&lt;h4&gt;
  
  
  .max_by/.min_by
&lt;/h4&gt;

&lt;p&gt;These methods will select from an array or hash the maximum or minimum element based on a given block.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;animals = ["tiger", "gorilla", "rat"]

animals.max_by { |animal| animal.length }
#=&amp;gt; "gorilla" 

animals.min_by { |animal| animal.length }
#=&amp;gt; "rat" 

animals.max_by(2) { |animal| animal.length }
#=&amp;gt; ["gorilla", "tiger"]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;As you can see, the &lt;code&gt;.max_by&lt;/code&gt; method selects the longest string because of the &lt;code&gt;.length&lt;/code&gt; in the block, and &lt;code&gt;.min_by&lt;/code&gt; selects the shortest string. There is also an optional argument to be passed in so you can select the max n or min n. &lt;/p&gt;

&lt;p&gt;There are over 57 different Enumerables so I will not cover each of them here but please refer to the Ruby Enumerables documentation below in sources to dive deeper into these fantastic built in methods. Hopefully this post will have helped introduce you to the power of Ruby Enumerables. &lt;/p&gt;

&lt;h4&gt;
  
  
  Sources
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://ruby-doc.org/core-2.6.5/Enumerable.html"&gt;https://ruby-doc.org/core-2.6.5/Enumerable.html&lt;/a&gt;&lt;br&gt;
&lt;a href="https://en.wikipedia.org/wiki/Array_data_structure"&gt;https://en.wikipedia.org/wiki/Array_data_structure&lt;/a&gt;&lt;br&gt;
&lt;a href="https://docs.ruby-lang.org/en/2.0.0/Hash.html"&gt;https://docs.ruby-lang.org/en/2.0.0/Hash.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>ruby</category>
    </item>
  </channel>
</rss>
