Java vs JavaScript vs Ruby - Let's clear things out

I've seen a lot of people confusing Java for Javascript and saying bad things about Ruby without any real context, so I'm making this topic to clear things out, hopefully will be marked as sticky.

When I was younger, I thought Java was a shortened word for Javascript, it's not!

They are completely different languages, like Java is Spanish and Javascript is English.

Ruby wasn't a bad language by itself, but Javascript is much more widely used,

infact, Javascript is the only programming language natively available to

browsers, so as you can imagine, not only is used everywhere (phones, computers,

tablets, etc.), but it's also well known. So the main advantage of this language

over Ruby, it's definitely that much more people use it.

In addition, the Ruby implementation that was used in Rpg Maker was very old and

missed Rubygems, which is probably one of the main reason why one would use Ruby.

Anyway, let's compare the syntax of the three languages!

JavaScript

(note for experienced developers: I'm not going to dig into not using new or using ES6 classes)

Code:
function Person() {}Person.prototype.doSomething = function() {  console.log("Hello World");};myPerson = new Person();myPerson.doSomething(); 
Ruby
Code:
class Person  def dosomething    puts "Hello World"  endendmyperson = Person.newmyperson.dosomething
Java
Code:
public class Person {  public void doSomething() {    System.out.println("Hello World");  }}// The following lines are required in Java because the main entry point must// be expressed in this waypublic class Main {  public static void main(String[] args) {    Person myPerson = new Person();    myPerson.doSomething();  }}
As you can see, there are huge differences between Javascript (which is written as one word) and Java, they are used in widely different context and the syntax is completely different.
You made such a lengthy post when all you had to do is to write "The difference between Java and Javascript is like difference between ham and a hamster".
You made such a lengthy post when all you had to do is to write "The difference between Java and Javascript is like difference between ham and a hamster".
I said that multiple times (and I was told that) but people couldn't get the difference. Then I showed syntax to them and they understood, that's why the long post 😉
I'd like to also throw in JS is ahead of Ruby in terms of performance speed, too. 

A good chunk of the reason why XP, VX, and VX Ace lagged is because of Ruby's interpreter base (partially because of the inefficient Game Interpreter, but that's something for another discussion). This is the main cause for the necessity of anti-lag scripts when it comes to mapping and whatnot. The likelihood of needing anti-lag scripts/plugins for MV will be rather low because of the JavaScript base.

JavaScript, however, has its own downsides, too. It lacks the swiss-army-knife toolset that Ruby has plus the code isn't as clean looking as Ruby's. Ruby allows the coder to do advanced things with ease while JavaScript requires a forest of brackets to replicate those very same things. Not a real big disadvantage, but more of a matter of convenience vs inconvenience.

Soooooooooooo

For non-coders, MV will be king. Faster base performance, little to no need for anti-lag, and the larger platform support will be all due to JavaScript. For coders, MV may or may not be your cup of tea. JavaScript is a language worth learning, but it comes with its fair share of headaches, too.
Well according to the video/trailer for MV....just learn Javascript and stop complaining (to those that are). The End  😀
Well according to the video/trailer for MV....just learn Javascript and stop complaining (to those that are). The End  😀
No need to complain, as I said, Javascript syntax (ES3-5) wasn't that great, so a lot of transpiler were born.


Yes, there is a Ruby to JS transpiler actively maintained: http://opalrb.org/


And people might also want to try TypeScript or CoffeeScript which are great. Otherwise, go with babel or traceur and you can get ES6 syntax, which is fine.
To the person who has been asking the same question over and over and over in this thread (which nobody else can see because they don't have the 2 approved posts to pass the moderator approval requirement), look here.
To the person who has been asking the same question over and over and over in this thread (which nobody else can see because they don't have the 2 approved posts to pass the moderator approval requirement), look here.
Can you link that thread about what MV will/won't do in that topic you created? I was looking for such topic but couldn't find it
So, why do you think RubyGems is the only reason someone would want to use Ruby?
So, why do you think RubyGems is the only reason someone would want to use Ruby?
Ahem, from my post:

In addition, the Ruby implementation that was used in Rpg Maker was very old and

missed Rubygems, which is probably one of the main reason why one would use Ruby.
I never said (and would never say) that it's the only reason. Ruby is by far my (currently) favourite programming language. I use it extensively at work and I'm really happy with it.
A good chunk of the reason why XP, VX, and VX Ace lagged is because of Ruby's interpreter base (partially because of the inefficient Game Interpreter, but that's something for another discussion). This is the main cause for the necessity of anti-lag scripts when it comes to mapping and whatnot. The likelihood of needing anti-lag scripts/plugins for MV will be rather low because of the JavaScript base.
lol no. You're throwing the baby out with the bathwater. You're overlooking the actual reasons. (GDI+, lack of GPU usage and RTP scripts.)
lol no. You're throwing the baby out with the bathwater. You're overlooking the actual reasons. (GDI+, lack of GPU usage and RTP scripts.)
Oh thanks, I didn't have any data but while Ruby is slower than Javascript, I don't think it would have impacted rendering on such small resolutions.

I wasn't aware that the rendering was done with GDI+ (without the GPU!!!), that explains a lot.

I'm a bit concerned about the JS implementation, I hope they provide some sort of "threading support" (through webworkers or similar) because forking doesn't seem like a good option if you have to run something in parallel without blocking the rendering.
JavaScript is an object-oriented scripting language that allows you to create dynamic HTML pages, allowing you to process input data and maintain data, usually within the browser.

Java is a programming language, core set of libraries, and virtual machine platform that allows you to create compiled programs that run on nearly every platform, without distribution of source code in its raw form or recompilation. More on....Java and Javascript

Jo

Original thread: https://forums.rpgmakerweb.com/threads/java-vs-javascript-vs-ruby-lets-clear-things-out.45133/