Thread Tools Display Modes
01-16-11, 04:35 AM   #1
lilsparky
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 117
Originally Posted by mroz123 View Post
Try to get used to program everything in lua from the start. I think it's much better then using XML in the long run.
Also do not start with libraries. I almost want to pull my hair out when I see totally trivial addon using ton of libraries.
another reason to avoid libraries when just learning how things are working is that libraries often obfuscate how things are working by hooking base functions or mimicking widget classes. since lua is effectively typeless, there aren't any declarations to let you know that "myGUIFrame" is a wow api frame vs an ace widget or some other possible entity.
  Reply With Quote
01-16-11, 08:17 AM   #2
desfido
A Defias Bandit
Join Date: Mar 2005
Posts: 2
Originally Posted by lilsparky View Post
since lua is effectively typeless
It's not. It's a strongly typed language with dynamic typing. Saying it's effectively typeless is no more useful, nor accurate, than saying C is effectively typeless (since it's weakly typed).

The important piece of information you are trying to convey is that in lua, the type of variables isn't explicitly declared, which is something entirely separate and distinct from whether there is an effective lack of types.

I understand why this issue comes up with folks -- Lua is more generous with allowing arithmetic values to be used in string contexts than someone might otherwise expect, and many people have the misfortune to have mostly programmed only with some combination of Java, C, and C++ and therefore don't always think clearly about the ideas of implicit type declarations and dynamic typing. But I think calling Lua "effectively typeless" conveys misinformation about a very practical aspect of CS theory and the Lua language.
  Reply With Quote
01-16-11, 09:13 AM   #3
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
Originally Posted by desfido View Post
Lua is more generous with allowing arithmetic values to be used in string contexts than someone might otherwise expect,
That's called Coercion right? or am I mistaking it for something else ><
  Reply With Quote
01-16-11, 09:57 AM   #4
desfido
A Defias Bandit
Join Date: Mar 2005
Posts: 2
Originally Posted by Ketho View Post
That's called Coercion right? or am I mistaking it for something else ><
You're correct.

One thing that I'd definitely make a note of, though, is that coercion occurs in statically typed languages as well, particularly the ones people tend to be most familiar with (C, C++, Java). While they don't directly say that it doesn't in your link, they write in such a way that it could be incorrectly inferred that coercion is about static vs dynamic typing, when it's not. In fact, one that many people who write in C, C++, & Java often make use of without thinking about it is the implicit coercion from integer types to floating point types.
  Reply With Quote

WoWInterface » Developer Discussions » Dev Tools » How do I get started in Addon programming?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off