What is closure in Swift? Is it similar to callback in Javascript?

Which is a better language to learn for a new programmer, Lua or JavaScript?

  • I'm thinking of using the or SDK to develop some mobile games. The first uses Lua and the latter uses JavaScript. I think JavaScript is more useful in other settings (e.g. web development) so I'm inclined to choose the latter. But are there places where learning Lua would come in useful too? See also:

  • Answer:

    If your intention is to stick with games and in particular game scripting, Lua is a very quick way to learn how to get a lot done. In most other scenario's, I'd start with Javascript, as it has far more applications outside of gaming and is the premier language of the web. If your ambition is to become a professional programmer, you probably want to look at non-script languages as well, once you're comfortable with whichever you pick. Either C# or Java is a good choice right now.

Jaap van der Velde at Quora Visit the source

Was this solution helpful to you?

Other answers

Lua. Lua is much more consistent as a language than JavaScript. It was developed slowly by a small team and, as a result, lacks a lot of the weirdness that can cause so much astonishment in JS. Lua is perhaps a saner environment in which to learn many of the paradigms that Lua and JS have in common. My one concern with learning Lua first might be that it is a language that has very few idioms. You will probably be tempted to ask someone, as you learn, if a given paradigm is the "right way" to do what you're attempting in Lua. Lua has very few "right ways". Typically, the right way is whichever way works for you. However, this makes reading others' code and seeing how they do things all the more important than more idiomatic languages.

Tanner Rogalsky

JavaScript.For a new programmer, the last thing you want is to get stuck at some problem and not be able to find help. The JavaScript community is huge and you're going to find a solution for almost any problem you could encounter with a simple Google search. At this moment, JavaScript is the most popular tag in Stack Overflow (http://stackoverflow.com/tags). Although I know there are important frameworks that use Lua as a scripting language, JavaScript is by far more widespread. If you learn JavaScript you can easily jump to many other areas like web development (both front-end and back-end).Even if you are interested in games right now, you shouldn't underestimate the power of the web. These days web development can mean more than just dealing with HTML forms and basic database requests. You can render 3D graphics in your browser with WebGL (http://threejs.org/), you have physics engines in JavaScript (http://kripken.github.io/ammo.js/examples/webgl_demo_softbody_volume/index.html) and you can also use WebSockets to create real-time online games (http://browserquest.mozilla.org/).

Junior Rojas

You can easily develop games with Lua rather than Javascript. Games levels in World of Warcraft and Grim Fandango were written in Lua. You can check out thishttp://webuilddesign.com/learning-lua/. Hope this is helpful...

Tanvir Hasan

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.