lua-users home
lua-l archive

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



This is exactly how you should do (create all the software components but leave the user to connect them).

I'm doing similar work for meteorologists, at the moment. Some things that come to my mind:

- keep it simple. abstraction of the elements you provide must be "right" - above the simple (but maybe complex for end users) API you can easily create any kind of wrappers in Lua, based on what the users really _seem_ to be needing (or together with them, which is even better so they understand what's going on behind the scenes but still can go the "easy way").

Because of historical use, we've i.e. introduced variables of A_B or A_B_C type. The A,B and C are actually parameters and all of that converts on-demand (via _G __index metamethod) to a function call that is way more elaborate. This gives users the easy "variable style" access but also the "function style" access that provides more control. I.e. if a data doesn't exist, A_B_C will cast an error whereas function type returns "nil, err" as usual in Lua.

One more thing. Some often used strings s.a. "T" for temperature are bound to globals (T="T"). This means users don't need to give the quotes if they say 'param=T' or something.

In my understanding, Lua suits perfectly to crafting an easy-entry non- programmer language. The key is to converse with your target audience and get to know its habits and current way of thinking.

-asko


King, Mike kirjoitti 20.5.2009 kello 21:53:

Has anyone worked on or know of a project where non-programmers would use Lua to accomplish a task? I have been given the task of creating a program where the goal is to help non-programmers setup and capture data from different sensors. The program will need to be able to control different equipment. The problem is that what needs to be recorded and what needs to be control is unknown. My plan is create all the needed software components but leave the user to connect them together. I’ve heard some refer to this type of code as “glue” code. Is this a bad idea? CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is confidential or proprietary to K&L Microwave, Inc. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, immediately contact the sender by reply e-mail and destroy all copies of the original message.