<?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: Cameron Wilson</title>
    <description>The latest articles on DEV Community by Cameron Wilson (@cameronwilson).</description>
    <link>https://dev.to/cameronwilson</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%2F173323%2F3dc79ab6-56f2-45ab-9559-23dd5cb7f3be.png</url>
      <title>DEV Community: Cameron Wilson</title>
      <link>https://dev.to/cameronwilson</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cameronwilson"/>
    <language>en</language>
    <item>
      <title>What is AWS Lambda? Serverless Computing for Software Engineers</title>
      <dc:creator>Cameron Wilson</dc:creator>
      <pubDate>Fri, 20 Mar 2020 17:47:26 +0000</pubDate>
      <link>https://dev.to/educative/what-is-aws-lambda-serverless-computing-for-software-engineers-gpp</link>
      <guid>https://dev.to/educative/what-is-aws-lambda-serverless-computing-for-software-engineers-gpp</guid>
      <description>&lt;p&gt;Serverless and cloud computing have seen a major uptake in recent years, becoming industries unto themselves, with AWS Lambda leading the way. Companies are making the switch to serverless architecture for shorter time to market and decreased operational costs, but for developers the advantage lies in the ability to offload the burden of managing infrastructure to serverless platforms, so you can focus on building even better apps.&lt;/p&gt;

&lt;p&gt;But we’re getting ahead of ourselves. In this post, we will look at:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is AWS Lambda?&lt;/li&gt;
&lt;li&gt;What are serverless applications?&lt;/li&gt;
&lt;li&gt;How does AWS Lambda work?&lt;/li&gt;
&lt;li&gt;AWS Lambda concepts&lt;/li&gt;
&lt;li&gt;Events that trigger AWS Lambda&lt;/li&gt;
&lt;li&gt;Languages supported by AWS Lambda&lt;/li&gt;
&lt;li&gt;When to use AWS Lambda&lt;/li&gt;
&lt;li&gt;When not to use AWS Lambda&lt;/li&gt;
&lt;li&gt;Limitations to AWS Lambda&lt;/li&gt;
&lt;li&gt;Alternatives to AWS Lambda&lt;/li&gt;
&lt;li&gt;Supporting AWS services&lt;/li&gt;
&lt;li&gt;How to get started&lt;/li&gt;
&lt;li&gt;Best practices&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is AWS Lambda? &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fa1wo82mari7vubtwur2l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fa1wo82mari7vubtwur2l.png" alt="Alt Text" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AWS Lambda is a serverless computing service, or FaaS (Function as a Service) provided by Amazon Web Services. It supports a wide array of potential triggers, including incoming HTTP requests, messages from a queue, customer emails, changes to database records, user authentication, messages coming to web sockets, client device synchronization, and much more. AWS Lambda also helps you to focus on your core product and business logic instead of managing the operating system (OS) access control, etc.&lt;/p&gt;

&lt;p&gt;Because application developers do not package or distribute the server code to control a network socket in AWS Lambda, their applications are serverless. The buzzword ‘serverless’ is a bit misleading, as there are still servers in a serverless environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are serverless applications &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Serverless applications, at the most basic technical level, are software that runs in an environment where the hosting provider is fully responsible for infrastructural and operational tasks. These include receiving network requests, scaling the computing infrastructure on demand, monitoring, and recovery.&lt;/p&gt;

&lt;p&gt;Instead of containers bundling application business logic with an operating system, network servers (such as web servers or message brokers) and business logic code, serverless applications only need to provide the code that should run when an event happens and configure the triggers in the execution environment to call that code.&lt;/p&gt;

&lt;p&gt;In the Amazon Web Services cloud, the execution environment for serverless code is called AWS Lambda.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does AWS Lambda work? &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Clients send data to Lambda. Clients could be anyone who’s sending requests to AWS Lambda. This could be an application or other Amazon services.&lt;/p&gt;

&lt;p&gt;Lambda receives requests and depending on the size, amount, or volume of the data, it runs on the defined number of containers. Requests are then given to a container to handle. A container contains the code the user has provided to satisfy the query.&lt;/p&gt;

&lt;p&gt;With an increased number of requests, an increasing number of containers are created. If the number of requests reduces, the number of containers are reduced as well.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fll2gazumo1h3mxdoqxcp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fll2gazumo1h3mxdoqxcp.png" alt="Alt Text" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  AWS Lambda concepts &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Function
&lt;/h3&gt;

&lt;p&gt;A function is a resource that runs your code in AWS Lambda. Functions contain code that process events, and a runtime that passes requests and responses between Lambda and the function. You provide the code, and you can use the provided runtimes or create your own.&lt;/p&gt;

&lt;h3&gt;
  
  
  Runtime
&lt;/h3&gt;

&lt;p&gt;Lambda runtimes allow functions in different languages to run in the same base execution environment. You configure your function to use a runtime that matches your programming language.&lt;/p&gt;

&lt;h3&gt;
  
  
  Event
&lt;/h3&gt;

&lt;p&gt;An event is a JSON formatted document that contains data for a function to process. The Lambda runtime converts the event to an object and passes it to your function code. When you invoke a function, you determine the structure and contents of the event. When an AWS service invokes your function, the service defines the event.&lt;/p&gt;

&lt;h3&gt;
  
  
  Concurrency
&lt;/h3&gt;

&lt;p&gt;Concurrency is the number of requests that your function is serving at any given time. When your function is invoked, Lambda provisions an instance of it to process the event. When the function code finishes running, it can handle another request. If the function is invoked again while a request is still being processed, another instance is provisioned, increasing the function’s concurrency.&lt;/p&gt;

&lt;h3&gt;
  
  
  Trigger
&lt;/h3&gt;

&lt;p&gt;A trigger is a resource or configuration that invokes a Lambda function. This includes AWS services that can be configured to invoke a function, applications that you develop, and event source mappings.&lt;/p&gt;

&lt;h3&gt;
  
  
  Lambda layers
&lt;/h3&gt;

&lt;p&gt;Lambda layers are an important distribution mechanism for libraries, custom runtimes, and other important function dependencies. This AWS component also helps you to manage your development function code separately from the unchanging code and resources that it uses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Events that trigger AWS Lambda &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;HTTP requests via Amazon API Gateway&lt;/li&gt;
&lt;li&gt;Modifications to objects in Amazon S3 buckets&lt;/li&gt;
&lt;li&gt;Updates to a DynamoDB Table&lt;/li&gt;
&lt;li&gt;State transitions in AWS Step Functions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Languages supported by AWS Lambda &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;AWS Lambda supports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.educative.io/blog/learn-java-from-scratch" rel="noopener noreferrer"&gt;Java&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Go&lt;/li&gt;
&lt;li&gt;PowerShell&lt;/li&gt;
&lt;li&gt;Node.js&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.educative.io/blog/building-dev-tools-and-designing-c-sharp-interview-eric-lippert" rel="noopener noreferrer"&gt;C#&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.educative.io/blog/how-to-learn-python-in-5-easy-steps" rel="noopener noreferrer"&gt;Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Ruby&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AWS also provides a Runtime API which allows you to use any additional programming languages to use your functions.&lt;/p&gt;

&lt;p&gt;It’s also suggested that you &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/runtime-support-policy.html" rel="noopener noreferrer"&gt;check deprecated runtimes&lt;/a&gt; to ensure you’re using the most updated runtime. Acceptable runtimes for a few of the above languages are: Java 11, Python 3.8, and Node.js 12.x. Some deprecated runtimes include: Node.js 8.10 and Python 2.7.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h2&gt;
  
  
  Keep the learning going.
&lt;/h2&gt;

&lt;p&gt;Learn AWS Lambda without scrubbing through videos or documentation. Educative's text-based courses are easy to skim and feature live coding environments - making learning quick and efficient. &lt;br&gt;
&lt;a href="https://www.educative.io/courses/running-serverless-applications-aws-lambda" rel="noopener noreferrer"&gt;Running Serverless Applications with AWS Lambda&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  When to use AWS Lambda &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Maximizing throughput
&lt;/h3&gt;

&lt;p&gt;Lambda is great for use cases where throughput is critical and the tasks parallelise nicely. Typical web requests for dynamic content, involving access to a back-end database, or some user data manipulation usually fall into this category. Automatic email replies or chatbots are also a nice example. Any single request taking a few hundred milliseconds more than average won’t be noticeable to typical users and Lambda will ensure that everyone gets served relatively quickly regardless of traffic spikes.&lt;/p&gt;



&lt;h3&gt;
  
  
  Splittable, longer-running tasks
&lt;/h3&gt;

&lt;p&gt;Longer on-demand computational tasks that can execute in less than 15 minutes, or could be split into independent segments that take less than 15 minutes, are also a good use case for Lambda. In these cases, the few hundred milliseconds required for Lambda functions to start won’t make an important difference to processing time. Some nice examples of tasks that fall into this category are file format conversions, generating previews or thumbnails, and running periodic reports.&lt;/p&gt;



&lt;h3&gt;
  
  
  High availability tasks
&lt;/h3&gt;

&lt;p&gt;Tasks that need high availability and good operational infrastructure, but do not need to guarantee latency, are also a great use case for AWS Lambda. This includes payment notifications from external systems, for example, PayPal or Stripe. These notifications must be handled reliably and relatively quickly, they might have unpredictable traffic patterns, and yet it’s not critically important if they are finished in one second or two seconds.&lt;/p&gt;



&lt;h2&gt;
  
  
  When not to use AWS Lambda &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Latency guaranteed tasks
&lt;/h3&gt;

&lt;p&gt;Lambda is currently not suitable for tasks that require guaranteed latency, such as in high-frequency trading systems or near-real-time control systems. If a task must be handled in under 10 or 20 ms, it’s much better to create a reserved cluster and have services directly connected to a message broker.&lt;/p&gt;



&lt;h3&gt;
  
  
  Longer-running tasks
&lt;/h3&gt;

&lt;p&gt;Another category where Lambda isn’t suitable right now is tasks that could potentially run for longer than 15 minutes. One notable example is video transcoding for large files. Connecting to a socket and consuming a continuous data feed is also not a good use case for Lambda, due to the time limit.&lt;/p&gt;



&lt;h3&gt;
  
  
  Tasks that demand high-processing power
&lt;/h3&gt;

&lt;p&gt;The third category where you should not use Lambda right now is tasks that require a huge amount of processing power and coordination. For example, video rendering. Tasks like that are better suited to a reserved infrastructure with a lot of CPUs (or even GPUs).&lt;/p&gt;



&lt;h3&gt;
  
  
  Tasks that require no on-demand computation
&lt;/h3&gt;

&lt;p&gt;Lastly, tasks that require no on-demand computation, such as serving static web files, are a poor use case for Lambda. In theory, it’s possible to use Lambda as a web server and send images and CSS files to clients, but this is a waste of money. It is much cheaper and faster to use a specialized product for that, for example, a content delivery network.&lt;/p&gt;



&lt;h2&gt;
  
  
  Limitations of AWS Lambda &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;There are four important technical limitations that you need to consider when evaluating whether something should run in Lambda:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No session affinity&lt;/li&gt;
&lt;li&gt;Non-deterministic latency&lt;/li&gt;
&lt;li&gt;Execution time-limited to 15 minutes&lt;/li&gt;
&lt;li&gt;No direct control over processing power&lt;/li&gt;
&lt;/ul&gt;



&lt;h2&gt;
  
  
  Alternatives to AWS Lambda &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Azure Function
&lt;/h3&gt;

&lt;p&gt;Microsoft is one of the newer players in the serverless realm. It wasn’t until March 2016 that they entered the serverless app environment with the launch of Microsoft Azure Functions. Both Lambda and Azure support Node.js, Python, and C#, but Azure Functions also support F# and PHP. They also both support automatic scaling.&lt;/p&gt;

&lt;h3&gt;
  
  
  Google Cloud Function
&lt;/h3&gt;

&lt;p&gt;Launched in the beginning of 2016, Google Cloud Function was created in response to well-received Lambda. Languages supported by GCF are Node.js, Python, Go. Whereas Lambda allows for unlimited functions perproject, GCF allows for 1,000 functions per project.&lt;/p&gt;

&lt;p&gt;See more alternatives &lt;a href="https://www.g2.com/products/aws-lambda/competitors/alternatives" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;



&lt;h2&gt;
  
  
  Supporting Amazon AWS services &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  EC2
&lt;/h3&gt;

&lt;p&gt;Amazon EC2 (Elastic Compute Cloud) is an IaaS (Infrastructure as a Service) that provides virtualized computing resources. Using Amazon EC2 eliminates your need to invest in hardware up front, so you can develop and deploy applications faster. &lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html" rel="noopener noreferrer"&gt;Read more about EC2&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  S3
&lt;/h3&gt;

&lt;p&gt;Amazon S3 (Simple Storage Service) is the cloud storage service of AWS. It allows you to store and retrieve any amount of data, at any time, from anywhere on the web. &lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/Welcome.html" rel="noopener noreferrer"&gt;Read more about S3&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  CloudFront
&lt;/h3&gt;

&lt;p&gt;CloudFront is a content delivery network service that speeds up distribution of your static and dynamic web content, such as .html, .css, .js, and image files, to your users. &lt;a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Introduction.html" rel="noopener noreferrer"&gt;Read more on CloudFront&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Amazon API Gateway
&lt;/h3&gt;

&lt;p&gt;Amazon API Gateway is an AWS service for creating, publishing, maintaining, monitoring, and securing REST, HTTP, and WebSocket APIs at any scale. &lt;a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/welcome.html" rel="noopener noreferrer"&gt;Read more on Amazon API Gateway&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  SAM (Serverless Application Model)
&lt;/h3&gt;

&lt;p&gt;An open-source framework for building serverless applications. It is a set of products that simplify developing, testing, and deploying applications using AWS Lambda. One part of SAM runs on developer machines and build servers, helping to prepare for deployment. Another aspect of SAM runs in AWS data centres during the deployment process. &lt;a href="https://aws.amazon.com/serverless/sam/" rel="noopener noreferrer"&gt;More on SAM&lt;/a&gt;.&lt;/p&gt;



&lt;h2&gt;
  
  
  How to get started with AWS Lambda &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1
&lt;/h3&gt;

&lt;p&gt;Head on over to their &lt;a href="https://signin.aws.amazon.com/signin?redirect_uri=https%3A%2F%2Fconsole.aws.amazon.com%2Flambda%2Fhome%3Fregion%3Dus-east-1%26state%3DhashArgs%2523%26isauthcode%3Dtrue&amp;amp;client_id=arn%3Aaws%3Aiam%3A%3A015428540659%3Auser%2Flambda&amp;amp;forceMobileApp=0&amp;amp;code_challenge=t8GykQQa5m7C7HYSuX3voaxZpmGgHNKQ1MqJCzY6Gy4&amp;amp;code_challenge_method=SHA-256" rel="noopener noreferrer"&gt;sign in page&lt;/a&gt;. If you don’t have an AWS account, go ahead and create one. Then find “Lambda” under “Compute” and click to open the AWS Lambda Console.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2
&lt;/h3&gt;

&lt;p&gt;Select a Lambda blueprint. In the AWS Lambda console, select “Create a Function”.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3
&lt;/h3&gt;

&lt;p&gt;Configure and create your lambda function. Here is where you enter the basic information about your Lambda function (i.e. things like name, role, and role name). Then click “create function”.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4
&lt;/h3&gt;

&lt;p&gt;Invoke Lambda function and verify results. Click “configure test event” in the upper right hand drop down menu.&lt;/p&gt;



&lt;h2&gt;
  
  
  Best practices for AWS Lambda &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  When to VPC-Enable a Lambda Function
&lt;/h3&gt;

&lt;p&gt;You should only enable your functions for VPC access when you need to interact with a private resource located in a private subnet. An RDS instance is a good example.&lt;/p&gt;

&lt;h3&gt;
  
  
  Deploy Common Code to a Lambda Layer (i.e. the AWS SDK)
&lt;/h3&gt;

&lt;p&gt;If you intend to reuse code in more than one function, consider creating a Layer and deploying it there. A great candidate would be a logging package that your team is required to standardize on.&lt;/p&gt;

&lt;h3&gt;
  
  
  Watch Your Package Size and Dependencies
&lt;/h3&gt;

&lt;p&gt;Remove all unnecessary items, such as documentation and unused libraries.&lt;/p&gt;



&lt;h2&gt;
  
  
  Running serverless applications with AWS Lambda
&lt;/h2&gt;

&lt;p&gt;Ready to get your start with serverless computing? Gojko Adzic is the author of our latest course, &lt;a href="https://www.educative.io/courses/running-serverless-applications-aws-lambda" rel="noopener noreferrer"&gt;Running Serverless Applications with AWS Lambda&lt;/a&gt;. Adzic is one of the 2019 AWS Serverless Heroes, the winner of the 2016 European Software Testing Outstanding Achievement Award, and the 2011 Most Influential Agile Testing Professional Award. Adzic has written many award winning books such as &lt;em&gt;Specification by Example&lt;/em&gt; and &lt;em&gt;Serverless Computing&lt;/em&gt;; it's safe to say when it comes to serverless computing, Adzic knows what he’s talking about.&lt;/p&gt;

&lt;p&gt;In this course, you will learn how to run serverless applications using AWS Lambda. You’ll start with the basics such as creating a web service where you’ll learn the steps to use AWS Serverless Application Model (SAM), a set of products that simplify developing, testing, and deploying applications using AWS Lambda. This is something most courses won’t cover. You’ll then move on to more advanced topics such as handling HTTP Requests, using external storage, and managing sessions and user workflows. By the end of this course, you will be ready to work with AWS Lambda in a professional setting, and you’ll have a great, transferable skill that employers will love to see.&lt;/p&gt;

&lt;p&gt;Happy learning!&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>serverless</category>
      <category>aws</category>
    </item>
    <item>
      <title>How to Design a Web Application: Software Architecture 101</title>
      <dc:creator>Cameron Wilson</dc:creator>
      <pubDate>Tue, 04 Feb 2020 23:26:43 +0000</pubDate>
      <link>https://dev.to/educative/how-to-design-a-web-application-software-architecture-101-188b</link>
      <guid>https://dev.to/educative/how-to-design-a-web-application-software-architecture-101-188b</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally posted on &lt;a href="https://www.educative.io/" rel="noopener noreferrer"&gt;Educative.io&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So you’ve embarked on the entrepreneurial journey to build your own web application. You’ve got the idea in place, but the significance of getting the architecture right is extremely important.&lt;/p&gt;

&lt;p&gt;In this post we’ll walk through these key areas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is software architecture&lt;/li&gt;
&lt;li&gt;Why is software architecture important&lt;/li&gt;
&lt;li&gt;The difference between software architecture and software design&lt;/li&gt;
&lt;li&gt;Software architecture patterns&lt;/li&gt;
&lt;li&gt;How to decide on the number of tiers your app should have&lt;/li&gt;
&lt;li&gt;Horizontal or vertical scaling… Which is right for my app?&lt;/li&gt;
&lt;li&gt;Monolith or Microservice?&lt;/li&gt;
&lt;li&gt;When should you use NoSQL or SQL?&lt;/li&gt;
&lt;li&gt;Picking the right technology for the job&lt;/li&gt;
&lt;li&gt;How to become a software architect&lt;/li&gt;
&lt;li&gt;Where to go from here&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal of this post is to give you a solid understanding of web architecture, the concepts involved, and how to pick the right architecture and technology when designing your app. So by the end of this post, when you go to design an application from the bare bones you won’t be sitting in the dark anymore.&lt;/p&gt;

&lt;p&gt;If you’re looking for a complete course on web application and software architecture, I recommend checking out &lt;a href="https://www.educative.io/courses/web-application-software-architecture-101" rel="noopener noreferrer"&gt;Web Application and Software Architecture 101&lt;/a&gt;. This is a useful course for anyone looking to strengthen their overall knowledge of software architecture.&lt;/p&gt;

&lt;p&gt;Let’s dive in!&lt;/p&gt;

&lt;h2&gt;
  
  
  What is software architecture?
&lt;/h2&gt;

&lt;p&gt;Software architecture of a system describes its major components, their relationships, and how they interact with each other.&lt;/p&gt;

&lt;p&gt;It essentially serves as a blueprint. It provides an abstraction to manage the system complexity and establish communication and coordination among components.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Feib1htrf0mzmuneqcxpr.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Feib1htrf0mzmuneqcxpr.jpg" alt="Alt Text" width="580" height="342"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here are some key points:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The architecture helps define a solution to meet all the technical and operational requirements, with the common goal of optimizing for performance and security.&lt;/li&gt;
&lt;li&gt;Designing the architecture involves the intersection of the organization’s needs as well as the needs of the development team. Each decision can have a considerable impact on quality, maintainability, performance, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One of my favorite definitions of software architecture came from Ralph Johnson, co-author of &lt;em&gt;Design Patterns: Elements of Reusable Object-Oriented Software&lt;/em&gt;. He stated that:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It's the decisions you wish you could get right early in a project.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So with that said, let’s move on to why software architecture is important.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is software architecture important?
&lt;/h2&gt;

&lt;p&gt;The key element in successfully creating anything is getting the base right. Now whether it is constructing a building or making a pizza. If we don’t get the base right, we have to start over; there is no other way around.&lt;/p&gt;

&lt;p&gt;Building a web application is no different. The architecture is its base and has to be carefully thought out to avoid any major design changes &amp;amp; code refactoring at a later point in time. &lt;strong&gt;Many engineers will tell you that you don’t want to delve into re-designing stuff. It eats up your time like a black hole. It has the potential to push your shipping date further down the calendar by months, if not longer.&lt;/strong&gt; And that’s not even bringing up the wastage of engineering and financial resources which is caused due to this.&lt;/p&gt;

&lt;p&gt;It also depends on what stage of the development process we hit an impasse due to the hasty decisions taken during the initial design phases. So, before we even touch the code and get our hands dirty, we have to make the underlying architecture right.&lt;/p&gt;

&lt;p&gt;Though software development is an iterative and evolutionary process, we don’t always get things perfect at the first go. Still, this can’t be an excuse for not doing our homework.&lt;/p&gt;

&lt;h2&gt;
  
  
  The difference between software architecture and software design
&lt;/h2&gt;

&lt;p&gt;There is often confusion between software design and architecture so we’ll break this down.&lt;/p&gt;

&lt;p&gt;Software architecture is used to define the skeleton and the high-level components of a system, and how they will all work together. For example, do you need serverless architecture which splits the application into two components: BaaS (backend-as-a-service) and FaaS (functions-as-a-service)? Or do you need something like a microservice architecture where the different features/tasks are split into separate respective modules/codebases?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Choosing an architecture will determine how you deal with performance, fault tolerance, scalability, and reliability.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Software design is responsible for the code level design such as, what each module is doing, the classes scope, and the functions purposes, etc. When used strategically, they can make a programmer significantly more efficient by allowing them to avoid reinventing the wheel, instead using methods refined by others already. They also provide a useful common language to conceptualize repeated problems and solutions when discussing with others or managing code in larger teams. Start leveraging software design patterns in your code with this helpful course: &lt;a href="https://www.educative.io/courses/software-design-patterns-best-practices" rel="noopener noreferrer"&gt;Software Design Patterns: Best Practices for Software Developers&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here is a good article on understanding the importance of software design and the tried and true patterns that developers frequently use: &lt;a href="https://www.educative.io/blog/the-7-most-important-software-design-patterns" rel="noopener noreferrer"&gt;The 7 most important software design patterns&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Software architecture patterns
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Client-server
&lt;/h3&gt;

&lt;p&gt;The architecture works on a request-response model. The client sends the request to the server for information &amp;amp; the server responds with it.&lt;/p&gt;

&lt;p&gt;Every website you browse, be it a Wordpress blog or a web application like Facebook, Twitter or your banking app is built on the client-server architecture.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg7rvw6dd1q5qg0zuetxe.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg7rvw6dd1q5qg0zuetxe.jpeg" alt="Alt Text" width="800" height="499"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Peer-to-peer
&lt;/h3&gt;

&lt;p&gt;A P2P network is a network in which computers also known as nodes can communicate with each other without the need of a central server. The absence of a central server rules out the possibility of a single point of failure. All the computers in the network have equal rights. A node acts as a seeder and a leecher at the same time. So, even if some of the computers/nodes go down, the network &amp;amp; the communication is still up.&lt;/p&gt;

&lt;p&gt;P2P is the base of blockchain technology.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftogxlje8najrdwb6etru.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftogxlje8najrdwb6etru.jpeg" alt="Alt Text" width="800" height="485"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Model-View-Controller (MVC)
&lt;/h3&gt;

&lt;p&gt;The MVC architecture is a software architectural pattern in which the application logic is divided into three components on the basis of functionality. These components are called: Models - represent how data is stored in the database Views - the components that are visible to the user, such as an output or a GUI Controllers - the components that act as an interface between models and views&lt;/p&gt;

&lt;p&gt;The MVC architecture is used not only for desktop applications but also for mobile and web applications.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1ni6qx5c5ij57hxeh5cf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1ni6qx5c5ij57hxeh5cf.png" alt="Alt Text" width="794" height="656"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Microservices
&lt;/h3&gt;

&lt;p&gt;In a microservice architecture, different features/tasks are split into separate respective modules/codebases which work in conjunction with each other forming a large service as a whole.&lt;/p&gt;

&lt;p&gt;This particular architecture facilitates easier &amp;amp; cleaner app maintenance, feature development, testing &amp;amp; deployment in comparison to a monolithic architecture.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fnm7ms0ce70ett31yw71b.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fnm7ms0ce70ett31yw71b.jpeg" alt="Alt Text" width="800" height="517"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Event driven
&lt;/h3&gt;

&lt;p&gt;Non-blocking architecture is also known as the Reactive or the Event-driven architecture. Event-driven architectures are pretty popular in the modern web application development.&lt;/p&gt;

&lt;p&gt;They are capable of handling a big number of concurrent connections with minimal resource consumption. Modern applications need a fully asynchronous model to scale. These modern web frameworks provide more reliable behavior in a distributed environment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fynfth6oaprzk543ppdhw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fynfth6oaprzk543ppdhw.jpeg" alt="Alt Text" width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Layered
&lt;/h3&gt;

&lt;p&gt;This pattern can be used to structure programs that can be decomposed into groups of subtasks, each of which is at a particular level of abstraction. Each layer provides services to the next higher layer.&lt;/p&gt;

&lt;p&gt;Here are the most common layers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Presentation layer&lt;/li&gt;
&lt;li&gt;Application layer&lt;/li&gt;
&lt;li&gt;Business logic layer&lt;/li&gt;
&lt;li&gt;Data access layer&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Hexagonal
&lt;/h3&gt;

&lt;p&gt;The architecture consists of three components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ports&lt;/li&gt;
&lt;li&gt;Adapters&lt;/li&gt;
&lt;li&gt;Domain
The focus of this architecture is to make different components of the application independent, loosely coupled &amp;amp; easy to test.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The architectural pattern holds the domain at its core, that’s the business logic. On the outside, the outer layer has Ports &amp;amp; Adapters. Ports act like an API, as an interface. All the input to the app goes through the interface.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzi3bzygq756jupfmwxdz.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzi3bzygq756jupfmwxdz.jpeg" alt="Alt Text" width="800" height="472"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to decide on the number of tiers your app should have
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Single tier application
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No network latency&lt;/li&gt;
&lt;li&gt;Data is quickly and easily available&lt;/li&gt;
&lt;li&gt;Data is not transferred over a network which ensures data safety&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Little control over the application; hard to implement new features or code changes once it’s shipped&lt;/li&gt;
&lt;li&gt;Testing has to be extremely thorough with minimal room for mistakes&lt;/li&gt;
&lt;li&gt;Single tier applications are vulnerable to being tweaked or reverse engineered&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Two-tier application
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fewer network calls since the code and UI are in the same machine&lt;/li&gt;
&lt;li&gt;Database server and business logic is physically close, which offers higher performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Since the client holds most of the application logic, problems arise in controlling the software version and re-distributing new versions.&lt;/li&gt;
&lt;li&gt;Lacks scalability as it supports only a limited number of users. When multiple client requests increases, application performance can slow down due to the fact that clients necessitate separate connections and CPU memory to proceed.&lt;/li&gt;
&lt;li&gt;Since the application logic is coupled with the client, it’s difficult to re-use logic.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Three-tier application
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data corruption through client applications can be eliminated as the data passed in the middle tier for database updations ensures its validity&lt;/li&gt;
&lt;li&gt;The placement of the business logic on a centralized server makes the data more secure&lt;/li&gt;
&lt;li&gt;Due to the distributed deployment of application servers, scalability of the system is enhanced since a separate connection from each client is not required whereas connections from few application servers are sufficient.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Usually more effort should be enforced when creating 3-tier applications as the communication points are increased (client to middle tier to server, instead of directly client to server) and the performance increased by tools like Visual Basic, PowerBuilder, Delphi will be reduced.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  N-Tier application
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;All the pros of three-tier architecture&lt;/li&gt;
&lt;li&gt;The performance is increased due to off-load from the database tier and the client tier, enabling it to suit medium to high volume industries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Due to the componentization of the tiers, the complex structure is difficult to implement or maintain&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;You should choose a single tier architecture when you do not want any network latency&lt;/li&gt;
&lt;li&gt;Choose a two tier application when you need to minimize network latency and you need more control of data within your application&lt;/li&gt;
&lt;li&gt;You should choose a three tier architecture when you need control over the code/business logic of your application &amp;amp; want it to be secure, and you need control over data in your application.&lt;/li&gt;
&lt;li&gt;You should choose a N tier architecture when you need your application to scale and handle large amounts of data.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Horizontal or vertical scaling… Which is right for my app?
&lt;/h2&gt;

&lt;p&gt;If your app is a utility or a tool which is expected to receive minimal consistent traffic, it may not be mission-critical. For instance, an internal tool of an organization or something similar. Why bother hosting it in a distributed environment? A single server is enough to manage the traffic, so you could &lt;strong&gt;go with vertical scaling when you know that the traffic load would not increase significantly.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7enieqd0bn8qvk7xvscx.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7enieqd0bn8qvk7xvscx.jpeg" alt="Alt Text" width="800" height="505"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If your app is a public-facing social app like a social network, a fitness app or something similar, then the traffic is expected to spike exponentially in the near future. In this case, both high availability and horizontal scalability is important to you.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffcutuygeu8j95izjjp7j.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffcutuygeu8j95izjjp7j.jpeg" alt="Alt Text" width="800" height="443"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Build to deploy it on the cloud &amp;amp; always have horizontal scalability in mind right from the start. &lt;a href="http://highscalability.com/" rel="noopener noreferrer"&gt;Here is a good website for learning more about scalability&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Monolith or Microservice?
&lt;/h2&gt;

&lt;p&gt;Let’s explore when you should choose one over the other.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fu221x0bb2q18b385wq1t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fu221x0bb2q18b385wq1t.png" alt="Alt Text" width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  When to use monolithic architecture
&lt;/h3&gt;

&lt;p&gt;Monolithic applications fit best for use cases where the requirements are pretty simple, the app is expected to handle a limited amount of traffic. One example of this is an internal tax calculation app of an organization or a similar open public tool.&lt;/p&gt;

&lt;p&gt;These are the use cases where the business is certain that there won’t be an exponential growth in the user base and the traffic over time.&lt;/p&gt;

&lt;p&gt;There are also instances where the dev teams decide to start with a monolithic architecture and later scale out to a distributed microservices architecture.&lt;/p&gt;

&lt;p&gt;This helps them deal with the complexity of the application step by step as and when required. &lt;a href="https://engineering.linkedin.com/architecture/brief-history-scaling-linkedin" rel="noopener noreferrer"&gt;This is exactly what LinkedIn did&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  When to use microservice architecture
&lt;/h3&gt;

&lt;p&gt;The microservice architecture fits best for complex use cases and for apps which expect traffic to increase exponentially in future like a fancy social network application.&lt;/p&gt;

&lt;p&gt;A typical social networking application has various components such as messaging, real-time chat, LIVE video streaming, image uploads, Like, Share feature etc.&lt;/p&gt;

&lt;p&gt;In this scenario, I would suggest developing each component separately keeping the Single Responsibility and the Separation of Concerns principle in mind.&lt;/p&gt;

&lt;p&gt;Writing every feature in a single codebase would take no time in becoming a mess.&lt;/p&gt;

&lt;p&gt;So, by now, in the context of monolithic and microservices, we have gone through three approaches:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Picking a monolithic architecture&lt;/li&gt;
&lt;li&gt;Picking a microservice architecture&lt;/li&gt;
&lt;li&gt;Starting with a monolithic architecture and then later scale out into a microservice architecture.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Picking a monolithic or a microservice architecture largely depends on our use case. I’ll suggest, keep things simple, have a thorough understanding of the requirements. Get the lay of the land, build something only when you need it &amp;amp; keep evolving the code iteratively. This is the right way to go.&lt;/p&gt;

&lt;h2&gt;
  
  
  When should you use NoSQL or SQL?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  When to pick a SQL database?
&lt;/h3&gt;

&lt;p&gt;If you are writing a stock trading, banking or a Finance-based app or you need to store a lot of relationships, for instance, when writing a social networking app like Facebook, then you should pick a relational database. Here’s why:&lt;/p&gt;

&lt;h4&gt;
  
  
  Transactions &amp;amp; Data Consistency
&lt;/h4&gt;

&lt;p&gt;If you are writing software which has anything to do with money or numbers, that makes transactions, ACID, data consistency super important to you. Relational DBs shine when it comes to transactions &amp;amp; data consistency. They comply with the ACID rule, have been around for ages &amp;amp; are battle-tested.&lt;/p&gt;

&lt;h4&gt;
  
  
  Storing Relationships
&lt;/h4&gt;

&lt;p&gt;If your data has a lot of relationships like which friends of yours live in a particular city? Which of your friend already ate at the restaurant you plan to visit today? etc. There is nothing better than a relational database for storing this kind of data.&lt;/p&gt;

&lt;p&gt;Relational databases are built to store relationships. They have been tried &amp;amp; tested &amp;amp; are used by big guns in the industry like Facebook as the main user-facing database.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Popular relational databases:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MySQL&lt;/li&gt;
&lt;li&gt;Microsoft SQL Server&lt;/li&gt;
&lt;li&gt;PostgreSQL&lt;/li&gt;
&lt;li&gt;MariaDB&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  When to pick a NoSQL database
&lt;/h3&gt;

&lt;p&gt;Here are a few reasons why you’d want to pick a NoSQL database:&lt;/p&gt;

&lt;h4&gt;
  
  
  Handling A Large Number Of Read Write Operations
&lt;/h4&gt;

&lt;p&gt;Look towards NoSQL databases when you need to scale fast. For example, when there are a large number of read-write operations on your website and when dealing with a large amount of data, NoSQL databases fit best in these scenarios. Since they have the ability to add nodes on the fly, they can handle more concurrent traffic and large amounts of data with minimal latency.&lt;/p&gt;

&lt;h4&gt;
  
  
  Running data analytics
&lt;/h4&gt;

&lt;p&gt;NoSQL databases also fit best for data analytics use cases, where we have to deal with an influx of massive amounts of data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Popular NoSQL databases:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MongoDB&lt;/li&gt;
&lt;li&gt;Redis&lt;/li&gt;
&lt;li&gt;Cassandra&lt;/li&gt;
&lt;li&gt;HBASE&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’re curious about trying a NoSQL database like MongoDB then I highly suggest checking out Nikola Zivkovic’s course, &lt;a href="https://www.educative.io/courses/definitive-guide-to-mongodb" rel="noopener noreferrer"&gt;The Definitive Guide to MongoDB&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Picking the right technology for the job
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Real time data interaction
&lt;/h3&gt;

&lt;p&gt;If you are building an app that needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To interact with the backend server in real-time, such as a messaging application, or an audio-video streaming app like Spotify, Netflix etc.&lt;/li&gt;
&lt;li&gt;A persistent connection between the client and server, and a non-blocking technology on the back-end.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then some of the popular technologies which enable you to write these apps are NodeJS, and the popular Python framework known as &lt;a href="https://pypi.org/project/tornado/3.2.1/" rel="noopener noreferrer"&gt;Tornado&lt;/a&gt;. If you are working in the Java Ecosystem you can look into Spring Reactor, Play, &lt;a href="https://akka.io/" rel="noopener noreferrer"&gt;Akka.io&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Peer-to-peer web application
&lt;/h3&gt;

&lt;p&gt;If you intend to build a peer to peer web app, for instance, a P2P distributed search engine or a P2P Live TV radio service, something similar to LiveStation by Microsoft, then you’ll want to look into JavaScript, protocols like DAT, IPFS. Checkout &lt;a href="https://www.freedomjs.org/" rel="noopener noreferrer"&gt;FreedomJS&lt;/a&gt;, it’s a framework for building P2P web apps that work in modern web browsers.&lt;/p&gt;

&lt;h3&gt;
  
  
  CRUD-based Regular Application
&lt;/h3&gt;

&lt;p&gt;If you have simple use cases such as a regular CRUD-based app, then some of the technologies which you can use are: Spring MVC, Python Django, Ruby on Rails, PHP Laravel, ASP .NET MVC.&lt;/p&gt;

&lt;h3&gt;
  
  
  Simple, small scale applications
&lt;/h3&gt;

&lt;p&gt;If you intend to write an app which doesn’t involve much complexity like a blog, a simple online form, simple apps which integrate with social media that run within the IFrame of the portal, then you can pick PHP. &lt;a href="https://www.educative.io/courses/learn-php-from-scratch" rel="noopener noreferrer"&gt;Learn PHP for free&lt;/a&gt; today.&lt;/p&gt;

&lt;p&gt;You can also consider other web frameworks like Spring boot, Ruby on Rails, which cut down the verbosity, configuration, development time by notches &amp;amp; facilitate rapid development. But PHP hosting will cost much less in comparison to hosting other technologies. It is ideal for very simple use cases.&lt;/p&gt;

&lt;h3&gt;
  
  
  CPU and memory intensive applications
&lt;/h3&gt;

&lt;p&gt;Do you need to run CPU Intensive, Memory Intensive, heavy computational tasks on the backend such as Big Data Processing, Parallel Processing, Running Monitoring &amp;amp; Analytics on quite a large amount of data?&lt;/p&gt;

&lt;p&gt;Regular web frameworks &amp;amp; scripting languages are not meant for number crunching. Tech commonly used in the industry to write performant, scalable, distributed systems is C++. It has features that facilitate low-level memory manipulation, providing more control over memory to the developers when writing distributed systems. Majority of the cryptocurrencies are written using this language. Here’s a great course to &lt;a href="https://www.educative.io/courses/learn-cpp-from-scratch" rel="noopener noreferrer"&gt;Learn C++ for free&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Rust is a programming language similar to C++. It is built for high performance and safe concurrency. It’s gaining a lot of popularity lately amongst the developer circles. Java, Scala &amp;amp; Erlang are also a good pick. Most of the large scale enterprise systems are written in Java.&lt;/p&gt;

&lt;p&gt;Go is a programming language by Google to write apps for multi-core machines &amp;amp; handling a large amount of data. &lt;a href="https://www.educative.io/courses/introduction-to-programming-in-go" rel="noopener noreferrer"&gt;Here’s how you can get started with Go development&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Julia is a dynamically programmed language built for high performance &amp;amp; running computations &amp;amp; numerical analytics.&lt;/p&gt;

&lt;p&gt;Learn &lt;a href="https://www.educative.io/courses/learn-cpp-from-scratch" rel="noopener noreferrer"&gt;C++&lt;/a&gt;, &lt;a href="https://www.educative.io/courses/learn-rust-from-scratch" rel="noopener noreferrer"&gt;Rust&lt;/a&gt;, &lt;a href="https://www.educative.io/courses/learn-scala-from-scratch" rel="noopener noreferrer"&gt;Scala&lt;/a&gt;, and &lt;a href="https://www.educative.io/courses/learn-java-from-scratch" rel="noopener noreferrer"&gt;Java&lt;/a&gt; for free today.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to become a software architect?
&lt;/h2&gt;

&lt;p&gt;If this all sounds interesting, then you may aspire to be a software architect. But where do you start? Well, it’s extremely uncommon for someone to start out as a software architect, so most software engineers work for a few years before they take on designing architecture.&lt;/p&gt;

&lt;p&gt;One of the best ways to become familiar with software architecture is by designing your own web applications. This will force you to think through all the different aspects of your application, from load balancing, message queueing, stream processing, caching and more. Once you start to understand how these concepts fit into your app, you’ll be well on your way to becoming a software architect.&lt;/p&gt;

&lt;p&gt;As an aspiring software architect, you need to constantly expand your knowledge and stay on top of the latest industry trends. You may start by learning one or more programming languages, work as a software developer, and gradually make your way.&lt;/p&gt;

&lt;p&gt;Even though you can’t get a software architect degree in college, there are other courses that you may find useful. &lt;a href="https://www.educative.io/courses/web-application-software-architecture-101" rel="noopener noreferrer"&gt;Web Application and Software Architecture 101&lt;/a&gt; is a great place to start learning the best practices for designing and implementing web applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to go from here?
&lt;/h2&gt;

&lt;p&gt;While there was a lot covered in this post, we’ve merely touched the surface on this topic. We still have yet to explore REST APIs, high availability, and CAP theorem.&lt;/p&gt;

&lt;p&gt;If you’d like a deep dive into software architecture, I highly recommend &lt;a href="https://www.educative.io/courses/web-application-software-architecture-101" rel="noopener noreferrer"&gt;Web Application and Software Architecture 101&lt;/a&gt;. It walks you step by step through different components &amp;amp; concepts involved when designing the architecture of a web application.&lt;/p&gt;

&lt;p&gt;You’ll learn about various architectural styles such as the client-server, peer to peer decentralized architecture, microservices, the fundamentals of data flow in a web application, different layers involved, concepts like scalability, high availability and much more.&lt;/p&gt;

&lt;p&gt;Additionally, you’ll go through the techniques of picking the right architecture and the technology stack to implement your use case. You'll walk you through different use cases which will help you gain an insight into what technology &amp;amp; architecture fits best for a certain use case when writing a web application. You’ll come to understand the technology trade-offs involved.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you are a beginner just starting your career in software development, this course will help you a lot. It will also help you with the software engineering interviews, especially for the full stack developer positions.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Happy learning!&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>design</category>
      <category>microservices</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>How to become a Blockchain Developer: A Complete Guide</title>
      <dc:creator>Cameron Wilson</dc:creator>
      <pubDate>Thu, 30 Jan 2020 23:11:24 +0000</pubDate>
      <link>https://dev.to/educative/how-to-become-a-blockchain-developer-a-complete-guide-226f</link>
      <guid>https://dev.to/educative/how-to-become-a-blockchain-developer-a-complete-guide-226f</guid>
      <description>&lt;p&gt;Blockchain is still very much in its infancy but the opportunities for developers to get involved are not only exciting but abundant.&lt;/p&gt;

&lt;p&gt;Blockchain has injected itself into many different industries including supply chain, automotive, and financial, but it hasn’t been without its faults. Where we really started to see a use case for Blockchain is when cryptocurrency came around, and in particular Bitcoin. In fact, the first Bitcoin blockchain was created in 2009, by the pseudonym of Satoshi Nakamoto.&lt;/p&gt;

&lt;p&gt;While Blockchain may be new and somewhat skeptical, it is a very sought after skill-set by companies of all sizes. If you’re able to develop and deploy Blockchain networks and have experience with Hyperledger Fabric, it’s safe to say you’ll be in high demand. But how do you go about becoming a blockchain developer? How do you build Blockchain applications? Let’s find out how you can get started with Blockchain development in 2020 and beyond.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Want to build your first blockchain application and deploy a fabric network? Check out our newest &lt;a href="https://www.educative.io/courses/hands-on-blockchain-hyperledger-fabric" rel="noopener noreferrer"&gt;course on blockchain with Hyperledger Fabric&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here’s what will be covered:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is Blockchain Technology?&lt;/li&gt;
&lt;li&gt;Pre-reqs for understanding Blockchain&lt;/li&gt;
&lt;li&gt;The big picture: How is data stored in Blockchain?&lt;/li&gt;
&lt;li&gt;The different Blockchain platforms&lt;/li&gt;
&lt;li&gt;Most popular Blockchain programming languages&lt;/li&gt;
&lt;li&gt;Introduction to Hyperledger Fabric&lt;/li&gt;
&lt;li&gt;Why specialize in Hyperledger Fabric&lt;/li&gt;
&lt;li&gt;Getting started with Blockchain development&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s dive in!&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Blockchain Technology
&lt;/h2&gt;

&lt;p&gt;Blockchain is a term used to describe DLT, or Distributed Ledger Technology. Blockchain is used to create a storage system for data in a distributed and immutable manner.&lt;/p&gt;

&lt;p&gt;These are the key features from a technological standpoint.&lt;/p&gt;

&lt;h3&gt;
  
  
  Immutability
&lt;/h3&gt;

&lt;p&gt;This means that once data is written to a blockchain data store or ledger, it cannot be changed – it’s there forever. In contrast, in a standard Relational Database, no matter how much security you implement, the data can be accessed and modified on the file system on which the data is persisted. This could be done by a corrupt admin or a hacker.&lt;/p&gt;

&lt;p&gt;A blockchain system ensures that even if a bit of data is changed at any level on the ledger, the entire system reports an invalid state. And since the data is distributed on multiple systems, the actual data with valid state can be recovered from one of the systems.&lt;/p&gt;

&lt;h3&gt;
  
  
  Distribution
&lt;/h3&gt;

&lt;p&gt;As long as you see data on a blockchain and it’s in a valid state on a majority of distributed nodes, you can trust that data to be accurate. This trust is key. This trust is achieved in a blockchain system by replicating the datastore on a number of peers (hosts) on the internet. If one of the misbehaving peers goes in an invalid state, the other peers can filter it out. As long as there is a majority of peers agreeing to a common valid state, you can completely trust the data that is stored on that system. This replication also guarantees high availability.&lt;/p&gt;

&lt;p&gt;This trust is vital! No other system in the past has been able to develop this by design.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pre-reqs for understanding Blockchain
&lt;/h2&gt;

&lt;p&gt;Let’s dive into some prerequisites that you’ll need to really understand Blockchain. Here, we’ll be discussing Hash Functions and Public Key Cryptography.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hash Functions
&lt;/h3&gt;

&lt;p&gt;A hash value for data is X which is actually a one-way function:&lt;/p&gt;

&lt;p&gt;HASH(X) = Y&lt;/p&gt;

&lt;p&gt;Such that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No other X’ can have HASH(X’) equal to Y. It’s one to one mapping.&lt;/li&gt;
&lt;li&gt;The size of Y is fixed and the size of X can be arbitrary.&lt;/li&gt;
&lt;li&gt;Given Y you can not calculate X. It’s a one-way function!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqnj5tye76itlfpei7qt1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqnj5tye76itlfpei7qt1.png" alt="Alt Text" width="800" height="294"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Hash Functions for Checking Integrity
&lt;/h3&gt;

&lt;p&gt;This means that I can take a huge text file and compute its unique digest using a hash function. If I send that file and its computed hash along with it to a receiver, let’s say Bob, then Bob can go on to recompute the hash to ensure that file’s contents did not get corrupt in the transmission. When we download a file from the internet it uses the same hash functions to verify its integrity.&lt;/p&gt;

&lt;h3&gt;
  
  
  SHA256 Hash Function
&lt;/h3&gt;

&lt;p&gt;There are multiple standardized hash function implementations that are used, and most notably SHA256.&lt;/p&gt;

&lt;p&gt;You can find libraries that implement SHA256 hash in all technologies so you never have to write your code for SHA256 implementation.&lt;/p&gt;

&lt;p&gt;Here's an example of data entered and the SHA256 value:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F34m14nisthkcsc2c17ck.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F34m14nisthkcsc2c17ck.png" alt="Alt Text" width="800" height="133"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Quick notes on Hash Functions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HASH(x) = HASH(y) implies x=y&lt;/li&gt;
&lt;li&gt;SHA256 produces a 256 bit (8 byte) hash value, so there are 2^256 possible Hash values&lt;/li&gt;
&lt;li&gt;Each input has a unique hash value&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Public Key Cryptography
&lt;/h3&gt;

&lt;p&gt;Public key cryptography is a cryptographic system used for encryption/decryption of data. It is not a one way like a hash function. That means the data, once encrypted, can be decrypted if you have the required key.&lt;/p&gt;

&lt;p&gt;You start by generating a special, related pair of keys. These keys can be generated only together as an output of single execution of a key generation algorithm.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7hajrhkse7ynblotkab0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7hajrhkse7ynblotkab0.png" alt="Alt Text" width="800" height="218"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key usage:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Any key can lock, or encrypt, the data. To unlock, or decrypt, we need the other key. The only way to decrypt and make the data readable is by having the corresponding key.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F40yo2rwmrm6f0fufjmvk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F40yo2rwmrm6f0fufjmvk.png" alt="Alt Text" width="800" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Quick notes on Public Key Cryptography:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If a person possesses a private key, the person cannot generate the corresponding private key using a key-pair generator.&lt;/li&gt;
&lt;li&gt;The key difference between encrypting data using a hash function as compared to the public and private key in public key cryptography is that the input can be re-generated from the encrypted-output using public key cryptography&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The big picture: How is data stored in Blockchain
&lt;/h2&gt;

&lt;p&gt;In a blockchain system, data is stored in blocks of transactions. The most common definition is as follows:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A timestamped log of transactions that is replicated on peer networks.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Distributed Consensus
&lt;/h3&gt;

&lt;p&gt;Now, some of these peers might be evil and intentionally report a tampered version of blockchain data. The entire network uses democracy to come to a consensus on the current state of data and any non-conformant or outlier peers are ignored/blocked.&lt;/p&gt;

&lt;p&gt;This means that in order for a blockchain network to be fair and valid, most of the nodes have to be fair. If 51% of the nodes are compromised the network is hacked. Since the networks are globally distributed, this is not a possibility.&lt;/p&gt;

&lt;h3&gt;
  
  
  Data Storage in Blocks
&lt;/h3&gt;

&lt;p&gt;Let’s see how blockchain stores data in blocks. Each block stores a data blob (which is usually a list of transactions), its block number, and hash of the previous block:&lt;/p&gt;

&lt;p&gt;Each block is represented by a JSON object here for better understanding:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fc14r8piisgla3dsekqbq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fc14r8piisgla3dsekqbq.png" alt="Alt Text" width="800" height="354"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3ayfs33u3c439wb5tyeg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3ayfs33u3c439wb5tyeg.png" alt="Alt Text" width="800" height="243"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s look at the previous block hash, referenced as “prevHash” in the above diagram.&lt;/p&gt;

&lt;p&gt;When creating a new block, the hash of the previous block is calculated and added to the next block. Now if the previous block is altered later in time, the next block will be invalid as the prevHash stored in it will not match the actual hash of previous block.&lt;/p&gt;

&lt;p&gt;Using one-way hash functions, the data in the blockchain is safeguarded from tampering.&lt;/p&gt;

&lt;p&gt;You have seen how we can store data in a structure called blockchain. In a distributed blockchain network:&lt;/p&gt;

&lt;p&gt;Multiple peers have a process(peer.exe) running that maintains a ledger on their local storage.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fksa0q6jvxcfpjxf7q0tr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fksa0q6jvxcfpjxf7q0tr.png" alt="Alt Text" width="800" height="570"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This process connects to other process instances running on other machines to receive updates on new blocks, transactions, health and validity checks etc to keep itself updated.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Frl903hupyvtz5uqs0xxd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Frl903hupyvtz5uqs0xxd.png" alt="Alt Text" width="800" height="570"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A transaction/block can be appended by any peer and is then broadcasted to all peers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fobzwrkp93ivq2tgpj04l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fobzwrkp93ivq2tgpj04l.png" alt="Alt Text" width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since multiple peers are adding transactions/blocks simultaneously, the consensus protocol along with the ledger implementation ensures “validity” and ordering of transactions in blocks forming the blockchain.&lt;/p&gt;

&lt;h2&gt;
  
  
  The different Blockchain platforms
&lt;/h2&gt;

&lt;p&gt;There are many platforms available to professional blockchain developers, so let’s explore the two most notable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ethereum
&lt;/h3&gt;

&lt;p&gt;At its simplest, Ethereum is an open software platform based on blockchain technology that enables developers to build and deploy decentralized applications or dapps. Ethereum uses a smart contract on the Ethereum Virtual Machine for different applications to use decentralization and make it useable for mass consumption.&lt;/p&gt;

&lt;p&gt;Ethereum is a generic platform with a smart contracts engine. So, you can apply it almost anywhere. However, as it’s permissionless and provides full transparency, it would cost you privacy and scalability.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hyperledger Fabric
&lt;/h3&gt;

&lt;p&gt;Hyperledger targets building enterprise blockchain applications with an emphasis on security. When compared to Ethereum, you won’t be seeing an issue of privacy and scalability because of the permissioned nature.&lt;/p&gt;

&lt;p&gt;Hyperledger is designed to provide a framework with which enterprises can put together their own, individual blockchain network that can scale and is more secure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Most popular Blockchain programming languages
&lt;/h2&gt;

&lt;p&gt;Blockchain developers have a slew of languages that are available to them, so let’s explore a few.&lt;/p&gt;

&lt;h3&gt;
  
  
  Solidity
&lt;/h3&gt;

&lt;p&gt;If you’re looking to specialize in Ethereum, then you want to become familiar with Solidity. This programming language is specifically used to write smart contracts. It is object-oriented, statically typed, and was designed around the ECMAScript syntax to make it more familiar for web developers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Go
&lt;/h3&gt;

&lt;p&gt;Go is ideal for blockchain development, especially for building hyperledger fabric. The statically-typed yet compiled language has the performance level needed by a blockchain coding language. It’s one of the best programming languages for blockchain when it comes to developing a system that is not only efficient but also fast. To get started with Go, you can visit, &lt;a href="https://www.educative.io/courses/introduction-to-programming-in-go" rel="noopener noreferrer"&gt;An Introduction to Programming in Go&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Python
&lt;/h3&gt;

&lt;p&gt;What makes Python one of the best blockchain coding languages is its open source support. You can find third-party Python plugins and libraries for almost every problem you encounter when developing your blockchain project. Here’s a great &lt;a href="https://www.educative.io/courses/learn-python-from-scratch" rel="noopener noreferrer"&gt;free Python course&lt;/a&gt; that’ll help you learn Python from scratch.&lt;/p&gt;

&lt;h3&gt;
  
  
  C++
&lt;/h3&gt;

&lt;p&gt;C++ is a great blockchain programming language for reasons such as its precise control over memory, advanced multi-threading capabilities, and core object-oriented features. The object-oriented feature of this blockchain coding language gives developers the ability to bind the data and the methods together, just like how blockchain binds blocks with chains. &lt;a href="https://www.educative.io/courses/learn-cpp-from-scratch" rel="noopener noreferrer"&gt;Learn C++ for free&lt;/a&gt; today and get started with Blockchain development.&lt;/p&gt;

&lt;h3&gt;
  
  
  JavaScript
&lt;/h3&gt;

&lt;p&gt;Thanks to Nodejs, developers now can build blockchain applications with JavaScript.&lt;/p&gt;

&lt;p&gt;Why choose JS over the other languages?&lt;/p&gt;

&lt;p&gt;Well for one, it’s already running on most systems. That means you do not need to worry about integration and can concentrate exclusively on the application logic. &lt;a href="https://www.educative.io/courses/javascript-in-practice-getting-started" rel="noopener noreferrer"&gt;Learn to code in JavaScript&lt;/a&gt; today.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction to Hyperledger Fabric
&lt;/h2&gt;

&lt;p&gt;Hyperledger Fabric is a “blockchain platform for the enterprise” created by IBM and is under the Linux Foundation. It is open source and modular - allowing different modules to be used, plug and play style. This enables a wide variety of enterprise requirements. It is designed to provide speed and scalability that is lacking in public chains due to proof of work requirement, which is essentially nuance mining.&lt;/p&gt;

&lt;p&gt;Hyperledger fabric is ideal for building a permissioned, private blockchain business network. By private, it means that it should not be publicly open for everyone to run a peer or transact on the network. For enterprises, this a big requirement that Hyperledger fabric meets. Enterprises need more control on their data access policies. They also need a permissioned network so they can implement access control as per their own requirements.&lt;/p&gt;

&lt;p&gt;At a high level, this is how a Hyperledger network works. The permission issuer issues or revokes permissions for all participants and infrastructure components of the network. This permission or access control in Fabric is based on X509 PKI infrastructure. Which means there is a trusted certificate authority that issues certificates to all participants.&lt;/p&gt;

&lt;p&gt;Smart contracts hold logic that defines who can change what on the ledger. And participants write transactions on the ledger by invoking smart contracts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why specialize in Hyperledger Fabric
&lt;/h2&gt;

&lt;p&gt;By understanding and working with Hyperledger principles, you’ll have the opportunity to contribute to the Hyperledger Fabric project which is owned by the Linux Foundation. It’s a global collaboration that moves across industries, so your knowledge and expertise would have a considerable impact, and as more industries make the move to blockchain, this project will only become more prescient. We’re already seeing companies like Walmart, McDonalds, Nestle, and Dole implement this technology. &lt;a href="https://medium.com/coinmonks/hyperledger-projects-in-real-companies-35016745362c" rel="noopener noreferrer"&gt;Here are some other notable projects going on&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The Linux Foundation is striving to standardize the process with this project and the opportunities to get involved are both exciting and abundant. Distributed ledger technology is going to be one of the biggest transformations of the digital world. Business transactions, the internet of things, and our resources could be safer and more secure using blockchain solutions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started with Blockchain development
&lt;/h2&gt;

&lt;p&gt;While there was a lot covered in this post, there is still much more to learn and get your hands on.&lt;/p&gt;

&lt;p&gt;In this Blockchain course, &lt;a href="https://www.educative.io/courses/hands-on-blockchain-hyperledger-fabric" rel="noopener noreferrer"&gt;Hands-on Blockchain with Hyperledger Fabric&lt;/a&gt;, you’ll build upon the concepts mentioned in this post. You’ll also get to deploy your own blockchain network, deploy chaincode on it and create an application that invokes your chaincode running in fabric network. You will also learn to manage fabric user identities in your application using wallets.&lt;/p&gt;

&lt;p&gt;This course is a great starting point for engineers looking to develop expertise in blockchain technology with Hyperledger Fabric specialty.&lt;/p&gt;

&lt;p&gt;Happy learning!&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>hyperledgerfabric</category>
    </item>
    <item>
      <title>Learn to Code: 15 FREE Educative programming courses for software developers</title>
      <dc:creator>Cameron Wilson</dc:creator>
      <pubDate>Thu, 23 Jan 2020 00:00:12 +0000</pubDate>
      <link>https://dev.to/educative/learn-to-code-15-free-educative-programming-courses-for-software-developers-1ei6</link>
      <guid>https://dev.to/educative/learn-to-code-15-free-educative-programming-courses-for-software-developers-1ei6</guid>
      <description>&lt;p&gt;If you’re thinking about learning to code, figuring out where to start can be one of the hardest parts. To help with that, below I’ve listed out 15 absolutely FREE courses to help you get your journey started. There is something here for not only beginner devs but senior devs too.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;These courses are all part of &lt;a href="https://www.educative.io/" rel="noopener noreferrer"&gt;Educative.io&lt;/a&gt;’s “From Scratch” series, which provides high-quality text-based courses for beginning software developers. All the courses feature in-browser coding environments, meaning there’s no setup required. They’re complete with quizzes and challenges to further test your understanding of the material.&lt;/em&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  1. Learn Python from Scratch
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo1zdu089dukrldanlfy2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo1zdu089dukrldanlfy2.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Python is one of the most popular languages in the world, in part due to its ability to satisfy multiple use cases. It can be used for web development, data analysis, machine learning, and software development. By learning Python, you’ll open many doors which will lead to a successful and fulfilling career.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.educative.io/courses/learn-python-from-scratch" rel="noopener noreferrer"&gt;Learn Python from Scratch&lt;/a&gt; begins by exploring the basic building blocks like data types and variables, conditional statements, and data structures. You’ll then move on to more higher-level concepts such as functions and loops. Throughout each section will be quizzes and coding challenges to accompany you along the way and help enforce all the concepts covered in the course.&lt;/p&gt;

&lt;p&gt;This course is geared towards beginners who have no prior experience programming in Python. It’s also a good refresher course for those of you who haven’t touched Python in a while and would like to get back into it. There’s even a detailed learning track after you finish this course so you’re not left with asking, “What should I learn next?”.&lt;/p&gt;

&lt;h1&gt;
  
  
  2. Learn Web Development from Scratch: Go Beyond the Syntax
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fto80zcbm0j4kmtvvnstx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fto80zcbm0j4kmtvvnstx.png" alt="Alt Text" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you start learning about web development, the number of resources that are available on the web can make the task challenging. Should you watch videos on HTML and CSS? Do you use Javascript or jQuery? Getting a handle on the number of concepts and jargon surrounding developing applications for the web can be a full-time job in and of itself.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.educative.io/courses/learn-web-development-from-scratch" rel="noopener noreferrer"&gt;Learn Web Development from Scratch: Go Beyond the Syntax&lt;/a&gt; was designed to cover the basics of web pages, from semantically marking up your page with HTML to stylizing your content with CSS. Then it introduces you to programming fundamentals with Javascript, and by the end, you’ll be comfortable enough to develop fully-functional web modules using Javascript, including an image carousel and a to-do list application.&lt;/p&gt;

&lt;p&gt;Instead of watching endless videos and wondering how to translate those videos into real code, you’ll be practicing what you learn through interactive, test-based exercises.&lt;/p&gt;

&lt;h1&gt;
  
  
  3. Learn Java from Scratch
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnj40h1ddk1mm3qh7upx1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnj40h1ddk1mm3qh7upx1.png" alt="Alt Text" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The need for Java developers is growing every day, and those that specialize in Java enjoy long and very successful careers. There is still a lot of life in Java as it’s currently supporting around 3 billion devices. One key reason why Java code is special to many programmers is the fact that you only have to write it once and it will run on any operating system in the world without necessitating any modifications. Interested in getting started? Look no further.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.educative.io/courses/learn-java-from-scratch" rel="noopener noreferrer"&gt;Learn Java from Scratch&lt;/a&gt; introduces you to fundamental programming concepts in Java. It begins with a simple “Hello World” program and proceeds on to cover common concepts such as Conditional Statements, Loop Statements, Simple Math, and Logic.&lt;/p&gt;

&lt;p&gt;Finally, it dives deeper in order to teach about advanced concepts such as Classes &amp;amp; Inheritance, Generics and ArrayLists. By the time you’re done, you’ll be an intermediate level Java developer, ready to take on your own projects.&lt;/p&gt;

&lt;p&gt;This course is designed for those with no prior knowledge of programming in Java. With 97 lessons, 11 quizzes, and 32 challenges, you’ll quickly level up your coding skills and gain the confidence to explore more challenging concepts.&lt;/p&gt;

&lt;h1&gt;
  
  
  4. Learn Scala from Scratch
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk3188mk8ou8vtg84liy6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk3188mk8ou8vtg84liy6.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scala i.e. Scalable Language is by no means a new language but it has seen a resurgence due to its expressiveness, interoperability with Java, and its multiple paradigms. This allows you to work in a variety of styles, freely intermixing constructs giving you a larger number of tools to solve a wider range of problems.&lt;/p&gt;

&lt;p&gt;Scala was designed to be a “better” Java, and while that’s open to interpretation, there are many reasons why Java developers prefer Scala. Scala is often seen in an enterprise setting (it’s being used at companies like Twitter and LinkedIn) which is why the starting salary for Scala developers is so high. See &lt;a href="https://www.educative.io/blog/what-software-technologies-will-earn-you-the-highest-pay" rel="noopener noreferrer"&gt;What software technologies will earn you the highest pay&lt;/a&gt;. Ready to learn Scala?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.educative.io/courses/learn-scala-from-scratch" rel="noopener noreferrer"&gt;Learn Scala from Scratch&lt;/a&gt; introduces you to fundamental programming concepts in Scala, where it begins with an overview of common concepts such as: variables and types, operators, and how to work with strings.&lt;/p&gt;

&lt;p&gt;You’ll then cover some more advanced topics like control structures, functions, higher-order functions, and finally classes and objects. By the end of this course, you’ll have a sound understanding of both functional and object-oriented programming which are crucial paradigms that you need to learn.&lt;/p&gt;

&lt;p&gt;This course is designed for those who have never programmed in Scala. To get started with this course it will help to have basic knowledge of computer fundamentals. This course is not recommended for individuals who have zero prior knowledge of programming. On that note, while it’s not required for you to know Java (the course will assume that you don’t), it might help you pick up concepts and syntax faster if you are familiar with it.&lt;/p&gt;

&lt;h1&gt;
  
  
  5. Learn C++ from Scratch
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsxj7vjryzdmm5alb911q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsxj7vjryzdmm5alb911q.png" alt="Alt Text" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;C++ notoriously has a steep learning curve, but taking the time to learn this language will do wonders for your career and will set you apart from other developers. You’ll have an easier time picking up new languages, you’ll form real problem-solving skills, and build a solid foundation on the fundamentals of programming.&lt;/p&gt;

&lt;p&gt;C++ will help you instill good programming habits (i.e. clear and consistent coding style, comment the code as you write it, and limit the visibility of class internals to the outside world), and because there’s hardly any abstraction, you’re required to define just about every attribute to make your code work; this will force you to really understand what it is you’re doing and how your program will affect the system. Ready to learn?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.educative.io/courses/learn-cpp-from-scratch" rel="noopener noreferrer"&gt;Learn C++ from Scratch&lt;/a&gt; introduces you to the fundamental programming concepts in C++. You’ll begin the course with a simple “Hello World” program and proceed to cover common concepts such as conditional statements, loop statements, and functions in C++.&lt;/p&gt;

&lt;p&gt;It then reflects upon the idea of pointers and arrays, as well as the power they give to the programmer to write better code. Finally, it dives deeper in order to teach about advanced concepts such as classes, inheritance, and templates in C++ through interactive challenges and exercises.&lt;/p&gt;

&lt;p&gt;This course was designed for beginners, and while there is a substantial learning curve, this course condenses what you need to know to get started and it’s all in one place. There is also a dedicated learning track that will guide you on what to learn next, so you’re not left with the question, “Where do I go from here?”.&lt;/p&gt;

&lt;h1&gt;
  
  
  6. Learn C from Scratch
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhvh34ads1ka9clah814a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhvh34ads1ka9clah814a.png" alt="Alt Text" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Look at the nearest gadget to you right now. It’s most likely powered by C. Your operating system is most certainly written — at least in part — in C. So are the drivers.&lt;/p&gt;

&lt;p&gt;As the “Internet of Things” (IoT) continues to take prevalence in the world, a lot of it is powered by C. Anything that handles huge amounts of data or requires optimal performance is usually written in C, due to its remarkably small runtime. The world’s most popular databases, like Oracle, MySQL, MS SQL Server, and PostgreSQL, are coded in C. Ditto for Apache and nginx servers.&lt;/p&gt;

&lt;p&gt;The incredibly efficient and powerful C language forms the basis for many other languages like C++, Java, and Python. It allows you to interact directly with memory and low-level computer operations, thereby enhancing your programming skills and deepening your understanding.&lt;/p&gt;

&lt;p&gt;C is considered a middle-level programming language. For most people, it’s the closest you’ll get to writing machine code. You can program a system, then turn around and design an application that runs on that system. This sandwiches C in between assembly language, and more high-level languages like Java.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.educative.io/courses/learn-c-from-scratch" rel="noopener noreferrer"&gt;Learn C from Scratch&lt;/a&gt; will introduce you to all the basic and advanced programming concepts of the C language. It outlines data types, control flow, functions, input/output, memory, compilation, debugging and other advanced topics like parallel programming in a comprehensive, yet concise manner.&lt;/p&gt;

&lt;p&gt;This course is for beginners or mid-level developers. Even if you don’t want to specialize in C, the pros for learning this language far outweigh the cons. By learning C, you’ll pick up other languages more easily, deepen your understanding of concepts like memory management, and clearly understand how what you program affects the system.&lt;/p&gt;

&lt;h1&gt;
  
  
  7. Learn Dart: First Step to Flutter
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faw9qwouo38q68jdai49j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faw9qwouo38q68jdai49j.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Want to develop apps in Android and/or iOS? You should look into Dart and Flutter. &lt;a href="https://www.educative.io/courses/learn-dart-first-step-to-flutter" rel="noopener noreferrer"&gt;Learn Dart: First Step to Flutter&lt;/a&gt; is designed for programmers who have never programmed in Dart and want to get started with Flutter.&lt;/p&gt;

&lt;p&gt;Dart is a clean, simple, class-based object-oriented language that has more structure than JavaScript, the programming language it is heavily based on. Developed by Google, Dart is great for developers that are interested in having a structure in their programming language so that they can easily do refactoring and build large web applications.&lt;/p&gt;

&lt;p&gt;However, you can’t have a conversation about Dart without mentioning Flutter.&lt;/p&gt;

&lt;p&gt;Flutter is Google’s mobile UI framework used for crafting high-quality native interfaces on iOS and Android. Flutter applications are written using the Dart programming language, which has helped make Dart a beloved language by the developer community. Before you can start fluttering out applications using Flutter, you need to learn Dart.&lt;/p&gt;

&lt;p&gt;You’ll learn Dart from the ground up; going over everything you need to know to write a basic program assuming you have no prior knowledge of the language. Topics include: Data types and variables, operators, collections, control flow statements, functions, and classes. By the end of this course you’ll be ready to take on Flutter to create stunning UIs.&lt;/p&gt;

&lt;p&gt;This course is for beginners and professionals alike. It’s ideal for those who want to develop applications in iOS or Android.&lt;/p&gt;

&lt;h1&gt;
  
  
  8. Learn Rust from Scratch
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fupwqzwwos0p938jimji8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fupwqzwwos0p938jimji8.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The word is out: developers love Rust. It’s quickly becoming one of the most popular languages among systems and embedded programmers, and the demand for Rust developers is growing considerably. It’s a very powerful language in terms of performance, reliability, and productivity, especially when compared to C++. C++ developers have also enjoyed learning Rust because of its “simplicity” when designing concurrent and multithreaded applications which is exceptionally difficult to do in C++. If you’re a system developer looking for a new language to learn, then Rust is a great place to look next.&lt;/p&gt;

&lt;p&gt;With &lt;a href="https://www.educative.io/courses/learn-rust-from-scratch" rel="noopener noreferrer"&gt;Learn Rust from Scratch&lt;/a&gt; you’ll be able to learn Rust while getting your hands dirty along the way. It begins with a simple “Hello world” program and proceeds to cover common concepts such as Arrays, Strings, Vectors, Enums, Structures, Traits, Generic, Functions, and Logic. Finally, it dives deeper into more advanced concepts like Lifetime and memory management.&lt;/p&gt;

&lt;p&gt;This course is for beginners and mid-level developers who are looking to specialize in system and embedded programming.&lt;/p&gt;

&lt;h1&gt;
  
  
  9. Learn Perl from Scratch
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0iu1iu21a6n8u5b1c65w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0iu1iu21a6n8u5b1c65w.png" alt="Alt Text" width="800" height="339"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Perl is one of the most popular text processing languages in the world. It allows you to create extremely efficient text parsers for all sorts of applications. Because of the powerful text parsing capabilities, it’s often used as a tool for data scientists, but the fact that it’s a general-purpose language makes it perfectly suitable for web development, network programming, and GUI development.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.educative.io/courses/learn-perl-from-scratch" rel="noopener noreferrer"&gt;Learn Perl from Scratch&lt;/a&gt; will help you get up to speed on Perl, starting off with basic concepts like loops, strings, and arrays. You’ll build your way up to more complex topics like: data structures, packages, subroutines, and conditional statements.&lt;/p&gt;

&lt;p&gt;No background knowledge is needed for this course.&lt;/p&gt;

&lt;h1&gt;
  
  
  10. Learn R from Scratch
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fofhxwgwaq77jbgi18bv1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fofhxwgwaq77jbgi18bv1.png" alt="Alt Text" width="800" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The digital world we live in has given companies and people access to staggering amounts of data, and anyone that can make use of that to drive valuable insights stands to benefit. The ability to work with large amounts of data is becoming a standard requirement for countless jobs across multiple industries.&lt;/p&gt;

&lt;p&gt;Enter R, probably the most well-known language for data analysis. It’s been used for years due to its robust statistical functionality, outstanding graphing ability, and extensibility through packages.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.educative.io/courses/learn-r-from-scratch" rel="noopener noreferrer"&gt;Learn R from Scratch&lt;/a&gt; will get you up to speed and assumes no prior knowledge of R. You’ll start with the very basics and work your way up to advanced concepts like exception handling. By the time you’re done, you’ll be able to write detailed, useful code in R to work with large amounts of data.&lt;/p&gt;

&lt;p&gt;This course is particularly designed for programmers or statisticians who have never programmed in R before yet want to build their skills in R. This course will not only teach basic syntax in R, but also present basic problems that you can solve hands-on.&lt;/p&gt;

&lt;h1&gt;
  
  
  11. Learn PHP from Scratch
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz6azeb08mwt3enspq1sx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz6azeb08mwt3enspq1sx.png" alt="Alt Text" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;PHP is a widely-used, open source, general-purpose scripting language that is especially suited for web development. Basically, anything that you want to do on a web server, you can do with PHP. That includes: making a blog, creating a full fledged software-as-a-service application, and writing scripts for data processing.&lt;/p&gt;

&lt;p&gt;The best thing about using PHP is that it is extremely simple for a newcomer, but offers many advanced features for a professional programmer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.educative.io/courses/learn-php-from-scratch" rel="noopener noreferrer"&gt;Learn PHP from Scratch&lt;/a&gt; introduces you to the fundamental programming concepts in PHP. It begins with a simple Hello world program and proceeds on to cover common concepts such as Conditional Statements, Loop Statements, and Logic in PHP.&lt;/p&gt;

&lt;p&gt;It then reflects upon the idea of Functions and Arrays, as well as the power they give to the programmer to write better code.&lt;/p&gt;

&lt;p&gt;Finally, it dives deeper in order to teach about advanced concepts such as Classes, Inheritance and Exception Handling in PHP. By the time you’re done, you’ll have a good grip on the basics of PHP, and will be ready to study advanced concepts.&lt;/p&gt;

&lt;h1&gt;
  
  
  12. Learn Ruby from Scratch
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8t2ytljtswvira7un6kj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8t2ytljtswvira7un6kj.png" alt="Alt Text" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Do you want to be an interpreted language geek? Are you tired of getting entangled in the dense syntaxes? Does it irritate you to compile your code to machine language first? Are you looking for an easy-to-use scripting language? Well, Ruby is the best pick for you then.&lt;/p&gt;

&lt;p&gt;Ruby is a smart, easy-to-use, functional, Object-Oriented programming language, which comes as a wondrous mix of Perl’s scripting power, Pythonic capabilities and much more. As Matsumoto, creator of Ruby, implies: “I hope to see Ruby help every programmer in the world to be productive, and to enjoy programming, and to be happy. That is the primary purpose of the Ruby language.”&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.educative.io/courses/learn-ruby-from-scratch" rel="noopener noreferrer"&gt;Learn Ruby from Scratch&lt;/a&gt; will be providing you with hands-on practice with the basics as well as advanced concepts. Topics include: variables, built-in classes, objects, methods, blocks, conditionals, and much more. There are 30 challenges to help you practice and solidify what you’ve learned, and all coding exercises can be completed in-browser without the need for a development environment.&lt;/p&gt;

&lt;h1&gt;
  
  
  13. Learn Vue.js from Scratch: Building &amp;amp; Testing a Movie App
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjka083rgiov1g4haro00.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjka083rgiov1g4haro00.png" alt="Alt Text" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Vue is one of the most popular frontend frameworks, in large part due to its simplicity and easy adoption for teams of all sizes. While it’s not backed by some of the big names (like React and Angular), the developer community is supportive and active which is a big plus for new developers.&lt;/p&gt;

&lt;p&gt;If you want to build an application from scratch in a short amount of time, you may want to consider Vue. Vue has shown that the learning curve is not as steep compared to other frontend frameworks. If you already know some HTML/CSS/JS basics and want to level up your skills, then this course is going to be a good place to start.&lt;/p&gt;

&lt;p&gt;In &lt;a href="https://www.educative.io/courses/learn-vuejs-from-scratch" rel="noopener noreferrer"&gt;Learn Vue.js from Scratch: Building &amp;amp; Testing a Movie App&lt;/a&gt;, you will learn Vue.js basics, API, unit tests and test-driven development, styling, responsive design and how to deploy an app. Finally, you will be creating a movie searching app to put on your portfolio and you’ll be ready to build your own Vue apps by the end of the course.&lt;/p&gt;

&lt;h1&gt;
  
  
  14. Functional Programming Patterns with RamdaJS
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4s2n9r22lrpxaklclqon.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4s2n9r22lrpxaklclqon.png" alt="Alt Text" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ramda is a library of functions designed to make functional programming in JavaScript easy and powerful without making it any less like JavaScript.&lt;/p&gt;

&lt;p&gt;Can’t I do FP in vanilla Javascript? Sure you can, but the difference is that RambdaJS is a library specifically designed for the functional style of programming.&lt;/p&gt;

&lt;p&gt;In &lt;a href="https://www.educative.io/courses/functional-programming-patterns-with-ramdajs" rel="noopener noreferrer"&gt;Functional Programming Patterns with RamdaJS&lt;/a&gt; the author shares with you tried and true patterns that will help you write reproducible, clean code.&lt;/p&gt;

&lt;p&gt;Before going through them, though, the course lays the groundwork with concepts like pure functions, currying, and point-free style. A few of the common patterns you’ll find are functors and lenses. There’s also a fully blown project, which aims to transcend the student from doing snippets and short-lived exercises, to a concrete real world example.&lt;/p&gt;

&lt;p&gt;This course is great for intermediate or advanced JavaScript developers, where you’ll learn to recognize FP hallmarks like map, filter, reduce, and perhaps use something like Lodash to make your life easier.&lt;/p&gt;

&lt;h1&gt;
  
  
  15. Understanding Flexbox: Everything you need to know
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsnp6c07ftewsv7ixpe1r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsnp6c07ftewsv7ixpe1r.png" alt="Alt Text" width="800" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The flexbox model provides an efficient way to layout, align, and distribute space among elements within your document, even when the viewport and the size of your elements is dynamic or unknown.&lt;/p&gt;

&lt;p&gt;We always had to deal with floats, table display hacks, and the consequences they brought. If you’ve written CSS for sometime, you can probably relate to this.&lt;/p&gt;

&lt;p&gt;Now we can all ditch those hacky CSS tricks. No more incessant use of floats, table-cell displays. It’s time to embrace a cleaner modern syntax for crafting intelligent layouts. Welcome the CSS Flexbox model.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.educative.io/courses/understanding-flexbox-everything-you-need-to-know" rel="noopener noreferrer"&gt;Understanding Flexbox: Everything you need to know&lt;/a&gt; will cover all the fundamental and advanced concepts you need to become an expert with the CSS Flexbox model. You will learn to layout a Responsive Music App in the process, which is a great addition to your portfolio. Topics covered in this course are: Flex containers and items, auto margin alignment, responsive design with Flexbox, and more.&lt;/p&gt;




&lt;p&gt;That about wraps it up. Now go show the world your programming prowess.&lt;/p&gt;

&lt;p&gt;Happy learning!&lt;/p&gt;

</description>
      <category>python</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>java</category>
    </item>
    <item>
      <title>Full Stack Python Flask tutorial: Creating your first Flask Application</title>
      <dc:creator>Cameron Wilson</dc:creator>
      <pubDate>Sat, 11 Jan 2020 00:06:43 +0000</pubDate>
      <link>https://dev.to/educative/full-stack-python-flask-tutorial-creating-your-first-flask-application-1aok</link>
      <guid>https://dev.to/educative/full-stack-python-flask-tutorial-creating-your-first-flask-application-1aok</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally posted on &lt;a href="https://www.educative.io/" rel="noopener noreferrer"&gt;Educative.io&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you’re a web developer using Python as your server-side programming language of choice, you have a number of web frameworks to choose from. One of the most notable is Flask. &lt;/p&gt;

&lt;p&gt;Flask is a micro-framework developed in Python that provides only the essential components - things like routing, request handling, sessions, and so on. It provides you with libraries, tools, and modules to develop web applications like a blog, wiki, or even a commercial website. It’s considered “beginner friendly” because it doesn’t have boilerplate code or dependencies which can distract from the primary function of an application. &lt;/p&gt;

&lt;p&gt;Flask is used for the backend, but it makes use of a templating language called Jinja2 which is used to create HTML, XML or other markup formats that are returned to the user via an HTTP request. More on that in a bit.&lt;/p&gt;

&lt;p&gt;The purpose of this post is to give you a quick Python Flask tutorial on creating your first Flask application. And if you have a little Python know-how, you can quickly hit the ground running and start creating web apps in no time. If you’d like to get started on your first project in Flask, you can visit &lt;a href="https://www.educative.io/courses/flask-develop-web-applications-in-python" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So, here’s what we’ll look at today:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Getting to know the Flask framework&lt;/li&gt;
&lt;li&gt;Hello World - your first Flask application&lt;/li&gt;
&lt;li&gt;URL Routes and Views&lt;/li&gt;
&lt;li&gt;Taking it a step further: Beginning your first project&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s dive in!&lt;/p&gt;



&lt;h1&gt;
  
  
  Getting to know the Flask framework
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Features of Flask
&lt;/h2&gt;

&lt;p&gt;Some features which make Flask an ideal framework for web application development are:&lt;br&gt;
1) Flask provides a development server and a debugger.&lt;br&gt;
2) It uses Jinja2 templates. (more on this later)&lt;br&gt;
3) It is compliant with WSGI 1.0. (more on this later)&lt;br&gt;
4) It provides integrated support for unit testing.&lt;br&gt;
5) Many extensions are available for Flask, which can be used to enhance its functionalities.&lt;/p&gt;


&lt;h2&gt;
  
  
  What is a micro-framework?
&lt;/h2&gt;

&lt;p&gt;Micro-frameworks are the opposite of full-stack frameworks, which also offer additional modules for features such as authentication, database ORM, input validation and sanitization, etc.&lt;/p&gt;


&lt;h2&gt;
  
  
  Why is Flask called a micro-framework?
&lt;/h2&gt;

&lt;p&gt;Flask is known as a micro-framework because it is lightweight and only provides components that are essential, such as routing, request handling, sessions, and so on. For the other functionalities such as data handling, the developer can write a custom module or use an extension. This approach avoids unnecessary boilerplate code, which is not even being used.&lt;/p&gt;


&lt;h1&gt;
  
  
  Key aspects of Flask: WSGI and Jinja2
&lt;/h1&gt;

&lt;p&gt;You might have heard comments such as “Flask is 100% WSGI compliant” or, “flask uses Jinja as a template language.” But what exactly does this mean? What are WSGI and Jinja2? Let’s learn what these terms mean, and their significance concerning Flask.&lt;/p&gt;
&lt;h3&gt;
  
  
  WSGI - Web Server Gateway Interface
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;Web Server Gateway Interface&lt;/strong&gt;, or more commonly known as &lt;strong&gt;WSGI&lt;/strong&gt;, is a standard that describes the specifications concerning the communication between a web server and a client application. The details of these specifications are present in &lt;a href="https://www.python.org/dev/peps/pep-3333/" rel="noopener noreferrer"&gt;PEP333&lt;/a&gt;. Here are some benefits of WSGI:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Flexibility&lt;/strong&gt; with the components of the application.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interoperability&lt;/strong&gt; within different Python frameworks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability&lt;/strong&gt; of the application with an increase in users.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Efficiency&lt;/strong&gt; in terms of speed of development.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Jinja2 - A templating language
&lt;/h3&gt;

&lt;p&gt;Jinja is a template language used in Python. But, you might ask, what exactly is a template language?&lt;/p&gt;

&lt;p&gt;Templates are the front-end, which the user sees. In the case of a website, the templates are the HTML pages. A template language is one that we can use inside HTML so that the content on the HTML page becomes dynamic. &lt;/p&gt;

&lt;p&gt;Let’s move on to creating your first Flask application.&lt;/p&gt;


&lt;h1&gt;
  
  
  Hello  World - Creating your first Flask application
&lt;/h1&gt;

&lt;p&gt;The simplest Flask application can be made using only one script! Let us call this file app.py. We will break down the program into steps and discuss each one.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 1: Importing modules
&lt;/h2&gt;

&lt;p&gt;For this application, we only need the Flask module from the flask package. So let’s import that first.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from flask import Flask
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h2&gt;
  
  
  Step 2: Creating a Flask object
&lt;/h2&gt;

&lt;p&gt;We need to make an object with the imported Flask module. &lt;strong&gt;This object will be our WSGI application called &lt;code&gt;app&lt;/code&gt;&lt;/strong&gt;. As discussed before, the WSGI aspect of the application is taken care of by the Flask module.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app = Flask(__name__)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h2&gt;
  
  
  Step 3: Run the application in main
&lt;/h2&gt;

&lt;p&gt;To run our application, we need to call the &lt;code&gt;run()&lt;/code&gt; function of our application object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if __name__ == "__main__":
    app.run()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;run()&lt;/code&gt; function has some optional parameters. For complete documentation, refer &lt;a href="https://flask.palletsprojects.com/en/master/api/?highlight=run#flask.Flask.run" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;



&lt;h2&gt;
  
  
  Step 4: Create a view function
&lt;/h2&gt;

&lt;p&gt;Before we run the application, we need to tell the application to show something as output in the browser window. Thus, we create a function called &lt;code&gt;hello()&lt;/code&gt; which returns the string "Hello World!". The output returned from this function will be shown in the browser.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def hello():
    return "Hello World!"; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h2&gt;
  
  
  Step 5: Assign a URL route
&lt;/h2&gt;

&lt;p&gt;Finally, we need to tell the Flask app when to call the view function &lt;code&gt;hello()&lt;/code&gt;. For this purpose, we will create a URL route. A URL route is associated with each view function. This association is created by using the &lt;code&gt;route()&lt;/code&gt; decorator before each view function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@app.route("/") 
def hello():
    return "Hello World!"; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;p&gt;&lt;strong&gt;Complete implementation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The following program shows the complete implementation of a “Hello World” application in Flask!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
    return "Hello World!";

if __name__ == "__main__":
    app.run(debug = True, host = "0.0.0.0", port = 3000)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h1&gt;
  
  
  Wait.. what are views, routes, and hosts?
&lt;/h1&gt;

&lt;h2&gt;
  
  
  URL routes and views
&lt;/h2&gt;

&lt;p&gt;The homepage of a website can usually be found at the URL &lt;code&gt;hostname&lt;/code&gt; followed by &lt;code&gt;/&lt;/code&gt;, &lt;code&gt;/home&lt;/code&gt;, &lt;code&gt;/index&lt;/code&gt; or something self-explanatory.&lt;br&gt;
These kinds of URLs enable the users to remember the URL and access it easily. It would be unexpected if the homepage were at a random URL such as &lt;code&gt;/39283@&amp;amp;3911&lt;/code&gt; or &lt;code&gt;/more_eggs&lt;/code&gt;. Flask allows us to use the &lt;code&gt;route()&lt;/code&gt; decorator to bind a meaningful URL to each view function we create.&lt;/p&gt;


&lt;h2&gt;
  
  
  What is a view function?
&lt;/h2&gt;

&lt;p&gt;In the discussion of the MTV (Model-Template-View) architecture, we learned what a view is. In Flask, we create a function that acts as the view. Recall from the Hello World example, we created a function called &lt;code&gt;hello&lt;/code&gt;. This function acted as a view. Then, we bonded it with a route.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@app.route("/")
def hello():
    return "Hello World!";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h2&gt;
  
  
  The &lt;code&gt;route()&lt;/code&gt; decorator
&lt;/h2&gt;

&lt;p&gt;The route decorator takes the following parameters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;rule&lt;/code&gt;: The rule represents the URL rule which is passed as a string to the decorator.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;endpoint&lt;/code&gt; (not needed): The endpoint is the name of the view function which is bound to the URL route. Flask assumes this parameter itself, and the developer does not need to specify it.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;options&lt;/code&gt; (optional): The options are an optional parameter. We will discuss it in more detail later.&lt;/li&gt;
&lt;/ul&gt;



&lt;h2&gt;
  
  
  Static routing
&lt;/h2&gt;

&lt;p&gt;In static routing, we specify a constant URL string as rule to the &lt;code&gt;route()&lt;/code&gt; decorator. For example in the mini-application given below, we have specified two static routes having URLs &lt;code&gt;/&lt;/code&gt; and &lt;code&gt;/educative&lt;/code&gt; respectively.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from flask import Flask, render_template
app = Flask(__name__)

@app.route("/")
def home():
    return "Welcome to the HomePage!"

@app.route("/educative")
def learn():
    return "Happy Learning at Educative!"


if __name__ == "__main__":
    app.run(debug=True, host="0.0.0.0", port=3000)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;home()&lt;/code&gt; view&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This view function corresponds to the route &lt;code&gt;"/"&lt;/code&gt;. When you open the URL or check the “Output” tab, this view will be called. The &lt;code&gt;"/"&lt;/code&gt; is always the default route of any web application.&lt;br&gt;
For example, when we go to educative.io the &lt;code&gt;host&lt;/code&gt; = “educative.io” and &lt;code&gt;route&lt;/code&gt; = “/”.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;learn()&lt;/code&gt; view&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This view function corresponds to the route &lt;code&gt;"/educative"&lt;/code&gt;. When you open the URL and append &lt;code&gt;"/educative"&lt;/code&gt;, this view will be called.&lt;/p&gt;

&lt;p&gt;For example, when we go to educative.io/explore, the &lt;code&gt;host&lt;/code&gt; = “educative.io” and &lt;code&gt;route&lt;/code&gt; = “/explore”.&lt;/p&gt;


&lt;h1&gt;
  
  
  Ready to get a project started? Here's your task
&lt;/h1&gt;

&lt;p&gt;In the previous sections, we implemented our first Flask application (i.e. Hello World), learned how to create static  URL routes, and how to bind them to views. Using this information, we will now start building a real-world application.&lt;/p&gt;

&lt;p&gt;The application we'll be building is an animal rescue website called “Paws Rescue Center”. Let’s start to create an application with a Home page and About page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problem statement&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this challenge, we will implement the views for the ‘home’ and ‘about’ pages of the application.&lt;br&gt;
1) The URL routes for both views should be user-friendly.&lt;br&gt;
2) The home page should output the string: &lt;code&gt;"Paws Rescue Center 🐾"&lt;/code&gt;.&lt;br&gt;
3) The about function should output the following line: &lt;code&gt;"We are a non-profit organization working as an animal rescue. We aim to help you connect with the purrfect furbaby for you! The animals you find on our website are rescued and rehabilitated animals. Our mission is to promote the ideology "adopt, don't Shop"! "&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Home page expected output&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjoju3bk5bjbpdx7v6k80.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjoju3bk5bjbpdx7v6k80.png" alt="Alt Text" width="800" height="286"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;About page expected output&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmpnq9gh4fwc6zlktqv4v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmpnq9gh4fwc6zlktqv4v.png" alt="Alt Text" width="800" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's the complete implementation for the start of this project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"""Flask Application for Paws Rescue Center."""
from flask import Flask
app = Flask(__name__)

@app.route("/")
def homepage():
    """View function for Home Page."""
    return "Paws Rescue Center 🐾"

@app.route("/about")
def about():
    """View function for About Page."""
    return """We are a non-profit organization working as an animal rescue center. 
    We aim to help you connect with the purrfect furbaby for you! 
    The animals you find at our website are rescue animals which have been rehabilitated. 
    Our mission is to promote the ideology of "Adopt, don't Shop"! """


if __name__ == "__main__":
    app.run(debug=True, host="0.0.0.0", port=3000)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This challenge was meant to get us started with development with the Flask framework. Let’s break down the solution and analyze it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Home page
&lt;/h2&gt;

&lt;p&gt;First, let us take a look at the solution for the home page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;URL route&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We want the home page to be the first landing page of the website, therefore, using the route &lt;code&gt;"/"&lt;/code&gt; makes the most sense, as shown in &lt;strong&gt;line #5&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The string, &lt;code&gt;"Paws Rescue Center 🐾"&lt;/code&gt;, was provided in the challenge as the required output. All we had to do was to return this string in the view function. This can be found on &lt;strong&gt;line #8&lt;/strong&gt; in the solution shown above.&lt;/p&gt;

&lt;h2&gt;
  
  
  About page
&lt;/h2&gt;

&lt;p&gt;Next, for the about page, the following features were implemented.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;URL route&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The most obvious and user-friendly URL route for the about page is &lt;code&gt;"/about"&lt;/code&gt; (referring to &lt;strong&gt;line #10&lt;/strong&gt; in the solution).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The output string provided in the problem statement is returned in &lt;strong&gt;lines #13-16&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;There is still a lot to do to make this a finished product,  but here's what it looks like when you're all finished. If you'd like to continue working on this project with a step-by-step guide you can visit &lt;a href="https://www.educative.io/courses/flask-develop-web-applications-in-python" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw30jbm355nf1ou0hdd3k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw30jbm355nf1ou0hdd3k.png" alt="Alt Text" width="800" height="439"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  What’s next?
&lt;/h1&gt;

&lt;p&gt;Congrats! You’ve learned how to create your first Flask application and started your first project. There is still much to learn though like static and dynamic templates, form handling, connecting to a database with SQLAlchemy, and the different operations you can perform on models (i.e. insertion, retrieval, etc.).&lt;/p&gt;

&lt;p&gt;If you have any interest in developing web apps with Flask, I highly recommend this project-based course, &lt;a href="https://www.educative.io/courses/flask-develop-web-applications-in-python" rel="noopener noreferrer"&gt;Flask: Developing Web Applications in Python&lt;/a&gt;. You’ll explore everything that’s mentioned above (static/dynamic templates, form handling, etc.) and the rewarding part is that you get to work on and finish the project you just started, which you can then add to your portfolio. &lt;/p&gt;

&lt;p&gt;Why continue to learn the Flask framework? It’s a very valuable skill if you’re hoping to pursue a full stack developer position. Full stack developers are in high demand because of their ability to contribute across the board. This is a great opportunity to further explore both sides of development, which in turn can make you a more richly compensated developer.&lt;/p&gt;

</description>
      <category>python</category>
      <category>webdev</category>
      <category>tutorial</category>
      <category>flask</category>
    </item>
    <item>
      <title>4 Flexbox tricks you must know</title>
      <dc:creator>Cameron Wilson</dc:creator>
      <pubDate>Sat, 04 Jan 2020 02:05:48 +0000</pubDate>
      <link>https://dev.to/educative/4-flexbox-tricks-you-must-know-4904</link>
      <guid>https://dev.to/educative/4-flexbox-tricks-you-must-know-4904</guid>
      <description>&lt;p&gt;&lt;em&gt;For an interactive tutorial, visit &lt;a href="https://www.educative.io/page/5191711974227968/5754903989321728" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you've been trying to get a grip on Flexbox - here's a practical tutorial for you. No crap, no fluffs, just the very important practical tricks you need to know.&lt;/p&gt;

&lt;h1&gt;
  
  
  1. How to perfectly center an element
&lt;/h1&gt;

&lt;p&gt;The first thing that comes to mind here may be, “hey, that’s so simple to achieve”. But is it?&lt;/p&gt;

&lt;p&gt;Consider the Markup below.&lt;/p&gt;

&lt;p&gt;Pretty simple. It’s essentially just placing an image into a document.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!doctype html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;img src="https://media.giphy.com/media/JIX9t2j0ZTN9S/giphy.gif" width="200px" /&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No one loves ugly designs. So we’ll go ahead and give the entire document a &lt;code&gt;backgound-color&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body {
  background-color: #f1c40f;
}  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Below is what we have now.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HTML&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!doctype html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;Centering with Flexbox&amp;lt;/title&amp;gt;
  &amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;img src="https://media.giphy.com/media/JIX9t2j0ZTN9S/giphy.gif" width="200px" /&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;CSS&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;html,
body {
    width: 100%;
  height: 100%;
}
body {
  margin: 0;
  background-color: #f1c40f;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdusge5cp8pwdgdarprmi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdusge5cp8pwdgdarprmi.png" alt="Alt Text" width="590" height="246"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, let’s perfectly center the image to the center of the document.&lt;/p&gt;

&lt;p&gt;First step, make the &lt;code&gt;body&lt;/code&gt; element a flex-container.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body {
  display: flex
}    
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Simple enough. Now we may perfectly align the image.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body {
  display: flex;
  justify-content: center;
  align-items: center;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Voila! The image is now centered perfectly. In the code listing above, Lines &lt;code&gt;3&lt;/code&gt; and &lt;code&gt;4&lt;/code&gt; are the magic wands that make things happen.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1lm7bbv6ts7rttl0p5a2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1lm7bbv6ts7rttl0p5a2.png" alt="Alt Text" width="600" height="664"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now the image will be center-aligned.&lt;/p&gt;

&lt;p&gt;The complete code solution is seen below. If you'd like, you can play around with the code &lt;a href="https://www.educative.io/page/5191711974227968/5754903989321728" rel="noopener noreferrer"&gt;here&lt;/a&gt;. You can take away the highlighted lines, and see how they individually affect the display.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HTML&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!doctype html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;Perfeclty centered image&amp;lt;/title&amp;gt;
  &amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;img src="https://media.giphy.com/media/JIX9t2j0ZTN9S/giphy.gif" width="150px" /&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;CSS&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;html,
body {
    width: 100%;
  height: 100%;
}
body {
  margin: 0;
  display:flex;
  background-color: #f1c40f;
  justify-content: center;
  align-items: center;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  2. How to create sticky footers
&lt;/h1&gt;

&lt;p&gt;If you’ve written CSS for a while now, I’m certain you recognize this problem.&lt;/p&gt;

&lt;p&gt;It’s a pain in the neck to keep the footer of your page at the bottom of the page even when the page sparse content. Gladly, there is a solution with Flexbox.&lt;/p&gt;

&lt;p&gt;Consider the markup below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!doctype html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;Sticky footer&amp;lt;/title&amp;gt;
  &amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
  &amp;lt;header&amp;gt;&amp;lt;/header&amp;gt;
  &amp;lt;main&amp;gt;&amp;lt;/main&amp;gt;
  &amp;lt;footer&amp;gt;&amp;lt;/footer&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It’s a basic page setup with a &lt;code&gt;header&lt;/code&gt;, an area for the &lt;code&gt;main&lt;/code&gt; content, and a &lt;code&gt;footer&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So that each section of the page is distinguishable, let’s go ahead and give them different background colors.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;header {
  background-color: #27ae60;
}

main {
  background-color: #3498db;
}

footer {
  background-color: #c0392b;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now make certain that the body of the document fills the entire screen&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body {
  min-height: 100vh;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Technically, &lt;code&gt;line 2&lt;/code&gt; says, “make sure the minimum height (&lt;code&gt;min-height&lt;/code&gt;) of the body element is 100% of the viewport height (&lt;code&gt;vh&lt;/code&gt;)”&lt;/p&gt;

&lt;p&gt;The term viewport refers to the user’s visible area of a web page.&lt;/p&gt;

&lt;p&gt;Now let’s make make things happen&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the code above, &lt;code&gt;line 3&lt;/code&gt; initializes the flexbox model. And &lt;code&gt;line 4&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;Remember, the default value for &lt;code&gt;flex-direction&lt;/code&gt; is &lt;code&gt;row&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;flex-diection:column&lt;/code&gt; changes the direction from &lt;code&gt;horizontal&lt;/code&gt; to &lt;code&gt;vertical&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The children elements, &lt;code&gt;header&lt;/code&gt;, &lt;code&gt;main&lt;/code&gt; and &lt;code&gt;footer&lt;/code&gt; will now be aligned vertically&lt;/p&gt;

&lt;p&gt;Move on to the sweet spot. Give &lt;code&gt;footer&lt;/code&gt; and &lt;code&gt;header&lt;/code&gt; fixed heights.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;header, footer {
  height: 50px;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And finally, on to making the footer sticky.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;main {
  flex: 1 0 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I thought we were supposed to target the &lt;code&gt;footer&lt;/code&gt;, and not &lt;code&gt;main&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;Yes, but the way we make the footer sticky is by instructing the browser to make &lt;code&gt;main&lt;/code&gt; take the entire available space on the screen.&lt;/p&gt;

&lt;p&gt;This leaves &lt;code&gt;header&lt;/code&gt; and &lt;code&gt;footer&lt;/code&gt; to heights of their own, while &lt;code&gt;main&lt;/code&gt; grows to fit the available remaining space.&lt;/p&gt;

&lt;p&gt;If you remember, &lt;code&gt;flex: 1 0 0&lt;/code&gt; says, “grow the container to fit the entire available space, keep the initial width at zero, and don’t shrink the item too”&lt;/p&gt;

&lt;p&gt;Again, here’s the full code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HTML&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html lang="en"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;Sticky footer&amp;lt;/title&amp;gt;
  &amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
  &amp;lt;header&amp;gt;&amp;lt;/header&amp;gt;
  &amp;lt;main&amp;gt;&amp;lt;/main&amp;gt;
  &amp;lt;footer&amp;gt;&amp;lt;/footer&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;CSS&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;header {
  background-color: #27ae60;
}

main {
  background-color: #3498db;
}

footer {
  background-color: #c0392b;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header, footer {
  height: 50px;
}
main {
  flex: 1 0 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;JavaScript&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$(document).ready(function () {
$('#content').html('&amp;lt;span&amp;gt;Hello World!&amp;lt;/span&amp;gt;');
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu507n41inqxkg45p7ovs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu507n41inqxkg45p7ovs.png" alt="Alt Text" width="800" height="139"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  3. How to create basic grids with Flexbox
&lt;/h1&gt;

&lt;p&gt;User Interfaces get complex. Chances are you’ll someday be needed to create sections with varying widths.&lt;/p&gt;

&lt;p&gt;Examples of this include, pages with multiple column layouts such as the 2 column layout below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4869n4s77sq8akidhiox.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4869n4s77sq8akidhiox.png" alt="Alt Text" width="800" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Consider the basic setup below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html lang="en"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;2 column layout&amp;lt;/title&amp;gt;
  &amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
  &amp;lt;aside&amp;gt;&amp;lt;/aside&amp;gt;
  &amp;lt;main&amp;gt;&amp;lt;/main&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, we have an &lt;code&gt;aside&lt;/code&gt; and a &lt;code&gt;main&lt;/code&gt; tag. The &lt;code&gt;aside&lt;/code&gt; will contain sidebar elements while the &lt;code&gt;main&lt;/code&gt; tag will house the major contents of the page.&lt;/p&gt;

&lt;p&gt;To begin solving this problem, as always, make &lt;code&gt;body&lt;/code&gt; a flex container.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body {
  display: flex;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let &lt;code&gt;body&lt;/code&gt; fill up the user’s viewport&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body {
  min-height: 100vh;
  display: flex; 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On to the sweet spot of the solution.&lt;/p&gt;

&lt;p&gt;Specify the widths of both &lt;code&gt;aside&lt;/code&gt; and &lt;code&gt;main&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aside {
  background-color: #2c3e50;
  width: 200px;
}

main {
  background-color: #c0392b;
  flex: 1 0 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Line 3&lt;/code&gt; sets the width of the sidebar section to &lt;code&gt;200px&lt;/code&gt;. Easy enough.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Line 8&lt;/code&gt; sets the &lt;code&gt;main&lt;/code&gt; section to take up the remaining space available (i.e the entire space available minus &lt;code&gt;200px&lt;/code&gt;)&lt;/p&gt;

&lt;p&gt;Remember that &lt;code&gt;flex: 1 0 0&lt;/code&gt; says “grow to fit the available space, DON’T shrink, and have an iniial width of zero”&lt;/p&gt;

&lt;p&gt;Here’s all the code in action, with the result below too.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HTML&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html lang="en"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;2 column layout&amp;lt;/title&amp;gt;
  &amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
  &amp;lt;aside&amp;gt;&amp;lt;/aside&amp;gt;
  &amp;lt;main&amp;gt;&amp;lt;/main&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;CSS&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body {
  height: 100vh;
  margin: 0;
  display: flex;
}

aside {
  background-color: #2c3e50;
  width: 200px;
}

main {
  background-color: #c0392b;
  flex: 1 0 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5pc8g3ortqlg6a2u20io.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5pc8g3ortqlg6a2u20io.png" alt="Alt Text" width="800" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As always, you’ve NOT mastered the concept until you &lt;a href="https://www.educative.io/page/5191711974227968/5754903989321728" rel="noopener noreferrer"&gt;toy with the code&lt;/a&gt;. Please do!&lt;/p&gt;

&lt;h1&gt;
  
  
  4. How to create media objects with Flexbox
&lt;/h1&gt;

&lt;p&gt;What is a media object?&lt;/p&gt;

&lt;p&gt;To be honest, I’m not sure I have a very technical answer to that. However, below is an example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqes6k5rivld3e51jxws1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqes6k5rivld3e51jxws1.png" alt="Alt Text" width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, is it just a bunch of texts with an image side by side?&lt;/p&gt;

&lt;p&gt;Well, sort of.&lt;/p&gt;

&lt;p&gt;Don’t be quick to judge though. You’d be surprised how many sites implement this. For instance, take a look at a regular tweet:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv5l090vs75fpbor0s2s8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv5l090vs75fpbor0s2s8.png" alt="Alt Text" width="800" height="579"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What do you see? A media object!&lt;/p&gt;

&lt;p&gt;Let’s build one with Flexbox.&lt;/p&gt;

&lt;p&gt;Consider the basic markup below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html lang="en"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;Media object with Flexbox&amp;lt;/title&amp;gt;
  &amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;img src="https://media.giphy.com/media/JIX9t2j0ZTN9S/giphy.gif" width="200px" /&amp;gt;
  &amp;lt;main&amp;gt;
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi.
  &amp;lt;/main&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, we have our basic setup with an image and a main content area.&lt;/p&gt;

&lt;p&gt;This is what that looks like now:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HTML&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html lang="en"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;Media object with Flexbox&amp;lt;/title&amp;gt;
  &amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;img src="https://media.giphy.com/media/JIX9t2j0ZTN9S/giphy.gif" width="200px" /&amp;gt;
  &amp;lt;main&amp;gt;
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi.
  &amp;lt;/main&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu4zplt5am1991e70l66u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu4zplt5am1991e70l66u.png" alt="Alt Text" width="558" height="704"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Initiate the Flexbox model by making &lt;code&gt;body&lt;/code&gt; a flex-container.&lt;/p&gt;

&lt;p&gt;Here’s the result of that:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HTML&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html lang="en"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;Media object with Flexbox&amp;lt;/title&amp;gt;
  &amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;img src="https://media.giphy.com/media/JIX9t2j0ZTN9S/giphy.gif" width="200px" /&amp;gt;
  &amp;lt;main&amp;gt;
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi.
  &amp;lt;/main&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;CSS&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body {
  display: flex;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkpd6ckn7bboy682e4fv1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkpd6ckn7bboy682e4fv1.png" alt="Alt Text" width="574" height="784"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yeah - that looks horrible.&lt;/p&gt;

&lt;p&gt;The image is stretched to fit the vertical axis. This is because by default, &lt;code&gt;align-items&lt;/code&gt; is set to &lt;code&gt;stretch&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Let’s change that.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HMTL&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html lang="en"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;Media object with Flexbox&amp;lt;/title&amp;gt;
  &amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;img src="https://media.giphy.com/media/JIX9t2j0ZTN9S/giphy.gif" width="100px" /&amp;gt;
  &amp;lt;main&amp;gt;
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi.
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi.
  &amp;lt;/main&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;CSS&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body {
  display: flex;
  align-items: flex-start;
  background-color: #8cacea;
  color: #fff;
}

img {
  margin-right: 1em;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9o7983m2gwvquyp5amzz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9o7983m2gwvquyp5amzz.png" alt="Alt Text" width="588" height="776"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we have our media object - perfect aligned. You may have noticed I put in some color there.&lt;/p&gt;

&lt;p&gt;As always, you’ve not mastered the concept until you toy with the codes. That’s the whole point of this interactive article.&lt;/p&gt;

&lt;p&gt;Please go back and make sure you subtract, add and play around the code - you can do anything!&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;I’m really glad you not only began this tutorial, but have completed it!&lt;/p&gt;

&lt;p&gt;So what are you going to do now?&lt;/p&gt;

&lt;p&gt;Be sure to go over the code, master it and go build some incredible UIs!&lt;/p&gt;

&lt;p&gt;Over time, you’ll come to see how helpful these tricks are. Happy learning!&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Exploring Data Science with Microsoft's Applied AI Engineer</title>
      <dc:creator>Cameron Wilson</dc:creator>
      <pubDate>Fri, 20 Dec 2019 00:52:58 +0000</pubDate>
      <link>https://dev.to/educative/exploring-data-science-with-microsoft-s-applied-ai-engineer-153p</link>
      <guid>https://dev.to/educative/exploring-data-science-with-microsoft-s-applied-ai-engineer-153p</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally posted on &lt;a href="https://www.educative.io/" rel="noopener noreferrer"&gt;Educative.io&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;At Educative, we get to chat with developers from all over the world, get to know their story, who they are, and what inspired them to become developers and teach those around them. Today, we sat down with &lt;a href="https://www.educative.io/profile/view/4747639511842816" rel="noopener noreferrer"&gt;Samia Khalid&lt;/a&gt; and got to learn more about her career and the exciting world of data science, applied AI, and machine learning.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;About: Samia Khalid&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvngxt4h9b7r9u10h7ynz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvngxt4h9b7r9u10h7ynz.png" alt="Alt Text" width="252" height="256"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Samia is a Sr. Applied AI Engineer at Microsoft. She is working with large-scale distributed systems to power new intelligent experiences in Office 365 and Outlook. She believes that learning should be easy, fun and intuitive. Seeing the challenges faced by her friends and colleagues in learning data science and machine learning led her to start her own machine learning blog as well (towardsml.com). She is passionate about education and sharing what she learns to pave the way for others.&lt;/p&gt;

&lt;p&gt;In her free time, she can be found blogging about Machine Learning, leading women empowerment efforts, at the gym, learning some new skill, or around the world trying out some crazy adventure!&lt;/p&gt;

&lt;p&gt;Samia Khalid is the creator of our latest course, &lt;a href="https://www.educative.io/courses/grokking-data-science" rel="noopener noreferrer"&gt;Grokking Data Science&lt;/a&gt;.&lt;/p&gt;



&lt;h1&gt;
  
  
  Tell me a little about yourself. How did you get your start in programming and what led to your love of data science and machine learning?
&lt;/h1&gt;

&lt;p&gt;When I first learned about Machine Learning, I was totally awestruck. It seemed like a magic wand that can help us answer questions to many complex problems. And the best thing is that it has so many diverse applications – from cancer treatments to flying rockets to providing movie recommendations to predicting earthquakes, we are just bound by our creativity! No matter which field you are interested in, it’s waiting for you to create some magic. Isn’t this fascinating?! I really believe that with a sprinkle of creativity, some data skills, and the willingness to make a difference, we can make this world a better place for everyone.&lt;/p&gt;

&lt;p&gt;I got the first real taste of Data Science and Machine Learning during my Master thesis project. I worked on predictive vehicle maintenance of heavy vehicles at Scania. During that time, I learned hands-on that data has so much potential. And then as I kept diving deeper and deeper into the field, my fascination has just kept on increasing.&lt;/p&gt;



&lt;h1&gt;
  
  
  What exciting projects are you getting to work on at Microsoft? What problems are these projects designed to solve?
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx98gghpyztakikqlprh8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx98gghpyztakikqlprh8.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am working with large-scale distributed systems to power new intelligent experiences in Office 365 and Outlook. Some of the problems I get to address are, for example, “How can we infuse intelligence into our existing tech stack?” or “How can we make our current experiences more and more personalized?”&lt;/p&gt;



&lt;h1&gt;
  
  
  Could you go into a little detail on what Applied AI is and what problems are being solved in this space?
&lt;/h1&gt;

&lt;p&gt;My day to day job revolves around contributing to Microsoft’s next wave of AI driven productivity solutions based on our strategic advantage of having tons of enterprise data. This is an already hard problem, but to make things even more exciting, we have an additional challenge on top of an already hard problem. We ensure that our solutions are compliant and that we are giving utmost importance to our users’ privacy.&lt;/p&gt;

&lt;p&gt;Basically, I deal with the practical aspects of AI. For example, while an AI researcher’s job might be to come up with new language models, my job is to experiment with them to create deeply personalized experiences.&lt;/p&gt;



&lt;h1&gt;
  
  
  What is one tip you’d give to someone who’s starting their career in data science?
&lt;/h1&gt;

&lt;p&gt;Always keep learning!&lt;/p&gt;



&lt;h1&gt;
  
  
  Where do you see the field of machine learning and AI going over the next 5-10 years?
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7qv7shkmj1usa7uow1bs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7qv7shkmj1usa7uow1bs.png" alt="Alt Text" width="800" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Companies will be increasingly wrestling with data in varieties and volumes never encountered before. This means they will be needing more and more professionals who can dive into those “data oceans” to extract pearls from their depths – reason why data scientists are going to keep on becoming the most sought out breed of professionals.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ML and AI have tremendous potential for value creation. The return on investment is really high, so large companies are already investing heavily in democratizing AI and they are going to double down on their efforts in the coming years. This is to ensure that the barrier to entry in this field is reduced. People with the right drive to create great things can come from diverse backgrounds and they do not need to know all the nitty gritty details of AI. For example, from floor lamps to lighting in the oven, you can create great things with a light bulb. But do you really need to know how does a bulb operate in order to do so? Nope.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;One more really important thing that I want to mention is that “party” with the data but do NOT forget about privacy because the future is privacy + AI/ML.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;



&lt;h1&gt;
  
  
  What is the biggest hurdle developers should be aware of when they start their data science career?
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frq7dct053melql3v7zt9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frq7dct053melql3v7zt9.png" alt="Alt Text" width="800" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every other person is trying to put together the pieces of the puzzle that can land them the hottest job of the century. I mean who doesn’t want to be the most sought out professional in the industry. There are tons of data science resources out there too. Still not many succeed. Why?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Information overload&lt;/li&gt;
&lt;li&gt;Siloed resources&lt;/li&gt;
&lt;li&gt;Non-methodical approach&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There is so much information. But chances are that either it’s written as if for an academic publication – “I need to understand a concept and not do research on the topic. Keep it simple and intuitive!” – or just for the sake of writing that article with some fancy jargon thrown here and there. You know how many articles I had to read before understanding something simple like p-value in an intuitive way?&lt;/p&gt;

&lt;p&gt;Of course there are many excellent resources as well. But the problem there is of siloed information – one ends up wasting too much time browsing from one article to another. Having all the relevant information in one place makes the learning curve wayy faster.&lt;/p&gt;



&lt;h1&gt;
  
  
  What has inspired you to teach those around you?
&lt;/h1&gt;

&lt;p&gt;Many of my friends and colleagues have been either trying to learn Machine Learning/Data Science or are planning to start doing so. What I have observed from the challenges they have been facing is that there are so many great resources out there but, most often than not, their explanations tend to be too academic or theoretical, which can be intimidating for starters. So I asked myself, “What am I doing to help out?” This introspection led me to start my own blog, but a practical and ‘inspire to make a difference’ blog!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The practical part:&lt;/strong&gt; I want to share what I learn and what I have learned so far. Basically, I want them to save time in figuring out things where I have already spent hours and hours. Also, as the famous saying goes: “The best way to learn is to teach”.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The inspiring part:&lt;/strong&gt; Machine Learning can be applied to solve so many real-world problems; it can be used as a tool that can help change lives in a positive way. I want to highlight inspiring positive developments because, I will say this again, I really believe that with a sprinkle of creativity, some data skills, and the willingness to make a difference, we can make this world a better place for everyone.&lt;/p&gt;



&lt;h1&gt;
  
  
  “Don’t try to learn everything!”. What are the fundamental skills and technologies that one should be familiar with before they start applying for data science jobs? What can they learn on the job?
&lt;/h1&gt;

&lt;p&gt;Having a strong foundation is fundamental. If you have the basics covered, you can keep adding the rest along the way. Think about buildings. If a building has strong foundations, we can keep adding more stories to it. But if the foundations are weak then we can’t keep on building on top of it.&lt;/p&gt;



&lt;h1&gt;
  
  
  When starting your data science journey, you found a lot of the info out there to be too abstract and wanted to make it more accessible. Why is it important to make this material more accessible to more people?
&lt;/h1&gt;

&lt;p&gt;I love learning and then I love sharing what I learn in a way that makes it easier for the next person in line. Helping others and giving back brings true fulfillment in life.&lt;/p&gt;



&lt;h1&gt;
  
  
  In your course Grokking Data Science, could you explain why you chose the material to include and what material is not included that aspiring data scientists should explore further?
&lt;/h1&gt;

&lt;p&gt;This course covers the fundamentals for you to kick-start your journey in the Data Science world. Definitely, it’s not “everything” you need to know about DS (that’s not even possible). The field of DS is very new and rapidly evolving. New cool and simplified APIs, models, and approaches are being introduced “every other day”. The goal with this course is to give you a strong foundation. From here onward it’s about diving into the more advanced concepts, getting your hands dirty with real projects and learnings along the way. I have also included some recommendations in the “Further Study material” and “Getting that high-paying job” sections at the end of the course.&lt;/p&gt;

&lt;p&gt;Here are two things that I really want my students to remember as they continue on their journey as a Data Scientist:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;“The path to becoming a great Data Scientist is not a sprint, but a marathon.”&lt;/li&gt;
&lt;li&gt;“Don’t’ be a know-it all; be a learn-it-all.”&lt;/li&gt;
&lt;/ol&gt;



&lt;h1&gt;
  
  
  What’s next? Keep learning
&lt;/h1&gt;

&lt;p&gt;A career in data science requires constant learning, but it you’ll also need to focus your time and energy on the right material, especially if you want to kickstart your data science career as fast as possible.&lt;/p&gt;

&lt;p&gt;Samia has taken her years of industry knowledge and condensed in a comprehensive course, &lt;a href="https://www.educative.io/courses/grokking-data-science" rel="noopener noreferrer"&gt;Grokking Data Science&lt;/a&gt;. This is the core material you’ll need to learn to start your career in data science.&lt;/p&gt;

&lt;p&gt;You’ll explore concepts like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Python fundamentals for data science&lt;/li&gt;
&lt;li&gt;The fundamentals of statistics&lt;/li&gt;
&lt;li&gt;Machine learning 101&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Where at the end you’ll get to work on end-to-end machine learning projects.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.educative.io/courses/grokking-data-science" rel="noopener noreferrer"&gt;Try a free preview today&lt;/a&gt;&lt;/p&gt;

</description>
      <category>techtalks</category>
      <category>machinelearning</category>
      <category>career</category>
    </item>
    <item>
      <title>Bash cheat sheet: Top 25 commands and creating custom commands</title>
      <dc:creator>Cameron Wilson</dc:creator>
      <pubDate>Tue, 03 Dec 2019 20:14:39 +0000</pubDate>
      <link>https://dev.to/educative/bash-cheat-sheet-top-25-commands-and-creating-custom-commands-49a7</link>
      <guid>https://dev.to/educative/bash-cheat-sheet-top-25-commands-and-creating-custom-commands-49a7</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally posted on &lt;a href="https://www.educative.io" rel="noopener noreferrer"&gt;Educative.io&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The command line is something every developer should learn and implement into their daily routine. It has become a Swiss Army knife of features behind deceptively simple commands which allow you to gain greater control of your system, become more productive, and much more. For example, you can write scripts to automate daily, time-consuming tasks, and even quickly commit and push code to a Git repository with just a few simple commands.&lt;/p&gt;

&lt;p&gt;In this post we’ll look at the Bash Shell (&lt;strong&gt;B&lt;/strong&gt;ourne &lt;strong&gt;A&lt;/strong&gt;gain &lt;strong&gt;SH&lt;/strong&gt;ell), which is a command-line interface (CLI) and is currently the most widely used shell. This is a light introduction into the most popular commands, when you’re most likely to use them, and how to extend them with options. Later on in this article, you’ll learn how to create your own custom commands (aliases), allowing you to create shortcuts for a single command or a group of commands.&lt;/p&gt;

&lt;p&gt;When it comes down to it, if you don’t know the command line, you’re not using your computer to its full potential. &lt;a href="https://www.educative.io/courses/master-the-bash-shell" rel="noopener noreferrer"&gt;Master the Bash Shell&lt;/a&gt; today with the help of &lt;strong&gt;Ian Miell&lt;/strong&gt;, author of &lt;em&gt;Learn Bash the Hard Way&lt;/em&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Top 25 Bash Commands
&lt;/h1&gt;

&lt;p&gt;Quick note: Anything encased in [ ] means that it's optional. Some commands can be used without options or specifying files. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. ls — List directory contents&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ls&lt;/code&gt; is probably the most common command. A lot of times, you’ll be working in a directory and you’ll need to know what files are located there. The ls command allows you to quickly view all files within the specified directory. &lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;ls&lt;/code&gt; [option(s)] [file(s)]&lt;/p&gt;

&lt;p&gt;Common options: -a, -l &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. echo — Prints text to the terminal window&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;echo&lt;/code&gt; prints text to the terminal window and is typically used in shell scripts and batch files to output status text to the screen or a computer file. Echo is also particularly useful for showing the values of environmental variables, which tell the shell how to behave as a user works at the command line or in scripts.&lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;echo&lt;/code&gt; [option(s)] [string(s)]&lt;/p&gt;

&lt;p&gt;Common options: -e, -n&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. touch — Creates a file&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;touch&lt;/code&gt; is going to be the easiest way to create new files, but it can also be used to change timestamps on files and/or directories. You can create as many files as you want in a single command without worrying about overwriting files with the same name.&lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;touch&lt;/code&gt; [option(s)] file_name(s)&lt;/p&gt;

&lt;p&gt;Common options: -a, -m, -r, -d&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. mkdir — Create a directory&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mkdir&lt;/code&gt; is a useful command you can use to create directories. Any number of directories can be created simultaneously which can greatly speed up the process. &lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;mkdir&lt;/code&gt; [option(s)] directory_name(s)&lt;/p&gt;

&lt;p&gt;Common options: -m, -p, -v&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. grep — search&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;grep&lt;/code&gt; is used to search text for patterns specified by the user. It is one of the most useful and powerful commands. There are often scenarios where you’ll be tasked to find a particular string or pattern within a file, but you don’t know where to start looking, that is where grep is extremely useful.&lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;grep&lt;/code&gt; [option(s)] pattern [file(s)]&lt;/p&gt;

&lt;p&gt;Common options: -i, -c, -n&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. man — Print manual or get help for a command&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;man&lt;/code&gt; command is your manual and is very useful when you need to figure out what a command does. For example, if you didn’t know what the command rmdir does, you could use the man command to find that out.&lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;man&lt;/code&gt; [option(s)] keyword(s)&lt;/p&gt;

&lt;p&gt;Common options: -w, -f, -b&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. pwd — Print working directory&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pwd&lt;/code&gt; is used to print the current directory you’re in. As an example, if you have multiple terminals going and you need to remember the exact directory you’re working within, then pwd will tell you.&lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;pwd&lt;/code&gt; [option(s)]&lt;/p&gt;

&lt;p&gt;Common options: options aren’t typically used with pwd&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. cd — Change directory&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd&lt;/code&gt; will change the directory you’re in so that you can get info, manipulate, read, etc. the different files and directories in your system.&lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;cd&lt;/code&gt; [option(s)] directory&lt;/p&gt;

&lt;p&gt;Common options: options aren’t typically used with cd&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. mv — Move or rename directory&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mv&lt;/code&gt; is used to move or rename directories. Without this command, you would have to individually rename each file which is tedious. &lt;code&gt;mv&lt;/code&gt; allows you to do batch file renaming which can save you loads of time.&lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;mv&lt;/code&gt; [option(s)] argument(s)&lt;/p&gt;

&lt;p&gt;Common options: -i, -b &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. rmdir — Remove directory&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rmdir&lt;/code&gt; will remove empty directories. This can help clean up space on your computer and keep files and folders organized. It’s important to note that there are two ways to remove directories: rm and rmdir. The distinction between the two is that rmdir will only delete empty directories, whereas rm will remove directories and files regardless if they contain data or not. &lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;rmdir&lt;/code&gt; [option(s)] directory_names&lt;/p&gt;

&lt;p&gt;Common options: -p&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11. locate — Locate a specific file or directory&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is by far the simplest way to find a file or directory. You can keep your search broad if you don’t know what exactly it is you’re looking for, or you can narrow the scope by using wildcards or regular expressions.&lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;locate&lt;/code&gt; [option(s)] file_name(s)&lt;/p&gt;

&lt;p&gt;Common options: -q, -n, -i&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;12. less — view the contents of a text file&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;less&lt;/code&gt; command allows you to view files without opening an editor. It’s faster to use, and there’s no chance of you inadvertently modifying the file.&lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;less&lt;/code&gt; file_name&lt;/p&gt;

&lt;p&gt;Common options: -e, -f, -n&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;13. compgen — Shows all available commands, aliases, and functions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;compgen&lt;/code&gt; is a handy command when you need to reference all available commands, aliases, and functions.&lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;compgen&lt;/code&gt; [option(s)]&lt;/p&gt;

&lt;p&gt;Common options: -a, -c, -d&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;14. &amp;gt; — redirect stdout&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;&amp;gt;&lt;/code&gt; character is the redirect operator. This takes the output from the preceding command that you’d normally see in the terminal and sends it to a file that you give it. As an example, take echo "contents of file1" &amp;gt; file1. Here it creates a file called file1 and puts the echoed string into it. &lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Common options: n/a&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;15. cat — Read a file, create a file, and concatenate files&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cat&lt;/code&gt; is one of the more versatile commands and serves three main functions: displaying them, combining copies of them, and creating new ones.&lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;cat&lt;/code&gt; [option(s)] [file_name(s)] [-] [file_name(s)]&lt;/p&gt;

&lt;p&gt;Common options: -n&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;16. | — Pipe&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A pipe takes the standard output of one command and passes it as the input to another.&lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;|&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Common options: n/a &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;17. head — Read the start of a file&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By default, the &lt;code&gt;head&lt;/code&gt; command displays the first 10 lines of a file. There are times when you may need to quickly look at a few lines in a file and head allows you to do that. A typical example of when you’d want to use head is when you need to analyze logs or text files that change frequently.&lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;head&lt;/code&gt; [option(s)] file(s)&lt;/p&gt;

&lt;p&gt;Common options: -n&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;18. tail — Read the end of a file&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By default, the &lt;code&gt;tail&lt;/code&gt; command displays the last 10 lines of a file. There are times when you may need to quickly look at a few lines in a file and tail allows you to do that. A typical example of when you’d want to use tail is when you need to analyze logs or text files that change frequently. &lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;tail&lt;/code&gt; [option(s)] file_names&lt;/p&gt;

&lt;p&gt;Common options: -n&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;19. chmod — Sets the file permissions flag on a file or folder&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are situations that you’ll come across where you or a colleague will try to upload a file or modify a document and you receive an error because you don’t have access. The quick fix for this is to use &lt;code&gt;chmod&lt;/code&gt;. Permissions can be set with either alphanumeric characters (u, g, o) and can be assigned their access with w, r, x. Conversely, you can also use octal numbers (0-7) to change the permissions. For example, &lt;code&gt;chmod&lt;/code&gt; 777 &lt;code&gt;my_file&lt;/code&gt; will give access to everyone.  &lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;chmod&lt;/code&gt; [option(s)] permissions file_name&lt;/p&gt;

&lt;p&gt;Common options: -f, -v&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;20. exit — Exit out of a directory&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;exit&lt;/code&gt; command will close a terminal window, end the execution of a shell script, or log you out of an SSH remote access session.&lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;exit&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Common options: n/a&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;21. history — list your most recent commands&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An important command when you need to quickly identify past commands that you’ve used.&lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;history&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Common options: -c, -d&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;22. clear — Clear your terminal window&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This command is used to clear all previous commands and output from consoles and terminal windows. This keeps your terminal clean and removes the clutter so you can focus on subsequent commands and their output.&lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;clear&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Common options: n/a&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;23. cp — copy files and directories&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use this command when you need to back up your files.  &lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;cp&lt;/code&gt; [option(s)] current_name new_name&lt;/p&gt;

&lt;p&gt;Common options: -r, -i, -b&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;24. kill — terminate stalled processes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;kill&lt;/code&gt; command allows you to terminate a process from the command line. You do this by providing the process ID (PID) of the process to kill. To find the PID, you can use the ps command accompanied by options -aux.&lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;kill&lt;/code&gt; [signal or option(s)] PID(s)&lt;/p&gt;

&lt;p&gt;Common options: -p&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;25. sleep — delay a process for a specified amount of time&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sleep&lt;/code&gt; is a common command for controlling jobs and is mainly used in shell scripts. You’ll notice in the syntax that there is a suffix; the suffix is used to specify the unit of time whether it be s (seconds), m (minutes), or d (days). The default unit of time is seconds unless specified.&lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;sleep&lt;/code&gt; number [suffix]&lt;/p&gt;

&lt;p&gt;Common options: n/a&lt;/p&gt;



&lt;h1&gt;
  
  
  How to create your own custom Bash commands
&lt;/h1&gt;

&lt;p&gt;Custom commands in Bash are known as “aliases”. Aliases are essentially an abbreviation, or a means to avoid typing a long command sequence. They can save a great deal of typing at the command line so you can avoid having to remember complex combinations of commands and options. There is one caveat to using aliases, and that is to be sure you don’t overwrite any keywords.&lt;/p&gt;

&lt;p&gt;Syntax: &lt;code&gt;alias&lt;/code&gt; alias_name = “command_to_run”&lt;/p&gt;

&lt;p&gt;A very simple example would look like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;alias&lt;/code&gt; c = “clear”&lt;/p&gt;

&lt;p&gt;Now every time you want to clear the screen, instead of typing in “clear”, you can just type ‘c’ and you’ll be good to go.&lt;/p&gt;

&lt;p&gt;You can also get more complicated, such as if you wanted to set up a web server in a folder:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;alias&lt;/code&gt; www = 'python -m SimpleHTTPServer 8000'&lt;/p&gt;

&lt;p&gt;Here's an example of a useful alias for when you need to test a website in different web browsers:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;alias&lt;/code&gt; ff4 = '/opt/firefox/firefox'&lt;/p&gt;

&lt;p&gt;&lt;code&gt;alias&lt;/code&gt; ff13 = '/opt/firefox13/firefox'&lt;/p&gt;

&lt;p&gt;&lt;code&gt;alias&lt;/code&gt; chrome = '/opt/google/chrome/chrome'&lt;/p&gt;

&lt;p&gt;Apart from creating aliases that make use of one command, you can also use aliases to run multiple commands such as:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;alias&lt;/code&gt; name_goes_here = 'activator &amp;amp;&amp;amp; clean &amp;amp;&amp;amp; compile &amp;amp;&amp;amp; run'&lt;/p&gt;

&lt;p&gt;While you can use aliases to run multiple commands, it’s recommended that you use functions as they’re considerably more flexible and allow you to do more complex logic and are great for writing scripts. &lt;/p&gt;



&lt;h1&gt;
  
  
  Where to go from here
&lt;/h1&gt;

&lt;p&gt;Now that you’re armed with the top commands and how to customize them, you can put them into practice. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.educative.io/courses/master-the-bash-shell" rel="noopener noreferrer"&gt;Master the Bash Shell&lt;/a&gt; will give you an understanding of all the core concepts you need to gain complete control over your system. &lt;strong&gt;Ian Miell&lt;/strong&gt;, the author of &lt;em&gt;Learn Bash the Hard Way&lt;/em&gt;, created this course to teach you all the intricacies of Bash that took him decades to learn by trial and error.&lt;/p&gt;

&lt;p&gt;Happy learning!&lt;/p&gt;

</description>
      <category>bash</category>
    </item>
    <item>
      <title>Why (and when) you should use Kubernetes</title>
      <dc:creator>Cameron Wilson</dc:creator>
      <pubDate>Tue, 03 Dec 2019 01:03:42 +0000</pubDate>
      <link>https://dev.to/educative/why-and-when-you-should-use-kubernetes-2pil</link>
      <guid>https://dev.to/educative/why-and-when-you-should-use-kubernetes-2pil</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://medium.com/hackernoon/why-and-when-you-should-use-kubernetes-8b50915d97d8" rel="noopener noreferrer"&gt;Hackernoon&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Kubernetes is a powerful container management tool that automates the deployment and management of containers. Kubernetes (k8’s) is the next big wave in cloud computing and it’s easy to see why as businesses migrate their infrastructure and architecture to reflect a cloud-native, data-driven era. &lt;/p&gt;

&lt;p&gt;Whether you’re a developer, data scientist, product manager, or something else, it won't hurt to have a little Kubernetes knowledge in your back pocket. It's one of the most sought after skills by companies of all sizes, so if you're looking to gain a new skill that will stay with you throughout your career, then learning Kubernetes is a great option.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Getting started with Kubernetes? Try out the &lt;a href="https://www.educative.io/courses/practical-guide-to-kubernetes" rel="noopener noreferrer"&gt;Practical Guide to Kubernetes&lt;/a&gt; and start running production grade clusters.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Outlined in this post are some of the top reasons why you should use Kubernetes and when you should/shouldn’t use it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fokimsxpwiqxrfk5g6wmt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fokimsxpwiqxrfk5g6wmt.png" alt="Alt Text" width="800" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Container orchestration
&lt;/h2&gt;

&lt;p&gt;Containers are great. They provide you with an easy way to package and deploy services, allow for process isolation, immutability, efficient resource utilization, and are lightweight in creation.&lt;/p&gt;

&lt;p&gt;But when it comes to actually running containers in production, you can end up with dozens, even thousands of containers over time. These containers need to be deployed, managed, and connected and updated; if you were to do this manually, you’d need an entire team dedicated to this.&lt;/p&gt;

&lt;p&gt;It’s not enough to run containers; you need to be able to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Integrate and orchestrate these modular parts&lt;/li&gt;
&lt;li&gt;Scale up and scale down based on the demand&lt;/li&gt;
&lt;li&gt;Make them fault tolerant&lt;/li&gt;
&lt;li&gt;Provide communication across a cluster&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You might ask: aren’t containers supposed to do all that? The answer is that containers are only a low-level piece of the puzzle. The real benefits are obtained with tools that sit on top of containers — like Kubernetes. These tools are today known as container schedulers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Great for multi-cloud adoption
&lt;/h2&gt;

&lt;p&gt;With many of today’s businesses gearing towards microservice architecture, it’s no surprise that containers and the tools used to manage them have become so popular. Microservice architecture makes it easy to split your application into smaller components with containers that can then be run on different cloud environments, giving you the option to choose the best host for your needs. What’s great about Kubernetes is that it’s built to be used anywhere so you can deploy to public/private/hybrid clouds, enabling you to reach users where they’re at, with greater availability and security. You can see how Kubernetes can help you avoid potential hazards with “vendor lock-in”.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploy and update applications at scale for faster time-to-market
&lt;/h2&gt;

&lt;p&gt;Kubernetes allows teams to keep pace with the requirements of modern software development. Without Kubernetes, large teams would have to manually script their own deployment workflows. Containers, combined with an orchestration tool, provide management of machines and services for you — improving the reliability of your application while reducing the amount of time and resources spent on DevOps.&lt;br&gt;
Kubernetes has some great features that allow you to deploy applications faster with scalability in mind:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Horizontal infrastructure scaling:&lt;/strong&gt; New servers can be added or removed easily.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auto-scaling:&lt;/strong&gt; Automatically change the number of running containers, based on CPU utilization or other application-provided metrics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Manual scaling:&lt;/strong&gt; Manually scale the number of running containers through a command or the interface.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Replication controller:&lt;/strong&gt; The replication controller makes sure your cluster has an equal amount of pods running. If there are too many pods, the replication controller terminates the extra pods. If there are too few, it starts more pods.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Health checks and self-healing:&lt;/strong&gt; Kubernetes can check the health of nodes and containers ensuring your application doesn’t run into any failures. Kubernetes also offers self-healing and auto-replacement so you don’t need to worry about if a container or pod fails.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Traffic routing and load balancing:&lt;/strong&gt; Traffic routing sends requests to the appropriate containers. Kubernetes also comes with built-in load balancers so you can balance resources in order to respond to outages or periods of high traffic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automated rollouts and rollbacks:&lt;/strong&gt; Kubernetes handles rollouts for new versions or updates without downtime while monitoring the containers’ health. In case the rollout doesn’t go well, it automatically rolls back.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Canary Deployments:&lt;/strong&gt; Canary deployments enable you to test the new deployment in production in parallel with the previous version.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;“Before Kubernetes, our infrastructure was so antiquated it was taking us more than six months to deploy a new microservice. Today, a new microservice takes less than five days to deploy. And we’re working on getting it to an hour.” — Box&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Better management of your applications
&lt;/h2&gt;

&lt;p&gt;Containers allow applications to be broken down into smaller parts which can then be managed through an orchestration tool like Kubernetes. This makes it easy to manage codebases and test specific inputs and outputs.&lt;br&gt;
As mentioned earlier, Kubernetes has built-in features like self-healing and automated rollouts/rollbacks, effectively managing the containers for you.&lt;/p&gt;

&lt;p&gt;To go even further, Kubernetes allows for declarative expressions of the desired state as opposed to an execution of a deployment script, meaning that a scheduler can monitor a cluster and perform actions whenever the actual state does not match the desired. You can think of schedulers as operators who are continually monitoring the system and fixing discrepancies between the desired and actual state.&lt;/p&gt;

&lt;h2&gt;
  
  
  Overview/additional benefits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You can use it to deploy your services, to roll out new releases without downtime, and to scale (or de-scale) those services.&lt;/li&gt;
&lt;li&gt;It is portable.&lt;/li&gt;
&lt;li&gt;It can run on a public or private cloud.&lt;/li&gt;
&lt;li&gt;It can run on-premise or in a hybrid environment.&lt;/li&gt;
&lt;li&gt;You can move a Kubernetes cluster from one hosting vendor to another without changing (almost) any of the deployment and management processes.&lt;/li&gt;
&lt;li&gt;Kubernetes can be easily extended to serve nearly any needs. You can choose which modules you’ll use, and you can develop additional features yourself and plug them in.&lt;/li&gt;
&lt;li&gt;Kubernetes will decide where to run something and how to maintain the state you specify.&lt;/li&gt;
&lt;li&gt;Kubernetes can place replicas of service on the most appropriate server, restart them when needed, replicate them, and scale them.&lt;/li&gt;
&lt;li&gt;Self-healing is a feature included in its design from the start. On the other hand, self-adaptation is coming soon as well.&lt;/li&gt;
&lt;li&gt;Zero-downtime deployments, fault tolerance, high availability, scaling, scheduling, and self-healing add significant value in Kubernetes.&lt;/li&gt;
&lt;li&gt;You can use it to mount volumes for stateful applications.&lt;/li&gt;
&lt;li&gt;It allows you to store confidential information as secrets.&lt;/li&gt;
&lt;li&gt;You can use it to validate the health of your services.&lt;/li&gt;
&lt;li&gt;It can load balance requests and monitor resources.&lt;/li&gt;
&lt;li&gt;It provides service discovery and easy access to logs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxzl0u6liqpevdqg3jdvi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxzl0u6liqpevdqg3jdvi.png" alt="Alt Text" width="800" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  When you should use it
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;If your application uses a microservice architecture&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you have transitioned or are looking to transition to a microservice architecture then Kubernetes will suit you well because it’s likely you’re already using software like Docker to containerize your application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you’re suffering from slow development and deployment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you’re unable to meet customer demands due to slow development time, then Kubernetes might help. Rather than a team of developers spending their time wrapping their heads around the development and deployment lifecycle, Kubernetes (along with Docker) can effectively manage it for you so the team can spend their time on more meaningful work that gets products out the door.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Our internal teams have less of a need to focus on manual capacity provisioning and more time to focus on delivering features for Spotify.”—Spotify&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Lower infrastructure costs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Kubernetes uses an efficient resource management model at the container, pod, and cluster level, helping you lower cloud infrastructure costs by ensuring your clusters always have available resources for running applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  When you shouldn’t use it
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Simple, lightweight applications&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If your application makes use of a monolithic architecture it may be tough to see the real benefits of containers and a tool used to orchestrate them. That’s because the very nature of a monolithic architecture is to have every piece of the application intertwined — from IO to the data processing to rendering, whereas containers are used to separate your application into individual components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Culture doesn’t reflect the changes ahead&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Kubernetes notoriously has a steep learning curve, meaning you’ll be spending a good amount of time educating teams and addressing the challenges of a new solution, etc. If you don’t have a team that’s willing to experiment and take risks then it’s probably not the choice for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s next?
&lt;/h2&gt;

&lt;p&gt;Overall, Kubernetes boasts some pretty great features that can have a positive impact on your developing/DevOps teams and for the business as a whole. It is one of the most sought after skills by companies of all sizes, so if you're looking to gain a new skill that will stick with you throughout your career, then &lt;a href="https://www.educative.io/courses/practical-guide-to-kubernetes" rel="noopener noreferrer"&gt;learning Kubernetes&lt;/a&gt; is a great option. Our course was written by &lt;a href="https://www.educative.io/profile/view/4565842337464320" rel="noopener noreferrer"&gt;Viktor Farcic&lt;/a&gt;, a Developer Advocate at CloudBees, a member of the Google Developer Experts and Docker Captains groups, and a published author.&lt;/p&gt;

&lt;p&gt;For a complete DevOps guide, you can visit &lt;a href="https://www.educative.io/track/devops-for-developers" rel="noopener noreferrer"&gt;DevOps for Developers&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Happy learning!&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>docker</category>
    </item>
    <item>
      <title>The Evolution of React: V16 and Beyond</title>
      <dc:creator>Cameron Wilson</dc:creator>
      <pubDate>Thu, 14 Nov 2019 00:40:05 +0000</pubDate>
      <link>https://dev.to/educative/the-evolution-of-react-v16-and-beyond-1len</link>
      <guid>https://dev.to/educative/the-evolution-of-react-v16-and-beyond-1len</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally posted on &lt;a href="https://www.educative.io/" rel="noopener noreferrer"&gt;Educative.io&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;React has changed quite a bit since its recent updates. While the fundamentals are essentially the same, the way we write and address React apps has changed. Even if you’ve mastered React in the past, you may not be totally up to date with its new features. &lt;/p&gt;

&lt;p&gt;Keeping your React knowledge relevant can feel like an uphill battle. Where do you start? How important are these features for your day-to-day use? What even is a hook anyway and why would I use it over HoCs and render props?&lt;/p&gt;

&lt;p&gt;React expert, &lt;a href="https://www.educative.io/profile/view/5191711974227968" rel="noopener noreferrer"&gt;Ohans Emmanuel&lt;/a&gt;, has taken all the major features of modern React and built an interactive, hands-on course so you can stay in sync with the most recent changes while learning to write better software. Get started with &lt;em&gt;&lt;a href="https://www.educative.io/courses/reintroducing-react-v16-beyond" rel="noopener noreferrer"&gt;Reintroducing React: V16 and Beyond&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Without further ado, let’s walk through a brief summary of the updates to React since the release of Version 16.&lt;/p&gt;

&lt;p&gt;Here is what we’ll be going over today:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;New Lifecycle Methods&lt;/li&gt;
&lt;li&gt;Simpler State Management with the Context API&lt;/li&gt;
&lt;li&gt;ContextType - Using Context without a Consumer&lt;/li&gt;
&lt;li&gt;React.memo&lt;/li&gt;
&lt;li&gt;The Profiler&lt;/li&gt;
&lt;li&gt;Lazy Loading with React.Lazy and Suspense&lt;/li&gt;
&lt;li&gt;React Hooks&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  New Lifecycle Methods
&lt;/h1&gt;

&lt;p&gt;A lifecycle in React is the series of changes that a component undergoes. The four essential lifecycle phases attributed to a React component include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Mounting&lt;/strong&gt; — This is the beginning phase where the component is created and then inserted into the DOM.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Updating&lt;/strong&gt; — This is the phase where a React component undergoes growth by being updated via changes in props or state.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unmounting&lt;/strong&gt; — This is the phase where the component is removed from the DOM.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error Handling&lt;/strong&gt; — This is the phase when there is a problem with your component, like a bug. When this happens, the component is in the error handling phase.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In React, &lt;strong&gt;Lifecycle Methods&lt;/strong&gt; are invoked during these various phases. A few React methods have been replaced by new lifecycle methods. React still supports &lt;code&gt;componentWillMount&lt;/code&gt;, &lt;code&gt;componentWillUpdate&lt;/code&gt;, and &lt;code&gt;componentWillReceiveProps&lt;/code&gt;, but using them going forward will not be the best practice. Instead, you should now use these additions:&lt;/p&gt;

&lt;p&gt;1) &lt;code&gt;static getDerivedStateFromProps&lt;/code&gt;: This is invoked before calling the render method during the initial mounting phase. It will return either an object that updates the state, or null to make no updates. &lt;/p&gt;

&lt;p&gt;There are two common use cases: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;(during mount) to return a state object based on the initial props &lt;/li&gt;
&lt;li&gt;to update state based on props, when the props themselves aren’t enough.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2) &lt;code&gt;getSnapshotBeforeUpdate&lt;/code&gt;: This lifecycle method is invoked right after render, or immediately before your most recent output is committed to the DOM. This method is useful when you need to grab information from the DOM just after an update is made. This method is typically used in conjunction with &lt;code&gt;componentDidUpdate&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;A common use case is taking a look at some attribute of the current DOM, and passing that value on to &lt;code&gt;componentDidUpdate&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;3) &lt;code&gt;static getDerivedStateFromError&lt;/code&gt;: This lifecycle method is used to update the state of your React app. Whenever an error is thrown in a descendant component, this method is called first, and the error thrown is passed as an argument. Whatever value is returned from this method is used to update the state of the component. &lt;/p&gt;

&lt;p&gt;A common use case is updating state to display an error screen.&lt;/p&gt;

&lt;p&gt;4) &lt;code&gt;componentDidCatch&lt;/code&gt;: This lifecycle is invoked after an error has been thrown out by using two parameters, &lt;code&gt;info&lt;/code&gt; (an object stating which component threw the error) and &lt;code&gt;error&lt;/code&gt; (the discarded error). It is invoked during the commit phase. You can update the &lt;code&gt;ErrorBoundary&lt;/code&gt; component to use this lifecycle method. &lt;/p&gt;

&lt;p&gt;A common use case is starting AJAX calls to load in data for your component.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A note on the &lt;code&gt;ErrorBoundary&lt;/code&gt; component: These will catch and log JavaScript errors present in their child component tree during the render phase. You can update the &lt;code&gt;ErrorBoundary&lt;/code&gt; component to use the &lt;code&gt;componentDidCatch&lt;/code&gt; method.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Simpler State Management with Context API
&lt;/h1&gt;

&lt;p&gt;Passing props down through a deeply nested component tree can be challenging. There’s a new, simple solution, and it’s not Redux or MobX, &lt;strong&gt;The Context API&lt;/strong&gt; is a simple, native way to pass down props through a deeply nested component tree, making it possible to share state data that is considered “global” within a component tree. You can now stop passing props through intermediate elements.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This new feature is most useful if you’re passing props through &lt;strong&gt;more than three levels&lt;/strong&gt; in your component tree.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To use this feature, you create a context object using &lt;code&gt;React.createContext( )&lt;/code&gt;. You have to then create a wrapper component that returns a Provider component. Since the &lt;code&gt;Provider&lt;/code&gt; provides the values saved in the context object, we can wrap a tree of components with the Provider. Now, any child component within the Root can access state values and the corresponding updated functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;provider&amp;gt;
// the root component
&amp;lt;Root /&amp;gt;
&amp;lt;/Provider&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  ContextType - Using Context Without a Consumer
&lt;/h1&gt;

&lt;p&gt;Context is used primarily when data needs to be accessed by multiple components at different nesting levels. This new React update tries to solve the problem of nesting when it becomes cumbersome to pass certain types of data. Now, you can consume data from context without directly using the &lt;code&gt;Consumer&lt;/code&gt; component. In other words, the &lt;code&gt;contextType&lt;/code&gt; class property enables you to get rid of the &lt;code&gt;Consumer&lt;/code&gt; component for certain cases.&lt;/p&gt;

&lt;p&gt;Note that you can only use one &lt;code&gt;contextType&lt;/code&gt; within a &lt;code&gt;class&lt;/code&gt; component, so you will have to use nested code if you introduce multiple &lt;code&gt;Consumers&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To do so, you set the &lt;code&gt;contextType&lt;/code&gt; property of the class component to a context object. You can then consume values from that context object using &lt;code&gt;this.context&lt;/code&gt;. This way, you don’t have to nest data!&lt;/p&gt;

&lt;h1&gt;
  
  
  React.memo
&lt;/h1&gt;

&lt;p&gt;The new &lt;code&gt;React.memo&lt;/code&gt; is used for controlling when components render. It replaces the &lt;code&gt;PureComponent&lt;/code&gt;. You use it to wrap functional components, and you get the exact same results as the &lt;code&gt;PureComponent&lt;/code&gt; function.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;React.memo&lt;/code&gt; is a higher order function, so, if props don’t change, react will skip rendering the component to favor the previously memorized value. To handle this, &lt;code&gt;React.memo&lt;/code&gt; takes in the &lt;code&gt;equalityCheck&lt;/code&gt; function as an argument. If it returns &lt;code&gt;true&lt;/code&gt;, there will be no re-render, and if it returns &lt;code&gt;false&lt;/code&gt;, there will be a re-render. If you use this function, you need to include checks for function props, otherwise you may get bugs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { memo } from 'react'
export default  memo(function MyComponent ({name}) {
    return ( &amp;lt;div&amp;gt;
        Hello {name}.       
     &amp;lt;/div&amp;gt;
    )
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  The Profiler: Collecting Data for Better React Apps
&lt;/h1&gt;

&lt;p&gt;The Profiler is a replacement for the &lt;code&gt;react-addons-perf&lt;/code&gt; module, which is no longer supported by React 16. The Profiler helps with rendering times and bottlenecks by measuring performance and identifying render times. The Profiler records a session of your app and gathers information about the various components in two phases: the render phase and the commit phase. It then displays results about these two phases which you can learn to interpret to make useful changes to your apps.&lt;/p&gt;

&lt;p&gt;You gather profiling data by clicking the record button and interacting with different facets of your application. This will generate the Flamegraph Tab, which shows you the components you used and the different render times. The Profiler can also rank data and compare it across multiple renders of the same application. Using this data, you can resolve performance leaks by adding &lt;code&gt;Profiler&lt;/code&gt; anywhere in your React tree.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;To access the Profiler, you need React v16.5.0+ and React Developer Tools&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffga8mxpfplywy7ebvnci.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffga8mxpfplywy7ebvnci.png" alt="Alt Text" width="800" height="132"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Lazy Loading with React.lazy and Suspense
&lt;/h1&gt;

&lt;p&gt;This new feature enables you to handle lazy loading without relying on third-party libraries. It can be used to improve performance on your React apps. Bundling code in progression can get very cumbersome, and this slows down your app. With code splitting, you can split your code into chunks and load the critical user interface items before the non-critical ones.&lt;/p&gt;

&lt;p&gt;Using &lt;code&gt;React.lazy()&lt;/code&gt;, you can use code splitting to load React components lazily. &lt;code&gt;Suspense&lt;/code&gt; is required to wrap multiple lazy components and control user experience even as the items are being loaded into the DOM. These two features make dynamic imports much easier.&lt;/p&gt;

&lt;p&gt;It’s important to wrap your lazy-loaded components in an error boundary, otherwise there may be a network error during fetching. Also, note that &lt;code&gt;React.lazy&lt;/code&gt; and &lt;code&gt;Suspense&lt;/code&gt; do not yet support server-side rendering or named exports.&lt;/p&gt;

&lt;h1&gt;
  
  
  React Hooks: For Simpler React Apps
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw86dkiw52k97cotkrdbp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw86dkiw52k97cotkrdbp.png" alt="Alt Text" width="700" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And now what you’ve been waiting for! React Hooks. Hooks were released in React 16.8.0. With hooks, you can “hook into” state and lifecycle features from within function components. This is a powerful way to share functionality between components instead of using class components.&lt;/p&gt;

&lt;p&gt;With hooks, you can share logic inside a component. Now you’re able to write clean, reusable code and create stateful components without the use of class. There are several built-in hooks that all begin with the word &lt;code&gt;use&lt;/code&gt;. Let’s briefly go over a few notable ones.&lt;/p&gt;

&lt;p&gt;For more on hooks, check out our blog post on &lt;a href="https://www.educative.io/blog/react-hooks-components-and-design-patterns" rel="noopener noreferrer"&gt;React Design Patterns&lt;/a&gt; or &lt;a href="https://reactjs.org/docs/hooks-reference.html" rel="noopener noreferrer"&gt;React’s Hooks API Reference Sheet&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or, for a basic tutorial on how to build a TODO list with hooks you can &lt;a href="https://www.educative.io/blog/build-a-todo-list-with-react-hooks" rel="noopener noreferrer"&gt;visit this post&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;useState&lt;/code&gt;: This hook enables your functional component to use and update local state. It is called inside a function component to add local state to it. It then returns the current state value and a function that lets you update it. This hook can be used more than once in a single component. It’s similar to &lt;code&gt;this.setState&lt;/code&gt; in a class, but it doesn’t merge the old and new state together.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;useEffect&lt;/code&gt;: With this hook, you can perform side effects from a function component unified as a single API. This is similar to the class &lt;code&gt;componentDidMount&lt;/code&gt;. React runs the effect function after each render.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;useContext&lt;/code&gt;: With this hook, you can subscribe to React context without nesting.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;useReducer&lt;/code&gt;: With this hook, you can work with local state of complex components and avoid using a reducer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Custom Hooks&lt;/strong&gt;: You can also make your own hooks to serve different purposes by using the &lt;code&gt;use&lt;/code&gt; keyword. &lt;strong&gt;There are two rules to follow:&lt;/strong&gt; you can only call hooks at the Top Level, and you can only call hooks from React functions.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip: If you want to build your own hooks, the &lt;a href="https://www.npmjs.com/package/eslint-plugin-react-hooks" rel="noopener noreferrer"&gt;ESLint plugin&lt;/a&gt; will make sure you stick to the rules.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Get to Learning!
&lt;/h1&gt;

&lt;p&gt;Clearly, there is a lot to learn to stay in sync with React. We don’t want you to fall behind. That’s why we’ve released our new &lt;a href="https://www.educative.io/courses/reintroducing-react-v16-beyond" rel="noopener noreferrer"&gt;Reintroducing React: V16 and Beyond&lt;/a&gt; course. While you can still work around some of these new updates, they will quickly become the preferred method for creating React apps, so it’s best to learn how to work with these features now.&lt;/p&gt;

&lt;p&gt;This course will get you up to speed to ensure you’re using your full React potential. It’s loaded with visuals, quizzes, and code playgrounds so you can test out the new features as you learn. By learning how to work with modern React, you’ll evolve the way you develop React apps while making use of powerful features that will make you a better developer.&lt;/p&gt;

&lt;p&gt;Happy learning!&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>reactnative</category>
      <category>javascript</category>
    </item>
    <item>
      <title>React hooks design patterns and creating components without class</title>
      <dc:creator>Cameron Wilson</dc:creator>
      <pubDate>Mon, 11 Nov 2019 20:01:58 +0000</pubDate>
      <link>https://dev.to/educative/react-hooks-design-patterns-and-creating-components-without-class-1j2f</link>
      <guid>https://dev.to/educative/react-hooks-design-patterns-and-creating-components-without-class-1j2f</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally posted on &lt;a href="https://www.educative.io/" rel="noopener noreferrer"&gt;Educative.io&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Programming languages and frameworks are always changing. React, the most popular framework amongst the JavaScript community, is no exception. With the introduction of hooks, you can now use state and other React features without writing a class. In the official documentation, hooks are explained as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Functions that let you “hook into” React state and lifecycle features from function components. Hooks don’t work inside classes — they let you use React without classes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Ultimately, hooks were designed with code reuse in mind but that’s not all. Hooks are also here to replace class components and the frustrations that come with them, however, hooks now provide a new way to create components, so some of those tried and true React design patterns will now need to be implemented with hooks. While it's been recommended that you gradually shift towards the hooks model, they will eventually be the preferred method, so you may want to experiment with them now. &lt;a href="https://www.educative.io/courses/advanced-react-patterns-with-hooks" rel="noopener noreferrer"&gt;Advanced React Patterns with Hooks&lt;/a&gt; is a great course to learn the ins and outs of this powerful new feature.&lt;/p&gt;

&lt;h1&gt;
  
  
  React design patterns and the intro of hooks
&lt;/h1&gt;

&lt;p&gt;React design patterns are great for a few reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You’re able to think more abstractly about how you create applications in React.&lt;/li&gt;
&lt;li&gt;They help you organize and simplify large React applications so you can build separate components and share logic between them.&lt;/li&gt;
&lt;li&gt;React patterns are tried and tested methods for building reusable components that don’t cripple flexibility.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some of the most popular design patterns are compound components, higher-order components (HoC), and render props. Now that hooks have been brought into the picture, certain React patterns have gone out of favor including HoCs and render props. They have not been removed from the framework (and it doesn’t seem like React will remove them) but developers are starting to favor hooks and here’s why:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hooks don’t introduce unnecessary nesting into your component tree.&lt;/li&gt;
&lt;li&gt;Hooks don’t suffer from drawbacks of mixins.&lt;/li&gt;
&lt;li&gt;Hooks reduce the amount of duplicated logic between components&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While some patterns are going out of favor, they can still be implemented with hooks. Check out &lt;a href="https://www.educative.io/courses/advanced-react-patterns-with-hooks" rel="noopener noreferrer"&gt;Advanced React Patterns with Hooks&lt;/a&gt; to learn how you can recreate the famous patterns developed by Kent C. Dodds by using hooks.&lt;/p&gt;

&lt;h1&gt;
  
  
  React components and the intro of hooks
&lt;/h1&gt;

&lt;p&gt;There are two main types of components in React and they are functional components (stateless) and class components (stateful). Both have their advantages and drawbacks. Functional components are typically easier to test, write, and read but they lack some features like the ability to hold state. Class components include features like lifecycle hooks and the ability to hold local state, but they are confusing for both machines and humans.&lt;/p&gt;

&lt;p&gt;Class components, although useful, bring about some unexpected challenges that functional components don’t introduce. To name a few, class components make it difficult to separate concerns, you end up with confusing classes, and an overuse of wrappers.&lt;/p&gt;

&lt;p&gt;But what if I want to use functional components and still keep the features that class components offer?&lt;/p&gt;

&lt;p&gt;This is where hooks come in. Hooks allow you to use functional components (the preferred method for creating components) with all the bells and whistles that class components offer. With hooks, you’re able to share logic inside a component as opposed to between components, making separation of concerns less of a worry. Now you’re able to write clean, reusable code that lets you create stateful components without the use of class.&lt;/p&gt;

&lt;p&gt;Here's a good tutorial on &lt;a href="https://www.educative.io/blog/build-a-todo-list-with-react-hooks" rel="noopener noreferrer"&gt;how to build a TODO list with React hooks&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Built-in and custom hooks
&lt;/h1&gt;

&lt;p&gt;React comes with built-in hooks like &lt;code&gt;useState&lt;/code&gt; and &lt;code&gt;useEffect&lt;/code&gt; just to name a few.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;useState&lt;/code&gt; is called inside a function component to add local state to it, which will be preserved between re-renders. &lt;code&gt;useState&lt;/code&gt; returns a pair: the current state value and a function that lets you update it. You can call this function from an event handler or somewhere else. It’s similar to &lt;code&gt;this.setState&lt;/code&gt; in a class, except it doesn’t merge the old and new state together.&lt;/p&gt;

&lt;p&gt;Side effects are common in React; things like data fetching, subscriptions, or manually changing the DOM are things we are used to doing. The &lt;code&gt;useEffect&lt;/code&gt; hook makes it easy to perform side effects right from a function component. Remember &lt;code&gt;componentDidMount&lt;/code&gt; and &lt;code&gt;componentDidUpdate&lt;/code&gt; from a class? &lt;code&gt;useEffect&lt;/code&gt; accomplishes the same goal as these but it’s unified into a single API.&lt;/p&gt;

&lt;p&gt;React also gives you the freedom to leverage built-in hooks to create your own custom hooks. You can write custom hooks that cover a wide range of use cases like form handling, animation, declarative subscriptions, and more, making functional components even more powerful.&lt;/p&gt;

&lt;h1&gt;
  
  
  So what about HoCs and render props patterns?
&lt;/h1&gt;

&lt;p&gt;You can continue to use HoCs and render props, but hooks are preferred. Most use cases involving these patterns deal with rendering only a single child, so it’s not ideal to use these patterns because they can become complex and introduce nesting in your tree. More often than not, hooks will be the means to accomplish what these patterns do.&lt;/p&gt;

&lt;h1&gt;
  
  
  What design patterns are still relevant?
&lt;/h1&gt;

&lt;p&gt;While some design patterns are on their way out, others are still very much accepted by the community and can be reproduced using hooks. These patterns include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Compound components&lt;/li&gt;
&lt;li&gt;Control props&lt;/li&gt;
&lt;li&gt;Props collection&lt;/li&gt;
&lt;li&gt;Prop getters&lt;/li&gt;
&lt;li&gt;State initializer&lt;/li&gt;
&lt;li&gt;State reducer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://www.educative.io/courses/advanced-react-patterns-with-hooks" rel="noopener noreferrer"&gt;Get started with React hooks&lt;/a&gt; and learn how to refactor these patterns to fit the hooks model.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Hooks are a relatively new feature that are designed to solve most of the problems that class components suffer from. They do however have an impact on the patterns that developers have been using to create applications, meaning you’ll have to learn how to implement these patterns with hooks, and if not now, eventually.&lt;/p&gt;

&lt;p&gt;It’s been recommended that you gradually shift towards the hooks model. There is no reason to rip and replace your code now, but it is worth experimenting in new projects.&lt;/p&gt;

&lt;p&gt;Happy learning!&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Java interview prep: 15 Java interview questions</title>
      <dc:creator>Cameron Wilson</dc:creator>
      <pubDate>Sat, 09 Nov 2019 03:10:01 +0000</pubDate>
      <link>https://dev.to/educative/java-interview-prep-15-java-interview-questions-i64</link>
      <guid>https://dev.to/educative/java-interview-prep-15-java-interview-questions-i64</guid>
      <description>&lt;p&gt;Not all interviews will focus on algorithms and data structures — often times an interview will focus solely on the language or technology that you have claimed to be an expert in. In interviews like these, there usually aren’t any “gotcha” questions, instead they require you to draw on memory and your experience with the language — in other words, they test your knowledge of the programming language.&lt;/p&gt;

&lt;p&gt;However, it can be easy to forget all the ins and outs of a language like Java, because simply put, we don’t deal with questions like “What kind of memory does the JVM manage?” and “Describe polymorphism with an example.” on a daily basis.&lt;/p&gt;

&lt;p&gt;This post outlines some popular questions asked in a Java interview. Because Java specific questions can vary so much, this post acts as a guide to get you thinking about the different types of questions you can expect and what topics you should prepare for. If you’d like to see a complete guide to mastering the Java language, you can check out &lt;a href="https://www.educative.io/courses/the-definitive-java-interview-handbook" rel="noopener noreferrer"&gt;“The Definitive Java Interview Handbook”&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Today we’ll look at interview questions and answers related to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The Java ecosystem&lt;/li&gt;
&lt;li&gt;Java Classes&lt;/li&gt;
&lt;li&gt;Interfaces&lt;/li&gt;
&lt;li&gt;Inheritance&lt;/li&gt;
&lt;li&gt;Multi-threading&lt;/li&gt;
&lt;li&gt;Memory management&lt;/li&gt;
&lt;li&gt;Collections&lt;/li&gt;
&lt;li&gt;Exception handling&lt;/li&gt;
&lt;li&gt;Serialization&lt;/li&gt;
&lt;li&gt;Singleton&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s get started!&lt;/p&gt;

&lt;h1&gt;
  
  
  Q1: What is meant by Java being platform independent?
&lt;/h1&gt;

&lt;p&gt;Java works on the principle of write once and run anywhere. Once a Java program is written, it is compiled into what is known as byte code, which can then be run on any Java Virtual Machine or JVM for short.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmo0580c3a3pc6n1hqfsj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmo0580c3a3pc6n1hqfsj.png" alt="Alt Text" width="750" height="250"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Compilation to bytecode is the magic behind Java’s interoperability. Different operating systems and hardware architectures have JVMs custom designed for themselves and all JVMs can run the same bytecode. Therefore, if you write a Java program on Linux, it will run seamlessly on a JVM designed for Windows operating system, making code agnostic to the underlying hardware and OS.&lt;/p&gt;

&lt;h1&gt;
  
  
  Q2: Explain the concepts of JRE, JDK, and JVM
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;JRE (Java Runtime Environment)&lt;/strong&gt; includes the Java Virtual Machine and the standard Java APIs (core classes and supporting files.). The JRE contains just enough to execute a Java application, but not enough to compile it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;JDK (Java Development Kit)&lt;/strong&gt; is the JRE plus the Java compiler, and a set of other tools to compile and debug code. JRE consists of Java platform libraries, Java Virtual Machine (JVM), Java Plugin and Java Web Start to run Java applications. JRE as a stand-alone does not contain compilers and debugging tools. If you need to develop Java programs you need the full Java SDK. The JRE is not enough for program development. Only the full Java SDK contains the Java compiler which turns your .java source files into bytecode .class files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;JVM (Java Virtual Machine)&lt;/strong&gt; is an implementation of a specification, detailing the behavior expected of a JVM. Any implementation that conforms to the JVM specification should be able to run code compiled into Java bytecode irrespective of the language in which the code was originally written. In the Java programming language, all source code is first written in plain text files ending with the .java extension. Those source files are then compiled into .class files by the javac compiler. A .class file does not contain code that is native to your processor; it instead contains bytecodes — the machine language of the Java Virtual Machine. The java launcher tool then runs your application with an instance of the Java Virtual Machine.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Q3: How would you mark an entity package private in Java?
&lt;/h1&gt;

&lt;p&gt;There’s no explicit modifier for package private. In the absence of any modifier the class or member variables are package private. A member marked package private is only visible within its own package. Consider the class below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="c1"&gt;// class can be accessed by other classes within the same&lt;/span&gt;
&lt;span class="c1"&gt;// package but not outside of it.&lt;/span&gt;
&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;IamPackagePrivateClass&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

   &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nc"&gt;IamPackagePrivate&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
   &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nc"&gt;IamPrivate&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

   &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;IamPackagePrivate&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;IamPackagePrivate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;IamPrivate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
   &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Package private is a slightly wider form of private. One nice thing about package-private is that you can use it to give access to methods you would otherwise consider private to unit test classes. So, if you use helper classes which have no other use but to help your public classes do something clients need, it makes sense to make them package private as you want to keep things as simple as possible for users of the library.&lt;/p&gt;

&lt;h1&gt;
  
  
  Q4: Why should you avoid the finalize() method in the Object class? What are some alternatives?
&lt;/h1&gt;

&lt;p&gt;The Object class provides a callback method, finalize(), that may be invoked on an object when it becomes garbage. Object’s implementation of finalize() does nothing — you can override finalize() to do cleanup, such as freeing up resources.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;finalize()&lt;/code&gt; method may be called automatically by the system, but when it is called, or even if it is called, is uncertain. Therefore, you should not rely on this method to do your cleanup for you. For example, if you don’t close file descriptors in your code after performing I/O and you expect finalize() to close them for you, you may run out of file descriptors.&lt;/p&gt;

&lt;p&gt;Here are some alternatives:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The try-with-resources idiom can be used to clean up objects. This requires implementing the AutoCloseable interface.&lt;/li&gt;
&lt;li&gt;Using a PhantomReference to perform cleanup when an object is garbage collected&lt;/li&gt;
&lt;li&gt;Using Cleaner class to perform cleanup actions.&lt;/li&gt;
&lt;li&gt;Implement a &lt;code&gt;close()&lt;/code&gt; method, which does the cleanup and document that the method be called.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Q5: Can you change the contents of a final array as shown in the code snippet below?
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;];&lt;/span&gt;
&lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It may appear counterintuitive, but we can actually change the contents of the array even though it is marked as final. The array variable points to a particular start location in the memory where the contents of the array are placed. The location or the memory address can’t be changed. For instance, the following code will not compile:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;array&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;However, the following code will work.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;FinalArrayExample&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;];&lt;/span&gt;

  &lt;span class="c1"&gt;// allowed&lt;/span&gt;
  &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;changeArrayContents&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;

  &lt;span class="c1"&gt;// not allowed and will not compile&lt;/span&gt;
  &lt;span class="cm"&gt;/*

  void changeArray() {
    array = new int [10]

  }*/&lt;/span&gt;

&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Q6: Explain the difference between an interface and an abstract class? When should you use one or the other?
&lt;/h1&gt;

&lt;p&gt;An abstract class can’t be instantiated, but it can be subclassed. An abstract class usually contains abstract and non-abstract methods that subclasses are forced to provide an implementation for.&lt;/p&gt;

&lt;p&gt;An interface is a completely “abstract class” that is used to group related methods with empty bodies.&lt;/p&gt;

&lt;p&gt;Following are four main differences between abstract classes and interfaces:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;An abstract class can have final variables, static variables, or class member variables whereas an interface can only have variables that are final and static by default.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An abstract class can have static, abstract, or non-abstract methods. An interface can have static, abstract, or default methods.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Members of an abstract class can have varying visibility of private, protected, or public. Whereas, in an interface all methods and constants are public.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A class can only extend another class, but it can implement multiple interfaces. Similarly, an interface can extend multiple interfaces. An interface never implements a class or an interface.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use an abstract class when subclasses share state or use common functionality. Or you require to declare non-static, non-final fields or need access modifiers other than public.&lt;/p&gt;

&lt;p&gt;Use an interface if you expect unrelated classes would implement your interface. For example, the interfaces Comparable and Cloneable are implemented by many unrelated classes. Interfaces are also used in instances where multiple inheritance of type is desired.&lt;/p&gt;

&lt;h1&gt;
  
  
  Q7: What is polymorphism? Can you give an example?
&lt;/h1&gt;

&lt;p&gt;Polymorphism is the ability in programming to present the same interface for differing underlying forms or data types. Polymorphism is when you can treat an object as a generic version of something, but when you access it, the code determines which exact type it is and calls the associated code. What this means is that polymorphism allows your code to work with different classes without needing to know which class it’s using.&lt;/p&gt;

&lt;p&gt;Polymorphism is used to make applications more modular and extensible. Instead of messy conditional statements describing different courses of action, you create interchangeable objects that you select based on your needs. That is the basic goal of polymorphism.&lt;/p&gt;

&lt;p&gt;The classic example of polymorphism is a &lt;code&gt;Shape&lt;/code&gt; class. We derive &lt;code&gt;Circle&lt;/code&gt;, &lt;code&gt;Triangle&lt;/code&gt;, and &lt;code&gt;Rectangle&lt;/code&gt; classes from the parent class &lt;code&gt;Shape&lt;/code&gt;, which exposes an abstract method &lt;code&gt;draw()&lt;/code&gt;. The derived classes provide their custom implementations for the &lt;code&gt;draw()&lt;/code&gt; method. Now it is very easy to render the different types of shapes all contained within the same array by calling the &lt;code&gt;draw()&lt;/code&gt; method on each object. This saves us from creating separate draw methods for each shape e.g. &lt;code&gt;drawTriangle()&lt;/code&gt;, &lt;code&gt;drawCircle()&lt;/code&gt; etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy81c30t37nf18mdkvmfy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy81c30t37nf18mdkvmfy.png" alt="Alt Text" width="800" height="375"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Q8: Can the main method be overloaded?
&lt;/h1&gt;

&lt;p&gt;Yes, the main method, which is a static method, can be overloaded. But only &lt;code&gt;public static void main(String[] args)&lt;/code&gt; will be used when your class is launched by the JVM even if you specify one or two command-line arguments. However, programmatically one can invoke the overloaded versions of the main method.&lt;/p&gt;

&lt;h1&gt;
  
  
  Q9: How can you pass multiple arguments to a method on each invocation call?
&lt;/h1&gt;

&lt;p&gt;We can pass variable number of arguments to a method using varargs feature. Below is an example of passing multiple arguments of the same type to a method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;childrenNames&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="o"&gt;...&lt;/span&gt; &lt;span class="n"&gt;names&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;names&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++)&lt;/span&gt;
   &lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;names&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;]);&lt;/span&gt;

&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The type name is followed by three dots, a space, and then the variable name.&lt;/li&gt;
&lt;li&gt;The varargs variable is treated like an array.&lt;/li&gt;
&lt;li&gt;The varargs variable must appear at the last in the method signature.&lt;/li&gt;
&lt;li&gt;As a consequence of the above, there can only be a single varargs in a method signature.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The above method can be invoked as follows: Invoking Varargs Method&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;childrenNames&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;childrenNames&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Jane"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;childrenNames&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Jane"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Tom"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Peter"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Q10: Can a semaphore act as a mutex?
&lt;/h1&gt;

&lt;p&gt;A semaphore can potentially act as a mutex if the number of permits it can give out is set to 1. However, the most important difference between the two is that in the case of a mutex, the same thread must call acquire and subsequent release on the mutex whereas in the case of a binary semaphore, different threads can call acquire and release on the semaphore.&lt;/p&gt;

&lt;p&gt;This leads us to the concept of “ownership”. A mutex is owned by the thread acquiring it, till the point, it releases it, whereas for a semaphore there’s no notion of ownership.&lt;/p&gt;

&lt;p&gt;Need a refresher on multithreading? Check out this article &lt;a href="https://blog.educative.io/java-multithreading-and-concurrency-what-to-know-for/" rel="noopener noreferrer"&gt;“Java Multithreading and Concurrency: What to know to crack a senior engineering interview”&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Q11: Explain the Externalizable interface
&lt;/h1&gt;

&lt;p&gt;The Serializable interface gets us automatic serialization capability for objects of our class. On the other hand the Externalizable interface provides a way to implement a custom serialization mechanism. A class that implements the Externalizable interface is responsible to save and restore the contents of its own instances.&lt;/p&gt;

&lt;p&gt;The Externalizable interface extends the Serializable interface and provides two methods to serialize and deserialize an object, &lt;code&gt;writeExternal()&lt;/code&gt; and &lt;code&gt;readExternal()&lt;/code&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Q12: If a code block throws more than one exception, how can it be handled?
&lt;/h1&gt;

&lt;p&gt;Multiple types of exceptions thrown by a snippet of code can be handled by multiple catch block clauses followed by the try block. An example snippet of exception handling appears below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;process&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;  &lt;span class="o"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;val&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
            &lt;span class="c1"&gt;//checked exception&lt;/span&gt;
            &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;FileNotFoundException&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;val&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
            &lt;span class="c1"&gt;// runtime exception&lt;/span&gt;
            &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;NullPointerExxception&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;val&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
            &lt;span class="c1"&gt;// error exception&lt;/span&gt;
            &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;StackOverflowError&lt;/span&gt;

   &lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;RuntimeException&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;// catches all unchecked  exceptions&lt;/span&gt;

   &lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Exception&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;// catches all checked exceptions&lt;/span&gt;

   &lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Error&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;// catches all errors&lt;/span&gt;

   &lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Q13: If you were to use a set, how would you determine between a HashSet and a TreeSet?
&lt;/h1&gt;

&lt;p&gt;Initially, you may want to use HashSet as it will give you a better time complexity, but it makes no guarantees as to the iteration order of the set; in particular, it does not guarantee that the order will remain constant over time.&lt;/p&gt;

&lt;p&gt;So if you are wanting to maintain the order it’s best to use a TreeSet as it stores keys in ascending order rather than in their insertion order. It’s not thread safe. However, keep in mind that TreeSet is not thread safe whereas a HashSet is.&lt;/p&gt;

&lt;h1&gt;
  
  
  Q14: What are a few ways you can improve the memory footprint of a Java application?
&lt;/h1&gt;

&lt;p&gt;Here are three key steps you can take to improve the memory footprint:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Limiting the scope of local variables. Each time the top scope from the stack is popped up, the references from that scope are lost, and this could make objects eligible for garbage collection.&lt;/li&gt;
&lt;li&gt;Explicitly set variable references to null when not needed. This will make objects eligible for garbage collection.&lt;/li&gt;
&lt;li&gt;Avoid finalizers. They slow down program performance and do not guarantee anything.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Q15: What is the best way to implement a singleton class?
&lt;/h1&gt;

&lt;p&gt;The best way to implement a singleton as per Josh Bloch is to use an enum type for the singleton. Because Java ensures that only a single instance of an enum is ever created, the singleton class implemented via enums is safe from reflection and serialization attacks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Demonstration&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;Superman&lt;/span&gt; &lt;span class="n"&gt;superman&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Superman&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;INSTANCE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;superman&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;fly&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;enum&lt;/span&gt; &lt;span class="nc"&gt;Superman&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="no"&gt;INSTANCE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Clark Kent"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;residence&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"USA"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;fly&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"I am flyyyyinggggg ..."&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Gaining a mastery
&lt;/h1&gt;

&lt;p&gt;There has been a lot covered in this post about the Java programming language, ranging from the Java ecosystem (question1) to multi-threading (question 10) and exceptions (question 12). These are the types of Java interview questions you can expect. It’s best to use the material outlined above as a guideline for topics you’ll want to study and the types of questions you can expect.&lt;/p&gt;

&lt;p&gt;However, the material here just scratches the surface. There are many more concepts to revisit or explore like object-oriented programming, static variables, and method overloading. If you’d like to take a deep dive into Java and explore hundreds of more questions about the topics mentioned above then &lt;a href="https://www.educative.io/collection/5307417243942912/5730192894984192" rel="noopener noreferrer"&gt;“The Definitive Java Interview Handbook”&lt;/a&gt; is going to be a great resource to get you refreshed on the core java principles — everything from the basics to more advanced functionality.&lt;/p&gt;

&lt;p&gt;Happy learning!&lt;/p&gt;

</description>
      <category>java</category>
      <category>career</category>
      <category>computerscience</category>
    </item>
  </channel>
</rss>
