Archive for the 'Uncategorized' Category

04
Jun
10

Making progress on the site…

I am quite excited about the progress that has been made for the site (dungeonz.com).  I have taken the time to build a system that allows additional content to be added easily.  The best part was that I had a great time writing the code, fixing the bugs and getting it to work in multiple browsers.

I’ve been learning quite a bit about HTML, ASP, PhotoShop, Script# and JavaScript while getting to travel back in time reading some of my old D&D books looking for interesting tables to publish.

Browsing the web looking for other examples has only served to give me confidence that I’m designing something useful, well, at least to me! I have received some validation from friends and family who also enjoy roleplaying games that the site is starting to shape up.

Honestly, while it feels good, I feel it still has a ways to go on the usability front. When I use the site on smaller displays (laptops, etc…), the site feels too big and sparse and I find myself wanting to have the information available in a dense format so I don’t have to do any scrolling.

Also, there are nuance features that I desire, like clearing the rolled list or the ability to mail the results easily to myself or perhaps have the site remember my rolls for me and provide a printable summary page.

Work, work, work!  But, in a fun way.

Enough for now. I have work to do!

11
Jun
09

Getting to Know Lua

I’ve been spending the last few weeks looking over the Lua programming language as part of my effort to expand my knowledge.  I wanted to pass on a few thoughts and impressions from developer perspective of someone who has many years of coding experience in C/C++, C# and JavaScript.

When I first started to view the syntax of Lua, it reminded me of a language that was closer to Visual Basic and JavaScript rather than C++ or C#.  The former being high-level, interpreted, non object-oriented and the latter having strong types, polymorphism and low-level constructs such as pointers.

I’m not going to digress into a long list of pros and cons.  That’s really a perspective best suited when there is a very specific goal in mind.  In my case, the goal was just to learn the language.  I might inject a personal comment here or there on items I found cool and items I thought might have been done differently.

First-off, resources:

There are many other resources out there if you have a particular project or focus for Lua.  Just use your favorite search engine.

One of the early things I heard about Lua is its performance and interpreter size being great for embedded designs.  These turned out to be true.  The code runs very fast and the disk and memory footprints are minimal compared to other interpreted environments.  This was so much part of the vision for Lua that even the regular-expression-like string capabilities are reduced to the most popular portions to minimize the performance and size of the environment.

Lua is not strongly typed.  Variables are able to change their type and be overridden at anytime.  This is similar to JavaScript.  The most interesting type in Lua is the Table type.  It is a combination of an Array and a Dictionary found in other languages.  Here is a list of the built-in types:

  • Boolean – Your basic true / false
  • Number – Floating point numbers (similar to JavaScript)
  • String – Character Arrays
  • Table – Mix of Array and Dictionary
  • Function – Code
  • Nil – Special (think of undefined in JavaScript)
  • Other – This represents extensions to the Lua language through the interpreter environment, often extended in C/C++.

Because Lua is a Reflective language, the developer is able to query the type of a variable by utilizing the type(<variable>) syntax.

While basic Lua does not have support for inheritance, polymorphism, etc… there have been some libraries created to emulate and add this functionality.  This is often done by manipulating a namespace table to override functions, yet still call a base implementation.

Namespaces can be implemented through a table and a little bit of Lua syntax sugar.  This creates a set of functions and properties that are scoped and can be instantiated to provide what looks to be class support in the code.  Note: This made me feel more comfortable with the Language coming from an object-oriented background.

Packages are a Lua concept to break a program up into modules and load those packages via a “dofile(<package name>)” function.  Package dependency can be specified via a “require <package name>” syntax often found near the top of a file.

One concept that took me a bit to grasp was that variables created are by default global in scope.  Only by prefixing variable declaration with the local keyword will the scope and lifetime of the object be limited.  Keeping this in mind is important if you are writing a large application or a library of functionality.

If you would like a more comprehensive description of the language, I encourage you to read the Wikipedia article (http://en.wikipedia.org/wiki/Lua_programming_language) or visit the Lua site, download the interpreter environment and play with it!




 

May 2012
M T W T F S S
« Jun    
 123456
78910111213
14151617181920
21222324252627
28293031  

Follow

Get every new post delivered to your Inbox.