lua-users home
lua-l archive

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


It was thus said that the Great Gregg Reynolds once stated:
> On Nov 21, 2016 11:54 AM, "Peter Hickman" <peterhickman386@googlemail.com>
> wrote:
> >
> > Wouldn't localisation actually hinder learning the (programming) language
> via code reading. Lets say I learn lua in Gujarati and want to learn from
> someone else's existing code only to find that it is written in the Chinese
> lua. I wouldn't stand a chance, my ability to learn would be severely
> diminished by my need to learn a dozen human languages just to be able to
> read the code.
> >
> 
> easy peasy: you just crank up your chinese-lua to gujarati-lua translator.
> it's a formal language, all the keywords etc. will translate perfectly.
> 
> objection: names for vars, fns, etc. won't translate. but that's not a new
> problem, and it's already possible to use a local language for those, and
> programmers in east Asia do so. even in English, as often as not the names
> are badly chosen, you have to read the code.

  Cornerstone (a DB language designed by Infocom [1]) had a unique feature
wereby variables you saw in the editor was *not* the name used internally. 
There was a map of internal names to visble names, so while you saw
something like (I don't know what Cornerstone looks like, so I'll use Lua
for an example):

	table.sort(info,function(a,b) a.key < b.key end)

it was, internally:

	V0001.V0002(V0003,K0001(V0004,V0005)
		V0004.V0006 < V0004.V0006
	K0002)

Want to change a variable name?  Just change the mapping, and *all*
instances of that variable will change.  Granted, you are stuck *in* the
Cornerstone environment with the Cornerstone editor, but it's an interesting
idea.

  -spc

[1]	Yes, the same Infocom that made text adventure games.