From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Garreau\, Alexandre" Newsgroups: gmane.emacs.help Subject: Naming, and Gnus functions length [Was: Re: Knowing where a function has been used (bis) [Was: Re: Optimising Elisp code]] Date: Mon, 08 Oct 2018 17:37:34 +0200 Message-ID: <87pnwk5u0x.fsf_-_@portable.galex-713.eu> References: <638fb7dc-6fc5-4645-8793-97a00038a3a8@googlegroups.com> <8hxojvzzzzzz.m4h.xxuns.g6.gal@portable.galex-713.eu> <20181006192457.GB7368@tuxteam.de> <86lg79yl54.fsf@zoho.com> <86d0slrb4h.fsf@zoho.com> <86pnwkpltx.fsf@zoho.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1539013012 12876 195.159.176.226 (8 Oct 2018 15:36:52 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 8 Oct 2018 15:36:52 +0000 (UTC) User-Agent: Gnus (5.13), GNU Emacs 25.1.1 (i686-pc-linux-gnu) Cc: Lars Magne Ingebrigtsen To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 08 17:36:48 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g9XaR-0003GZ-SO for geh-help-gnu-emacs@m.gmane.org; Mon, 08 Oct 2018 17:36:48 +0200 Original-Received: from localhost ([::1]:46944 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9XcY-0003QW-9p for geh-help-gnu-emacs@m.gmane.org; Mon, 08 Oct 2018 11:38:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9XbJ-0002vB-6E for help-gnu-emacs@gnu.org; Mon, 08 Oct 2018 11:37:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g9XbI-0002Gf-8H for help-gnu-emacs@gnu.org; Mon, 08 Oct 2018 11:37:41 -0400 Original-Received: from portable.galex-713.eu ([2a00:5884:8305::1]:46922) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g9XbH-0002EH-Rx for help-gnu-emacs@gnu.org; Mon, 08 Oct 2018 11:37:40 -0400 Original-Received: from localhost ([::1] helo=portable.galex-713.eu) by portable.galex-713.eu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1g9XbC-0005w8-UI; Mon, 08 Oct 2018 17:37:35 +0200 X-GPG-FINGERPRINT: E109 9988 4197 D7CB B0BC 5C23 8DEB 24BA 867D 3F7F X-Accept-Language: fr, en, it, eo In-Reply-To: <86pnwkpltx.fsf@zoho.com> (Emanuel Berg's message of "Mon, 08 Oct 2018 16:14:18 +0200") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:5884:8305::1 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:118208 Archived-At: On 2018-10-08 at 16:14, Emanuel Berg wrote: > If you have studied the Gnus source code, you find that the defuns are > insanely long. They go on all but forever. This is because Gnus is > already slow, and perhaps Elisp is as well, so they don't want to > brake it up into modules (smaller defuns) because then it would > require the funcall overhead. Perhaps Gnus would benefit from inlining > stuff? Maybe Gnus functions length are just a question of style. I guess their developers are experienced enough to know how to properly use manual inlining. And anyway, as, as you pointed it, Gnus can already be sometimes quite slow, it=E2=80=99s probably more because of I/O than functi= on call overhead, so this later must be neglictible in comparison. So Gnus functions length is probably unrelated. I put Gnus dev in copy (hoping it=E2=80=99s relevant to the conversation an= d not inapropriated to the situation) in case that can help getting more relevant answers for this. I personally myself tend to write really big functions, because I like to have well-named things, and dislike to repeat myself and/or have a lot of intermediary values and functions with bad names and poor semantics, so until I come with a proper and nice semantic abstraction I keep stuff in the same function. This is unlike some languages like scheme, ocaml, etc. which potentially requires recursion for loops in some cases, therefore obligating you to give a name to each loop of your programs (thus potentially resulting in needing a lot of names, and even potentially bad or complicated ones). Also unlike pre-algebraic languages which may force you in using lot and lot of temporary variables, which will inevitably result in either using very, I find, poor names (such as =E2=80=9Cdouble_x =3D x * 2=E2=80=9D), ei= ther totally non-sensical and confusing names such as =E2=80=9CA=E2=80=9D, =E2=80=9CB=E2= =80=9D, =E2=80=9CC=E2=80=9D, etc. (TeX is a notable example where a lot of the loops use recursions, and stuff like that, you end up needing many names and ending with names with strange semantics such as =E2=80=9C@=E2=80=9D, double-=E2=80=9C@=E2=80=9D, etc. eve= rywhere, resulting in cryptic code for the unexperienced).