Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Java 

Is Java an easy transition from Javascript?

I just wanted to know if they both follow the same sought of logic, I'm planning on learning JS soon (I code in python atm). I also want to learn a compiled language also when I'm comfortable with JS. I'm torn between C++ and Java but I'm leaning towards Java because of all the horror stories.
If you're already coming with programming knowledge then you should be fine with C++. It's just a bit more to keep up with is all.

As for your actual question, JavaScript and Java are similar but Java is just the "whole package" if you want to think of it in that way. In Java you have to mind type variables in declaration whereas in JS you can just declare some variable that only holds some type of value.
Ex Java:
int myInteger = 3;
ArrayList<String> stringArray = new ArrayList<String>();
Ex JS:
var myInteger = 3;
var stringArray = {"stuff", "stuff2"};

You also have to worry about global variables or whatever term you'd like to use. JavaScript doesn't have any of that from what I recall.
Ex Java:
public int myInt = 3;
public void someMethod(){}
private int someInt = 2;
private void privateMethod(){}
protected int otherInt = 1;
protected void protectedMethod(){}
etc.etc.

Ex JS:
var myInt = 3;
function myFunction(){}

You're better off learning Java in my opinion since it'll teach you the semantics to the syntaxes in a majority of object oriented langauges. Regardless it'll be much different from Python.
Java is an easier language to learn. Java and JavaScript aren't very similar other than the very basic concepts of programming
(Dec 4, 2015 09:33 PM)Wesley Snipes Wrote:  Java is an easier language to learn. Java and JavaScript aren't very similar other than the very basic concepts of programming


To add to this, Javascript is a fairly function-oriented language whereas Java is more object-oriented.

The syntax is pretty close too.


Java is a good transition to C++ as well
Signature space available.
(Dec 5, 2015 01:04 AM)CodeLeaks™ Wrote:  To add to this, Javascript is a fairly function-oriented language whereas Java is more object-oriented.

The syntax is pretty close too.


Java is a good transition to C++ as well

Wanted to say this. Because the same word is in bith names doesn't mean they are "about" the same. However if you know the basics of programming you will learn Java faster.
OP are you targeting certain applications or do you just want any compiled language under your belt?
(Dec 5, 2015 08:32 AM)ItsUzi Wrote:  OP are you targeting certain applications or do you just want any compiled language under your belt?

I do just need a compiled language under my belt but the kind of things that I'll be coding are things that will be interesting to me such as rats, keyloggers, internet marketing tools. I don't want to start work on a new game engine or anything else over the top but I need to know an all round compiled language that will let me write nice code to put logic in to an existing game engine for small edits at a time.
(Dec 5, 2015 12:15 PM)Feanor Wrote:  I do just need a compiled language under my belt but the kind of things that I'll be coding are things that will be interesting to me such as rats, keyloggers, internet marketing tools. I don't want to start work on a new game engine or anything else over the top but I need to know an all round compiled language that will let me write nice code to put logic in to an existing game engine for small edits at a time.

You're better off with C if you want to code rats, key loggers and other hidden hacking stuff.
(Dec 5, 2015 12:15 PM)Feanor Wrote:  I do just need a compiled language under my belt but the kind of things that I'll be coding are things that will be interesting to me such as rats, keyloggers, internet marketing tools. I don't want to start work on a new game engine or anything else over the top but I need to know an all round compiled language that will let me write nice code to put logic in to an existing game engine for small edits at a time.

Give C# a try.
Java and Javascript are very different. You could learn for sure but the "Easyness" depends on your skill level and how fast you pick up new languages


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Java] by Tr3stApr 30, 2023 06:49 PM 9 364 Apr 30, 2023 06:49 PM
Last Post: Anunymux
[.NET] by Mendax47Mar 11, 2017 02:31 AM 7 290 Mar 11, 2017 02:31 AM
Last Post: Cecilia
[Java] by 3 HunnaOct 30, 2015 10:24 AM 25 588 Oct 30, 2015 10:24 AM
Last Post: MrOrang