Lua vs Java?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Buby
Prole
Posts: 15
Joined: Mon Dec 07, 2015 4:28 am

Lua vs Java?

Post by Buby »

Hey Guys!
Recently I have been thinking, is Java better than Lua? I have not learnt Java but am considering learning the language as it is compatible with most 3D game engines. I know that Java is more advanced than Lua but does it do all the same functions and use the same mechanics as Lua?
When I go into University I want to go into a course in Programming (I am only 13 and learning to script at this age). I am very fluent in Lua and just want to know if it is worth the time to learn Java. I am going over this because I am not sure if Java has the same functions as Lua.

I am also quite fluent in C++ and CSharp, but I do not like using either language as they are over coplicated, I wonder if that is the same with Java and if i will feel the same about it.

My Dad says that learning Java will help me excel in Uni, and I definitely agree with him. But will knowing Lua, C++ and C# be a substitute for Java?
Thanks In Advanced!

Code: Select all

if 2+2 == 5 then
   love.event.push('quit')
end
User avatar
CrackedP0t
Citizen
Posts: 69
Joined: Wed May 07, 2014 4:01 am
Contact:

Re: Lua vs Java?

Post by CrackedP0t »

Java is similar to C++ and extremely similar to C#. You'll probably have a similar experience with Java as the other two, depending on what frameworks/libraries you use. Lua is far easier to use and simpler than Java.

Also, asking whether Lua is better than Java is a bad comparison; it's like asking whether airplanes are better than motorboats. They're both good at different things.
/人 ◕‿‿◕ 人\
Here, have an umlaut. Ö
Buby
Prole
Posts: 15
Joined: Mon Dec 07, 2015 4:28 am

Re: Lua vs Java?

Post by Buby »

CrackedP0t wrote:Java is similar to C++ and extremely similar to C#. You'll probably have a similar experience with Java as the other two, depending on what frameworks/libraries you use. Lua is far easier to use and simpler than Java.

Also, asking whether Lua is better than Java is a bad comparison; it's like asking whether airplanes are better than motorboats. They're both good at different things.
Thanks! I will consider learning Java.
But what is Java good at?

Code: Select all

if 2+2 == 5 then
   love.event.push('quit')
end
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: Lua vs Java?

Post by s-ol »

Buby wrote:... it is compatible with most 3D game engines.
Uh... Which engines would that be? I can only think of jMonkeyEngine which is a very niche one. The big engines like UE and Unity mostly use C# for scripting and are themselves almost exclusively written in C++. Java is rarely used for game development because of the high abstraction level and the comparatively low performance.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
Buby
Prole
Posts: 15
Joined: Mon Dec 07, 2015 4:28 am

Re: Lua vs Java?

Post by Buby »

S0lll0s wrote:
Buby wrote:... it is compatible with most 3D game engines.
Uh... Which engines would that be? I can only think of jMonkeyEngine which is a very niche one. The big engines like UE and Unity mostly use C# for scripting and are themselves almost exclusively written in C++. Java is rarely used for game development because of the high abstraction level and the comparatively low performance.
I was thinking about Unity but since you say that and that Java isnt really used for games I just might not waste my time learning it.

Code: Select all

if 2+2 == 5 then
   love.event.push('quit')
end
User avatar
kbmonkey
Party member
Posts: 139
Joined: Tue Sep 01, 2015 12:19 pm
Location: Sydney
Contact:

Re: Lua vs Java?

Post by kbmonkey »

Hello Buby

- Java is geared more towards enterprise / business class applications.
- Java is seated in object-orientation, while Lua is multi-paradigm.
- Both are cross platform

Practically, for one example, this means that Java does not implement tail-recursion, so your code ends up heavily loop-based, where-as in Lua, where functions are first-class citizens, you can implement neat recursive functions. Sure you can do recursive calls in Java, but without extra thought and a lot of pain, you can easily cause stack overflows.

There are more job opportunities for Java programmers, but if you focus on the technical aspects, since you are already fluent in C++, learning Java may be beneficial if you earn credits, or your goal is building enterprise business systems in the future.

http://vschart.com/compare/lua/vs/java- ... g-language
ploaded
Prole
Posts: 4
Joined: Mon Dec 14, 2015 7:49 pm

Re: Lua vs Java?

Post by ploaded »

I'm not familiar with any engines that use Java for their scripting. Although there is Minecraft...

Java was developed to be a cross platform language for making applications. It takes care of a lot of the memory management stuff that you do in C/C++ (C# does the same thing with memory [garbage collection]). If you write accounting software and want to sell it to as many people as possible, Java would probably suit your needs. You'd only have to write the program once and could run it on any environment. It has some GUI libraries and it's definitely possible to write games in, but it runs on a virtual environment instead of native code (like c++/c assembly) which causes it to execute a bit slower. If you want to write software as a profession it's definitely a great language to learn. Most android apps are written exclusively in Java. In my opinion though, most PC/console games aren't going to have anything to do with Java.

Lua is a great scripting language for games because it's easy to learn and gets the job done without a bunch of verbose code (usually). I can't really recall any job postings looking for a LUA developer outside of game development. I'm not sure there is much outside of games based on LUA scripting.

Each language has its strengths and weaknesses. Java, C#, and C++ were designed to organize huge amounts of code. Interfaces, namespaces, prototypes, and abstact classes might seem confusing coming from the world of LUA scripting. I had a hard time figuring out what all that stuff was for back when I was at Uni writing little projects. Once you have to work on a piece of software consisting of 12 huge DLL modules and hundreds of thousands of lines of code written years ago, you learn to love and appreciate how all those tools make your code more flexible.

What type of job do you want to get after university? Robotics, web stuff, gaming, applications?
Buby
Prole
Posts: 15
Joined: Mon Dec 07, 2015 4:28 am

Re: Lua vs Java?

Post by Buby »

kbmonkey wrote:Hello Buby

- Java is geared more towards enterprise / business class applications.
- Java is seated in object-orientation, while Lua is multi-paradigm.
- Both are cross platform

Practically, for one example, this means that Java does not implement tail-recursion, so your code ends up heavily loop-based, where-as in Lua, where functions are first-class citizens, you can implement neat recursive functions. Sure you can do recursive calls in Java, but without extra thought and a lot of pain, you can easily cause stack overflows.

There are more job opportunities for Java programmers, but if you focus on the technical aspects, since you are already fluent in C++, learning Java may be beneficial if you earn credits, or your goal is building enterprise business systems in the future.

http://vschart.com/compare/lua/vs/java- ... g-language
Thanks! ill take that in note

Code: Select all

if 2+2 == 5 then
   love.event.push('quit')
end
Buby
Prole
Posts: 15
Joined: Mon Dec 07, 2015 4:28 am

Re: Lua vs Java?

Post by Buby »

ploaded wrote:I'm not familiar with any engines that use Java for their scripting. Although there is Minecraft...

Java was developed to be a cross platform language for making applications. It takes care of a lot of the memory management stuff that you do in C/C++ (C# does the same thing with memory [garbage collection]). If you write accounting software and want to sell it to as many people as possible, Java would probably suit your needs. You'd only have to write the program once and could run it on any environment. It has some GUI libraries and it's definitely possible to write games in, but it runs on a virtual environment instead of native code (like c++/c assembly) which causes it to execute a bit slower. If you want to write software as a profession it's definitely a great language to learn. Most android apps are written exclusively in Java. In my opinion though, most PC/console games aren't going to have anything to do with Java.

Lua is a great scripting language for games because it's easy to learn and gets the job done without a bunch of verbose code (usually). I can't really recall any job postings looking for a LUA developer outside of game development. I'm not sure there is much outside of games based on LUA scripting.

Each language has its strengths and weaknesses. Java, C#, and C++ were designed to organize huge amounts of code. Interfaces, namespaces, prototypes, and abstact classes might seem confusing coming from the world of LUA scripting. I had a hard time figuring out what all that stuff was for back when I was at Uni writing little projects. Once you have to work on a piece of software consisting of 12 huge DLL modules and hundreds of thousands of lines of code written years ago, you learn to love and appreciate how all those tools make your code more flexible.

What type of job do you want to get after university? Robotics, web stuff, gaming, applications?

After Uni i would love to be a Game Developer, but reading this makes me think i should just stick with LUA. If not that I can take over my dad's business, a data center.

Code: Select all

if 2+2 == 5 then
   love.event.push('quit')
end
bobbyjones
Party member
Posts: 730
Joined: Sat Apr 26, 2014 7:46 pm

Re: Lua vs Java?

Post by bobbyjones »

If you want to be a game developer I would continue with c++ as your main language and lua as your scripting language. Most places won't hire a lua programmer. The job market for lua programmers is extremely limited. Of course I have not gotten a job in the industry but most people I know who have, use c++ and have experience building engines from the ground up.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests