Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: Can somebody explain this to me Date: Wed, 07 Jan 2015 17:22:40 +0100 Organization: PointedEars Software (PES) Lines: 36 Message-ID: <1676759.bbBSSFFLiy@PointedEars.de> References: <1590597.KOVAYohEvS@PointedEars.de> <060120151734221023%timstreater@greenbee.net> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1420647784 24863 eJwFwYEBACAEBMCVEl7Gifz+I3TnCkGHwWFO58E2hnZrRtce7WWy39w8WmNltSidfNSLKf8fIhG/ (7 Jan 2015 16:23:04 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Wed, 7 Jan 2015 16:23:04 +0000 (UTC) User-Agent: KNode/4.14.2 X-User-ID: eJwFwYEBwDAEBMCVwuOTcVD2H6F3jpBoWniYry9L5+ZQHHAN+AdK9uFg56xmvqgrJSlLK1aP6VdHQpGv+wdL3xWn Cancel-Lock: sha1:W9leJhSNxhQ1XrkhQCeOPchOYGw= X-NNTP-Posting-Host: eJwNx8EBwCAIA8CVBCHCOBHK/iPY+51vCOoYHObjQ2Bf0qaWVMSiajqjBUG50Xr4of8zxxP1ACJUEWA= Xref: csiph.com comp.lang.javascript:26485 Christoph M. Becker wrote: > John Harris wrote: >> "Christoph M. Becker" wrote: >>> John's argument might be regarded secondary (if not invalid) nowadays. >> >> It's still primary. Seeing where function definitions start and >> finish, quickly, is vital to maintenance programmers. > > ACK. However, many contemporary editors are able to display vertical > lines joining the starting and ending line of a "block" ("indentation > guides"), what is IMO even clearer than aligned braces. Furthermore > there is code folding and "jump to matching brace" available even in non > graphical editors (e.g. vim). Indeed. Eclipse JSDT, for example, has had all of that for a while now (vertical indent guides come with LiClipse [1]). But I recently discovered the very useful “%” input in Vim; with the “matchit” add-on, it even works with start and end tags. But ISTM that John still has not realized that I did _not_ recommend to write *all* opening braces of functions on the same line as the “function” keyword, but only those of function *expressions*; and that indentation does not enter into it (you can and should indent the function body with either form). It is because, as is obvious from the above, he has not realized yet that there are (at least) two ways to “define” a function in ECMAScript, of which one includes a *declaration*. ______ [1] -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not cc me. / Bitte keine Kopien per E-Mail.