lua-users home
lua-l archive

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


KHMan <keinhong@gmail.com> wrote:

> Sorry if anyone on the list thinks that this seems like more like
> hand-waving psychology mumbo-jumbo. But past discussions have got nowhere
> with technical arguments. We often forget the wetware inside our skulls --
> it's an important part of the coding process too. Should the brain comply
> obediently to language specifications, or should we help the brain to
> clearly express our intent. That is why we structure information, we lay
> out code in certain ways, etc. (Also, read Jakob Nielsen.)

I fully understand what you mean here... when I think of code I often
already have a structure in mind for how it should function. Having to
change that structure around when typing in the code can break that flow
and can even introduce bugs. If I see my code in a switch/case construct,
or even ternaries, then it can be a pain having to convert it to if/else!

The various structures we use for coding go along with how we think about
the code we are writing. In the book 1984 the language, Newspeak, was
created by removing words from the English language. In this way the manner
in which the people could think could be controlled. If eventually they
didn't have the words to conceive the thought, then they couldn't rebel.

I can see parallels here with programming languages, when you come from a
language with a robust syntax, think Perl, to one not as verbose, such as
Lua, it can be difficult to adjust... I know it took me a while to stop
trying to append my if statements on single expressions! However, once you
get used to the limited syntax and use it for a long time it may be harder
to think in terms of the constructs you haven't used for a long time.

One thing I always enjoy is discovering the uncommon syntax used by other
programming languages. It is always interesting to learn new ways I could
potentially think in terms of coding!

This desire to express my code with different structures is also what helps
drive my patching of Lua. That and a desire to hack and learn what makes
things work the way they do! :)

~Paige