Following your message Jeroen, there it also is on Wikitech-l now.
-------- Message transféré --------
Sujet : Re: [Wikidata] Imperative programming in Lua, do we really want
Date : Wed, 6 Dec 2017 23:53:17 +0100
De : Jeroen De Dauw <jeroendedauw(a)gmail.com>
Répondre à : Discussion list for the Wikidata project.
Pour : Discussion list for the Wikidata project.
While I am not up to speed with the Lua surrounding Wikidata or
MediaWiki, I support the call for avoiding overly imperative code where
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 want to avoid if you want your code to be maintainable, easy
to understand and testable. Since Lua supports OO and functional styles,
the language is not an excuse for throwing well establishes software
development practices out of the window.
If the code is currently procedural, I would recommend establishing that
new code should not be procedural and have automawted tests unless there
is very good reason to make an exception. If some of this code is
written by people not familiar with software development, it is also
important to create good examples for them and provide guidance so they
do not unknowingly copy and adopt poor practices/styles.
John, perhaps you can link the code that caused you to start this thread
so that there is something more concrete to discuss?
(This is just my personal opinion, not some official statement from
PS: I just noticed this is the Wikidata mailing list and not the
Wikidata-tech one :(
Jeroen De Dauw | https://entropywins.wtf
Software craftsmanship advocate | Developer at Wikimedia Germany
On 6 December 2017 at 23:31, John Erling Blad <jeblad(a)gmail.com
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 functional programming with
chainable calls, but other might want something different?
Wikidata mailing list