User blog:SannaSK/Sanna Vs Lua - Round 1

Hi. I'm Sanna. Technically, I made this username several years ago, but I didn't really start editing in earnest until Feb 2015. I spend almost all my time on the Disgaea Wiki. I have a shallow background (spread over nearly 20 years) in HTML, CSS, and PHP/MySQL, and still Wikicode threw me for multiple loops. There is logic, but there's enough finicky fiddly-bits to be really frustrating. It feels like documentation is either sporadic, or nub-unfriendly. I always meant to go through and write up blog posts about the things I was learning -- the goal I had, the way to not do it, and the right Wikicode way to get done what I was trying to do. I Googled up massive amounts of pages when trying to learn how to make templates, and sometimes, other users' forum threads or blog posts had helped me. My goal with making my series of blog posts would be to add one more 'help thread' into the mix.

Now I'm trying to learn LUA, and specifically, LUA as Wikia uses it (via Modules, and not through a standalone compiler program). Not gonna lie, I'm drowning pretty badly. But if you're reading this blog, you probably are too. Maybe something I say will help you.

So. Sanna Vs Lua, Round 1. Let's start with links. Why am I trying to learn Lua?
 * http://community.wikia.com/wiki/Thread:814377 - "How many #switch is too many #switch?" The short version is, I was trying to make one Wikicode template do five highly related but very slightly different jobs at the same time, and it was going to cause around 500 #switch to be on a single page. This is bad. I was told to go learn LUA, if what I wanted was to really have one template do all those jobs.
 * Why is 500 #switch bad? http://en.wikipedia.org/wiki/Wikipedia:Template_limits#Preprocessor_node_count

I've read all the text on these pages, and some of it has been helpful.
 * Non-Wikia pages:
 * http://en.wikiversity.org/wiki/Lua - If you have never heard of Lua before, start with this page. The thing I like the best about this page is that, the pages under the 'Scribunto/Lua Language' heading, they tell you what to write, and then at the bottom they address every command and function and whatever and say what it does. I find that very helpful. This page is geared towards the idea that you're writing the Lua code in Wiki Modules, not a compiler. Upside of this page: It explains small chunks of information clearly. Downside of this page: It doesn't cover much ground, and you will probably get to the end, still have large quantities of questions, and not be sure where to go next.
 * http://en.wikibooks.org/wiki/Scribunto:_An_Introduction - At first glance, this page duplicates the Wikiversity/Lua one. However, they differ pretty quickly. As of April 2015, most of the articles are red-linked (they have not been created), and what is there is, at first glance, nothing more than what's on Wikiversity/Lua. I would recommend reading Wikiversity/Lua first, and then reading Wikibooks:SAI, as W:SAI tends to say a few different and informative things that W/L does not. W:SAI does not do the handy breakdown of every command, like W/L does; and most of the examples given tend to assume the user has access to a 'debug console,' which does not seem to exist on Disgaea Wiki. Hopefully in the future, this page will be beefed up more. Downside: Covers almost entirely the same ground as W/L. Upside: The few new things it says are helpful, and make sense because I read W/L first.
 * http://tylerneylon.com/a/learn-lua/ - "Learn Lua in 15 Minutes (more or less)". Some things here are helpful. Some things lose me pretty quickly. This feels like it will have greater value for me as a reminder reference sheet, once I understand what all that means in the first place.
 * http://www.mediawiki.org/wiki/Lua/Tutorial - On the 'Dev.Wikia/Lua Templating' page, under 'See also', this was linked as 'Tutorial on MediaWiki'; this page finally started to explain what 'frame' and 'args' were.
 * http://en.wikipedia.org/wiki/Wikipedia:Lua_style_guide#Naming_conventions - I tried to test something with having a function name that involved a dash (ie, 'function p.1-23') which broke the code, and I was hoping this would tell me why that failed. It did not.


 * Other-Wikia Pages:
 * http://dev.wikia.com/wiki/Lua_templating - When I was first trying to learn, I came across this page. I'm mixed on how helpful this is, from the point of view of 'complete nub.' I tried to look at the 'in-use' examples under the 'Navbox Implementations' section, specifically the Professor Layton ones, and wow, that is above my skill level. Like, at this point in the journey, that thing has a skull where its level should be. There's so much linked to from this page, and right now, so little of it makes sense.
 * http://dev.wikia.com/wiki/Lua_templating/Reference_manual - Also way above my current skill level.
 * http://dev.wikia.com/wiki/Board%3ALua_Help - The Help Board for Lua questions. Doesn't get many new threads. This either means that the people using Lua on Wikia sites are competent and don't have many questions, or else that there's not an influx of Lua learners, and so people like me (total nubs, drowning) are kind of a rarity.


 * Community.Wikia threads:
 * http://community.wikia.com/wiki/Thread:801652 - "Converting a large #switch template to a Lua module" (the Candy Crush template). This thread came up a lot when I was Googling about #switch and templates, but interestingly, did not come up at all once I started Googling about Lua. Thanks, Google. Still, it doesn't help me, because I'm that much of a Lua-nub, and this thread gets too far into Lua too quickly.
 * http://community.wikia.com/wiki/Thread:786040 - "if all switches are empty, then..." (Broadchurch wiki) This thread doesn't help me much. It goes fairly quickly from "I can't solve this with Wikicode" to "Now I have nitty-gritty questions about LUA" with no intervening steps. But Google returns it frequently, so it gets linked here.

So this is a collection of most of the links I've come across. There are several other pages that I've been able to Google up, but apparently I closed those tabs long ago enough that I can't find them right now. I should be able to edit this blog post in the future when I come across more links. I'm disabling commenting because I have no idea how much time it might ever take to deal with managing comments. Also, I am eminently unqualified to answer specific questions. Anything I know will be in these posts. If it's not in the posts, I probably couldn't help you anyway. I don't know if these posts qualify for the category 'Wiki Advice' or what, so I'll leave that category off for now.

Good luck to me! Good luck to you! SannaSK (talk) 17:17, April 18, 2015 (UTC)