Scala is a portmanteau of 'scalable' and 'language'. It is designed to grow with user demand. Portmanteaus are often used in language as a creative and playful way to describe new phenomena, ideas, or objects. A general-purpose programming language, Scala provides support for functional programming and a strong static type system. We are covering some of the basic concepts of Scala. As you see, you can explore more advanced topics like class , pattern matching, case classes, traits, and functional programming concepts like higher-order functions and currying.
Scala have data types, including Int, Double, Boolean, String, etc. It also has a type inference feature that automatically deduces the data type of variables:
Scala supports both mutable and immutable variables. You can define variables using the var keyword (mutable) and val keyword (immutable).
As we described in the Scala Introduction tutorial, immutability is a first class citizen in the Scala programming language. To define immutable variable, we use the keyword val with the following syntax:
OK, fair enough that Scala is a functional programming language which favours the immutable pattern. But, what if you are in a loop and need to increment some variable. That's a perfectly legitimate use case and to declare a variable as mutable, we use the keyword var as opposed to val.
Sometimes you may wish to delay the initialization of some variable until at the point where it is consumed by your application. This is usually referred to as lazy initialization and we need to make use of the lazy keyword
In Pattern matching a very basic example Suppose you want to test a variable called donutType. In the case that its value is Glazed Donut, you will print Very Tasty. On the other hand, if its value is Plain Donut, then you will print Tasty.
Answer :- Syntax of language is very similar to other language like java . you can also say that Scala is enhance version of Scala. Large code of java is few line’s of code in scala means we can reduce line of code . Scala is more compatible with big data environment like Spark frame work. For more details please visit my blog :- Syntax of language is very similar to other language like java . you can also say that Scala is enhance version of Scala.
Yes , you can say scala is better then java because syntax much smaller in scala compare to java , the number of line is more in java . But compilation of both language java and scala is same they are JVM for compilation. For more about scala ,please check below link :- Scala Tutorials (https://www.developerindian.com/developer/scala-tutorial-for-beginners)
scala is programing language . it is running on top of bigdata tool like Spark and Hadoop , Kafka Hive etc.
Actually you cannot compare Big Data and Hadoop as they are complimentary to each other. Understand Big Data as a problem statement and Hadoop as a solution to it. Big Data is a term used for a collection of data sets that are large and complex, which is difficult to store and process using available database management tools or traditional data processing applications. The challenge includes capturing, curating, storing, searching, sharing, transferring, analyzing and visualization of this data.
Big data is the problem being faced due to increasing size of data while Hadoop is solution to this problem of Big data. Scala is a completely different language in which Apache Spark is written. Scala is also work on top Hadoop. So you need to learn both hadoop and scala.
For AI , i can refer python because of his huge ML library . R used for visualization libraries. Scala used for his syntax and better performance . python has more library for AI and easy to implementation. Please check out blog ;- Scala Tutorials (https://www.developerindian.com/developer/scala-tutorial-for-beginners)
So if you are looking to make your career in Big data field, it is recommended to start learning basics of Big data and then proceed with hadoop and deep dive into Hadoop as it has huge demand in the market now.
What is scala and How to define a Variable in Scala