lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, 17 Oct 2013 16:22:56 +0200
Dario Dominin <dario.dominin@gmail.com> wrote:

> Guys,
> I know that my question maybe be consider stupid .. but I can use LUA
> to build complex app? Like interaction with external website/server?
> 
> Like .. click the photo and upload somewhere...
> 
> Because in several guides that Im reading .. they explain you only
> how to build a simple game..
> 
> thx for the help
> 
> Dario

Dario,

Years ago I occasionally got hired to write apps that were 25K lines of
code. Back then, there was no Lua, and that's a shame.

If I got hired today to make a 25K lines app, and the decision of
language would be mine alone, then I would choose Lua unless one of
these:

1) The problem domain required a specialized functionality for which
   I couldn't find a working and tested library, or
2) The app needed compiler runtime speed, in which case I'd code it in
   C. But maybe with Lua for the portions that weren't speed critical:
   C and Lua mix pretty well.

My belief is that because Lua's one and only data aggregator is the
table, building up the complex data structures is a snap, and you never
dead end with a wrong data type. Lua's First Class Functions (buzzword
meaning you can pass em around and store em like data) makes for
trivial use of callback functions, a powerful technique too seldom used
because it's such a PITA in C and some other languages.

Thankfully, Lua doesn't try to enforce All OOP All the Time like Java,
Smalltalk and the like. In fact, Lua has no Class or Object type.
Instead, you build things with data and functions joined together, with
encapsulation, inheritance (if you want, via metatables), and to some
extent, polymorphism. They're not called classes and objects, but they
sure do the same things. 

I use Python and AWK a lot because today my programs are usually less
than 400 lines and need to get done in an hour or a day. With Python I
can be pretty sure it has the libraries I need, whereas with Lua I'd
need to research and experiment. But with a big project expected to take
months, taking even a week off for research and experimentation is no
big deal if the language itself enables you to shave a month off your
development time.

Thanks,

SteveT

Steve Litt                *  http://www.troubleshooters.com/
Troubleshooting Training  *  Human Performance