lua-users home
lua-l archive

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


On Fri, Mar 4, 2011 at 1:54 AM, Chris Babcock <cbabcock@asciiking.com> wrote:
> Java has a strong culture of code
> reuse. Python, less so. Lua, even less than Python. There's probably a
> good reason there that doesn't have anything to do with Java making it
> any easier to share code than any other language.

My take on this:

On Java, being an enterprise-endorsed language, there are committees
busy creating huge standards for almost any functionality imaginable,
often _before_ an implementation of such functionality (JSR xxx
anyone?).  Then, there appears a few big projects that implement the
standard.  Since the standards are so big, a complete implementation
is also a big project on itself.  Later, application developers find
that they need a little of that functionality.  Being (in big
proportion) also 'enterprisey' teams, they reach to documented
standards and find that it's an enormous task to reimplement.  The
only reasonable solution is to reuse an existing project, even if the
standardized API wasn't the simplest solution, it looks SO much easier
to adapt to the standard than to reimplement even a part of it.

On Python, things are a lot more informal.  even so, PEPs fill the
same role as JSRs, but they're far smaller and purposely leave parts
of functionality undefined.  With a dynamic language and duck typing,
interoperability isn't impaired with undefined parts, if well chosen.
Still, PEPs are well respected, and if there's one for your library,
better follow it.  If not, a popular library might 'seed' one.

On Lua, there are few standards; and those that exist are typically
just common idioms for you to implement things.  reusability is low
apart from popular C libraries (LuaSocket, LuaExpat).  Not only
because of the lack of standards but because making APIs 'comfortable'
is highly valued, but everybody has a slightly different idea of
comfort.  Finally, reimplementing is fun in Lua!  just see the
informal 'snippet contests' that appear here from time to time.  :-)

-- 
Javier