Sunday, September 9, 2018

JAVA vs SCALA

Good-day everyone, in this blog i will be discussing about JAVA and SCALA programming.



 I am going to talk about:
- What is Scala programming
- The difference between JAVA and SCALA
- Coding comparison between SCALA and JAVA
- Conclusion


What is Scala Programming ?
- It has been introduce in 2001 by Martin Odersky
- Scala is a programing is a type of JVM (Java Virtual Machine) language that incorporate both functional and object orientated programming (Multi-paradigm).
- Uses SBT (Scala Build Tool) to compile
- Major company uses Scala such as:
  -Linkedin
  -Netflix
  -sound-cloud
  -Twitter
  -and many more

Difference between SCALA and JAVA
- Reduce the number of lines of code compare to java
- Which perform than java
- A steep learning curve compare to java
-  JAVA is more readable and understandable than SCALA if your not used to the programming language


Coding comparison between JAVA and SCALA

- Creating an array of String

JAVA

SCALA



As you can see when creating a list and being able to print out the data in the list, in JAVA it has more coding compare to SCALA. Scala does not need a loop to print out all the data whereas java needs a for loops to be able to print out all of the data.



- IF Statement

JAVA



SCALA


As you can see from the images above, they both look familiar when it comes to IF Statement. There are no difference what so ever.


- Creating a function

JAVA


SCALA



The picture above shows again that both JAVA and SCALA are similar when creating a simple additional function. However, SCALA uses less codes compare JAVA




- Creating an object and class

JAVA

SCALA






From the picture above, as you can see there is a big different when creating a class and an object.
JAVA consist of more code compare to SCALA


Conclusion

In conclusion, if you are interested in programing using SCALA you should try and give it ago for yourself. In the beginning SCALA is abit complex to understand at first, but once you learn the basic programing of SCALA then it should be easy when developing a project base on SCALA,

No comments:

Post a Comment