{"id":6,"date":"2021-12-18T09:47:09","date_gmt":"2021-12-18T09:47:09","guid":{"rendered":"https:\/\/www.kindsonthegenius.com\/scala\/?p=6"},"modified":"2022-04-23T08:14:11","modified_gmt":"2022-04-23T08:14:11","slug":"scala-introduction-to-scala-programming","status":"publish","type":"post","link":"https:\/\/www.kindsonthegenius.com\/scala\/scala-introduction-to-scala-programming\/","title":{"rendered":"Scala &#8211; Introduction to Scala Programming"},"content":{"rendered":"<p>This would be the first in the series of interesting tutorial on Scala Programming. In this lesson, you&#8217;ll learn about the features of Scala and why you need to learn Scala.<\/p>\n<p>The following is covered:<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li><a href=\"#t1\">Overview of Scala Programming Language<\/a><\/li>\n<li><a href=\"#t2\">Features of Scala Programming Language<\/a><\/li>\n<li><a href=\"#t3\">Why Learn Scala<\/a><\/li>\n<li><a href=\"#t4\">Scala for Web Development<\/a><\/li>\n<li><a href=\"https:\/\/youtu.be\/CTG3wum8dO4\" target=\"_blank\" rel=\"noopener\">Scala Introduction Video Tutorial<\/a><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<h4><strong id=\"t1\">1. Overview of Scala Programming Language<\/strong><\/h4>\n<p>The word Scala is a short form of &#8216;Scalable Language&#8217;. It is a general-purpose language. This means that it combines the features of programming paradigms. For example, it&#8217;s both a functional language and an object-oriented language. It is also statically typed, that is, data types of variables are checked at compile time. This is in contrast to dynamically-typed languages where type checking is done at run-time.<\/p>\n<p>Scala was designed to address some of the drawbacks of Java. Moreover, Scala is compiled to run on JVM (Java Virtual Machine).<\/p>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t2\">2. Features of Scala Programming Language<\/strong><\/h4>\n<p>Some of the key features of Scala are outlined below:<\/p>\n<p><strong>Functional Programming Language<\/strong><\/p>\n<p>In functional programming language, functions are treated as &#8216;first-class citizens&#8217;, meaning that they are treated just like other entities(variables). Therefore, they can be bound to identifiers, passed as arguments to other functions or returned by by other function as return value.<\/p>\n<p><strong>Object-Oriented<\/strong><\/p>\n<p>As an object-oriented programming language, classes can be defined. Also values of variables can be considered objects as well. Additionally, Scala support class inheritance and other OOP concepts like polymorphism and abstraction.<\/p>\n<p><strong>Static-Typing and Type Inference<\/strong><\/p>\n<p>This is a very important feature\u00a0 of Scala as if limits possible runtime error. Additionally, Scala supports type inference as well. This means that if the type of variable, function return type an other data types are omitted, the Scala compiler can infer it from its value.<\/p>\n<p><strong>Runs of Java Runtime\u00a0<\/strong><\/p>\n<p>Just like Java, Scala programs are compiled into Java Byte Code(JBC) which can then run on Java Virtual Machine(JVM).\u00a0 Scala code can be executed using the &#8216;scala&#8217; command to produce the byte code.<\/p>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t3\">3. Why Learn Scala<\/strong><\/h4>\n<p>If you are a programmer of wants to start a journey into programming, then go for Scala! Here are my reasons below:<\/p>\n<p><strong>Improvement Over Java<\/strong> &#8211; As mentioned earlier, Scala address some of deficiencies of Java<\/p>\n<p><strong>General Purpose<\/strong> &#8211; You can use Scale in a wide range of application use-cases<\/p>\n<p><strong>Combine With Java<\/strong> &#8211; Scala is interoperable with Java. So you can have Scala and Java code in one application<\/p>\n<p><strong>Support Web<\/strong> &#8211; You can build web applications using Scala and discussed in the next section.<\/p>\n<p><strong>Growing Community<\/strong> &#8211; Currently you can find find lots of resources on Scala programming. Moreover, the community of Scala developers is growing<\/p>\n<p><strong>Relatively to Learn Functional Language<\/strong> &#8211; Compared to other functional programming languages like Heskell, Elixir, Elm etc, Scala is the way to go<\/p>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t4\">4. Scala for Web Developement<\/strong><\/h4>\n<p>Using Scala, you can build enterprise application for the web. Currently, several web applications are developed using Scala. To support web application development, there are a number of frameworks out there you can use. This includes:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.playframework.org\/\" target=\"_blank\" rel=\"noopener\">Play<\/a><\/li>\n<li><a href=\"http:\/\/liftweb.net\/\" target=\"_blank\" rel=\"noopener\">Lift<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/bowler-framework\/bowler-quickstart\" target=\"_blank\" rel=\"noopener\">Bowler<\/a><\/li>\n<\/ul>\n<p>Finally, I would recommend you learn Scala. And I would make a simple video tutorial on Scala programming and this tutorial would be available on my <a href=\"https:\/\/www.youtube.com\/c\/KindsonTheTechPro\" target=\"_blank\" rel=\"noopener\">YouTube Channel<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This would be the first in the series of interesting tutorial on Scala Programming. In this lesson, you&#8217;ll learn about the features of Scala and &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[47],"class_list":["post-6","post","type-post","status-publish","format-standard","hentry","category-scala-programming","tag-functional-programming"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.kindsonthegenius.com\/scala\/wp-json\/wp\/v2\/posts\/6","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kindsonthegenius.com\/scala\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kindsonthegenius.com\/scala\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/scala\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/scala\/wp-json\/wp\/v2\/comments?post=6"}],"version-history":[{"count":8,"href":"https:\/\/www.kindsonthegenius.com\/scala\/wp-json\/wp\/v2\/posts\/6\/revisions"}],"predecessor-version":[{"id":259,"href":"https:\/\/www.kindsonthegenius.com\/scala\/wp-json\/wp\/v2\/posts\/6\/revisions\/259"}],"wp:attachment":[{"href":"https:\/\/www.kindsonthegenius.com\/scala\/wp-json\/wp\/v2\/media?parent=6"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/scala\/wp-json\/wp\/v2\/categories?post=6"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/scala\/wp-json\/wp\/v2\/tags?post=6"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}