Learning Java as JavaScript Developer – week 1

This blog post is a beginning of the series “Java for JavaScript Developers” and it describes my experience while learning Java programming language.

So, as many of you have already know from Twitter, due to my job specification I started to learn Ja…


This content originally appeared on DEV Community and was authored by Olena Drugalya

This blog post is a beginning of the series "Java for JavaScript Developers" and it describes my experience while learning Java programming language.

So, as many of you have already know from Twitter, due to my job specification I started to learn Java after being a web developer and using JavaScript for building projects. During a few years of using JavaScript and building projects mostly with React and other front-end frameworks, I have to dig myself into back-end.

That felt a bit weird I should say. Even though I used to learn new languages all the time (I speak 5 languages and finished linguistic university), it takes time to get used to new rules and new syntax.

Differences

After the first week of study I can already distinguish the main differences between 2 languages:

  1. Java is static language and JS is dynamic language.
    What this means is they check their data types on different stages.
    Java checks types before run-time, each variable has to be associated with a type upon declaration.
    JavaScript checks types on the fly, during execution and the type of variable is unknown until program compilation.

  2. Java is one-paradigm and JS is multi-paradigm
    What this means is that:
    Java is strictly object-oriented, meaning it solves programming problems based on the concept of objects and everything is built around objects.
    JavaScript on the contrary can be used as object-oriented, procedural or scripting language (it is used mainly as scripting though).

  3. Java is stand-alone language and JS is co-dependant language
    What that means is that:
    Java can be used to build a fully-functional application by developer without any additional languages. It can run on multiple platforms.
    JavaScript is depending on HTML and CSS and cannot be used as a stand-alone language to build a fully-functional application. Even though nowadays JS is widely used for back-end (Node.js), it still needs cooperation with additional languages.

  4. Java objects are class-based and JS objects are prototype-based
    What that means is that:
    Java uses classes as templates for objects creation. It allows a class to derive (inherit) the properties of another class. It also supports multiple inheritances i.e.; a class can derive properties from multiple classes.
    JavaScript uses prototypes - special objects, to which additional properties can be attached, which will be shared across all the instances of their constructor function. It does not support multiple inheritance.

  5. Java supports multi-threading and JS doesn't.
    This one says it all in one sentence :) JavaScript does not support multi-threading because the JavaScript interpreter in the browser is a single thread.

Similarities

BUT there are some similarities between the languages:

  1. Object-Oriented Programming: Both languages have access to OOPs concepts such as abstraction, inheritance, and polymorphism.

  2. Front-end Development: Java and JS both extend their applications in frontend development. JS can be embedded directly into HTML, which is implemented as a framework or a library; whereas, Java is used as Java Applet.

  3. Back-end Development: Both languages offer server-side support. Java supports major backend technologies such as JBoss, Apache, and WebSphere. Node.js serve JavaScript-powered servers.

So, these are the main differences and similarities between Java and JavaScript and if you want to explore even more on this topic, take a look at this article

In my next blog post I will write about basics of Java language and compare them to basics of Java Script :)

Thank you for reading my blog. Feel free to connect on LinkedIn or Twitter :)

Buy Me a Coffee at ko-fi.com


This content originally appeared on DEV Community and was authored by Olena Drugalya


Print Share Comment Cite Upload Translate Updates
APA

Olena Drugalya | Sciencx (2021-05-13T08:25:30+00:00) Learning Java as JavaScript Developer – week 1. Retrieved from https://www.scien.cx/2021/05/13/learning-java-as-javascript-developer-week-1/

MLA
" » Learning Java as JavaScript Developer – week 1." Olena Drugalya | Sciencx - Thursday May 13, 2021, https://www.scien.cx/2021/05/13/learning-java-as-javascript-developer-week-1/
HARVARD
Olena Drugalya | Sciencx Thursday May 13, 2021 » Learning Java as JavaScript Developer – week 1., viewed ,<https://www.scien.cx/2021/05/13/learning-java-as-javascript-developer-week-1/>
VANCOUVER
Olena Drugalya | Sciencx - » Learning Java as JavaScript Developer – week 1. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/05/13/learning-java-as-javascript-developer-week-1/
CHICAGO
" » Learning Java as JavaScript Developer – week 1." Olena Drugalya | Sciencx - Accessed . https://www.scien.cx/2021/05/13/learning-java-as-javascript-developer-week-1/
IEEE
" » Learning Java as JavaScript Developer – week 1." Olena Drugalya | Sciencx [Online]. Available: https://www.scien.cx/2021/05/13/learning-java-as-javascript-developer-week-1/. [Accessed: ]
rf:citation
» Learning Java as JavaScript Developer – week 1 | Olena Drugalya | Sciencx | https://www.scien.cx/2021/05/13/learning-java-as-javascript-developer-week-1/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.