From dev-return-2226-apmail-freemarker-dev-archive=freemarker.apache.org@freemarker.apache.org Tue Jul 2 20:18:46 2019 Return-Path: X-Original-To: apmail-freemarker-dev-archive@minotaur.apache.org Delivered-To: apmail-freemarker-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with SMTP id 2B61E19969 for ; Tue, 2 Jul 2019 20:18:46 +0000 (UTC) Received: (qmail 94707 invoked by uid 500); 2 Jul 2019 20:18:45 -0000 Delivered-To: apmail-freemarker-dev-archive@freemarker.apache.org Received: (qmail 94679 invoked by uid 500); 2 Jul 2019 20:18:45 -0000 Mailing-List: contact dev-help@freemarker.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@freemarker.apache.org Delivered-To: mailing list dev@freemarker.apache.org Received: (qmail 94665 invoked by uid 99); 2 Jul 2019 20:18:45 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jul 2019 20:18:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id C05E9C0605 for ; Tue, 2 Jul 2019 20:18:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.899 X-Spam-Level: X-Spam-Status: No, score=-0.899 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=mac.com Received: from mx1-he-de.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id w_LZDRkSEPlm for ; Tue, 2 Jul 2019 20:18:43 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=17.58.6.56; helo=pv50p00im-ztdg10021801.me.com; envelope-from=bredelet@mac.com; receiver= Received: from pv50p00im-ztdg10021801.me.com (pv50p00im-ztdg10021801.me.com [17.58.6.56]) by mx1-he-de.apache.org (ASF Mail Server at mx1-he-de.apache.org) with ESMTPS id 3E45D7E208 for ; Tue, 2 Jul 2019 20:18:42 +0000 (UTC) Received: from [192.168.0.44] (unknown [90.195.49.50]) by pv50p00im-ztdg10021801.me.com (Postfix) with ESMTPSA id 34792360508 for ; Tue, 2 Jul 2019 20:18:34 +0000 (UTC) From: Denis Bredelet Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: Lambda Expressions - filter list without <#list> directive Date: Tue, 2 Jul 2019 21:18:30 +0100 References: <57989b5c-4c53-4101-a090-a39d09dbf7b5@me.com> <9410339568.20181217110407@freemail.hu> <803060961.20190223181919@freemail.hu> <826369433.20190224194006@freemail.hu> <124740694.20190225004643@freemail.hu> <1652497852.20190401003817@freemail.hu> <5510224991.20190529231427@freemail.hu> <641473117.20190624015921@freemail.hu> <1912652496.20190701093020@freemail.hu> <702132244.20190702202751@freemail.hu> <1d34e381-8430-23dd-2d23-980ded878d6f@valadd.com> To: dev@freemarker.apache.org In-Reply-To: <1d34e381-8430-23dd-2d23-980ded878d6f@valadd.com> Message-Id: X-Mailer: Apple Mail (2.3445.104.11) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-07-02_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1812120000 definitions=main-1907020226 > Le 2 juil. 2019 =C3=A0 20:29, Pete Helgren a =C3=A9cri= t : >=20 > As a more casual Java programmer, the "where" option is much clearer = to me. I spend more time using FM syntax than changing the Java = underneath, so from a "fading memory" standpoint, "where" would lead to = fewer "What the....?" moments, for me at least. I prefer =C2=AB where =C2=BB for the reasons Daniel mentioned, also SQL = uses WHERE. I think SQL has as many users as Javascript, no? =E2=80=94 Denis. >=20 > Pete Helgren > www.petesworkshop.com > GIAC Secure Software Programmer-Java > Twitter - Sys_i_Geek IBM_i_Geek >=20 > On 7/2/2019 2:08 PM, Christoph R=C3=BCger wrote: >> Good point. Seems you are not the first ones stumbling on that one. >> I quickly searched around and found: >>=20 >> Similar question on SO: >> https://stackoverflow.com/questions/45939202/filter-naming-convention >> Javascript: filter : >> = https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Obje= cts/Array/filter >> Spark SQL -> "where" is an alias for "filter": >> https://stackoverflow.com/a/33887122/135535 >> = >> -> search for "filter" or "where" on >> = https://spark.apache.org/docs/1.5.2/api/scala/index.html#org.apache.spark.= sql.DataFrame >> R Statistics Language : filter >> = https://cran.r-project.org/web/packages/dplyr/vignettes/dplyr.html#filter-= rows-with-filter >>=20 >> Python: filter https://www.geeksforgeeks.org/filter-in-python/ >> Ruby: they use select: >> = https://www.codementor.io/tips/8247613177/how-to-filter-arrays-of-data-in-= ruby >> Kotlin: filter: >> = https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/filter.htm= l >>=20 >> This languages rank in the upper area of the Stackoverflow survey: >> = https://insights.stackoverflow.com/survey/2019#technology-_-programming-sc= ripting-and-markup-languages >>=20 >> I agree that "where" reads pretty nice. I like it. But "filter" seems = to be >> found in multiple common languages supporting lambdaish syntax. >> Python and R is especially common in the data science / statistics >> community, which are different target group than e.g. = Java-Programmers. >> Also web-developers these days are doing lots of javascript to build = "html" >> websites / templates - and javascript also uses "filter". >>=20 >> My vote would still go for "filter", because I think we are working = on >> lists of objects and objects are closer to "programming" than to = "sql". >> Maybe the "where"-alias would be a compromise - but might also be = confusing >> two have both. >>=20 >> What do others think? >>=20 >> Thanks >> Christoph >>=20 >>=20 >>=20 >>=20 >>=20 >>=20 >>=20 >> Am Di., 2. Juli 2019 um 20:27 Uhr schrieb Daniel Dekany = >> : >>> I wonder if "filter" is a good name. For Java 8 programmers it's >>> given, but otherwise I find it confusing, as it's not clear if you >>> specify what to filter out, or what to keep. Worse, I believe in = every >>> day English "foo filter" or "filters foo" means removing foo-s = because >>> you don't want them, which is just the opposite of the meaning in >>> Java. So I think "where", which is familiar for many from SQL (for >>> most Java programmers as well, but also for non-Java programmers), >>> would be better. Consider: >>>=20 >>> users?filter(user -> user.inactive) >>>=20 >>> VS >>>=20 >>> users?where(user -> user.inactive) >>>=20 >>> The first can be easily misunderstood as removing the inactive = users, >>> while the meaning of the second is obvious. >>>=20