valueDiff for arrays?
Mark Waddingham
mark at livecode.com
Sun Aug 5 18:22:58 EDT 2018
On 2018-08-06 00:07, Brian Milby via use-livecode wrote:
> So this syntax:
> filter filterSource by [keeping | discarding] [[the] {lines | items |
> keys
> | elements}] {matching [wildcard | regex] pattern filterPattern | where
> filterExpression} [into targetContainer]
>
> Would allow a shortened version:
> filter X by matching pattern "regex" into Z
> Which would expand to:
> filter X by keeping the lines matching regex pattern "regex" into Z
TOP:
Yes - I realized earlier on that the shortened versions do no harm, and
in all honesty I don't think the negated forms do either.
At the end of the day they all map through a well-defined (admittedly,
hypothetical) mechanical process to a set of unambiguous preferred forms
- so there is no problem with meaning.
Indeed, a lot of how we code is down to personal taste. I run a team of
programmers, and so we have to have rules internally which everyone
follows - just like if you try and run a team where everyone speaks an
entirely different natural language, you are going to have significant
problems in communication; teams of programmers communicate in code a
lot, so its important that everyone largely 'speaks' the same language
(well 'dialect' is probably a more accurate term here).
So I'll certainly be suggesting that should the new variant form appear
that a review criteria of LCS code will be (internally) negated forms
are banned - just swap keeping <-> discarding; and the style rules for
the open-source project will mandate the same.
Similarly - shortened versions would be too under the same auspices.
This isn't anything to do with being dictatorial or just a control-freak
- its about ensuring consistency of communication. Every line of code
which we write that goes into the product needs to endure for a long
time and be read by many people - so its best that its made as uniform
as possible at the start.
What people outside those spheres wish to do is entirely up to them -
although I'd urge people to generally use the preferred forms in all
cases in your own code, its not like I can come and beat you all around
the head if you don't.
(Of course, I *can* just not allow them to be included... GOTO TOP).
Warmest Regards,
Mark.
--
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps
More information about the use-livecode
mailing list