Re: [Wikidata] Imperative programming in Lua, do we really want it?

2017-12-08 Thread Jan Dittrich
I have no easy solutions either but one observation: Copy paste culture seems to be huge on wiki* and people want to get stuff done quickly. So a common practice is to search for something, tweak it and move on. Inferring from own experience: This style is probably easier with procedural code. I a

Re: [Wikidata] Imperative programming in Lua, do we really want it?

2017-12-07 Thread John Erling Blad
There are some really weird modules out there, I'm not sure whether it makes a good discussion environment to point them out. My wild guess is that the modules turn into an imperative style because the libraries (including Wikibase), returns fragments of large table structures. To process the frag

Re: [Wikidata] Imperative programming in Lua, do we really want it?

2017-12-06 Thread Jeroen De Dauw
Hey, While I am not up to speed with the Lua surrounding Wikidata or MediaWiki, I support the call for avoiding overly imperative code where possible. Most Lua code I have seen in the past (which has nothing to do with MediaWiki) was very imperative, procedural and statefull. Those are things you

[Wikidata] Imperative programming in Lua, do we really want it?

2017-12-06 Thread John Erling Blad
With the current Lua environment we have ended up with an imperative programming style in the modules. That invites to statefull objects, which does not create easilly testable libraries. Do we have some ideas on how to avoid this, or is it simply the way things are in Lua? I would really like fun