Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsfeed.datemas.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="ISO-8859-1" Message-ID: <7182976.Ku1byVuyr4@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Thu, 29 Aug 2013 15:16:19 +0200 User-Agent: KNode/4.10.5 Content-Transfer-Encoding: 7Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. <2725916.yAnYnyUf7L@PointedEars.de> <2920459.yuR5o6d9W1@PointedEars.de> MIME-Version: 1.0 Lines: 50 NNTP-Posting-Date: 29 Aug 2013 15:16:20 CEST NNTP-Posting-Host: ccb5e70e.newsspool1.arcor-online.net X-Trace: DXC=5`VDHB6^8K;T2Rfi64Fo<]lROoR1nkgeX?EC@@0E^]7Dg`Z:Q:DZm8W4\YJN X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.javascript:21096 Cezary Tomczyk wrote: > On 2013-08-28 01:27, Thomas 'PointedEars' Lahn wrote: >> Cezary Tomczyk wrote: >>> On 2013-08-27 23:02, Thomas 'PointedEars' Lahn wrote: >>>> Ken wrote: >>> [...] >>>>> Now you can call the function: >>>>> >>>>> loadImages(myArray, loadDone); >>>>> >>>>> function loadDone(result) { >>>>> console.log('All images loaded!'); >>>>> /// result contains an array with the Image elements >>>>> } >>>> >>>> Function expressions are widely supported by now, especially where >>>> console.log() is supported [1]: >>>> >>>> loadImages(myArray, function (result) { >>>> console.log('All images loaded!'); >>>> /* result contains an array with the Image elements */ >>>> }); >>> >>> [...] >>> >>> While function expressions support is fine now then passing as a >>> parameter in the "loadImages" function with long code can make whole >>> "loadImages" later harder to maintenance. >> >> (_maintain_) True. OTOH, functions/methods should not be long. > > Exactly what I meant. I do not think so. You have argued that using function expressions in function calls can pose a readability issue because functions can be long. I have argued that functions/methods should not be long in the first place (but larger pieces should be moved into separate functions/methods, which are then called in the original function/method). So the problem you see is not supposed to exist in well-written code in the first place. > Regarding "_maintain_" - thanks. You're welcome. -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.