Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #21053 > unrolled thread
| Started by | Tuxedo <tuxedo@mailinator.com> |
|---|---|
| First post | 2013-08-27 16:32 +0200 |
| Last post | 2013-08-28 16:26 +0100 |
| Articles | 10 on this page of 30 — 9 participants |
Back to article view | Back to comp.lang.javascript
Multiple image preload construct? Tuxedo <tuxedo@mailinator.com> - 2013-08-27 16:32 +0200
Re: Multiple image preload construct? Tuxedo <tuxedo@mailinator.com> - 2013-08-27 17:06 +0200
Re: Multiple image preload construct? Danny <dann90038@gmail.com> - 2013-08-27 10:29 -0700
Re: Multiple image preload construct? Ken <usenet-so@abdiassoftware.com> - 2013-08-27 13:32 -0500
Re: Multiple image preload construct? Tuxedo <tuxedo@mailinator.com> - 2013-08-27 20:54 +0200
Re: Multiple image preload construct? Ken <usenet-so@abdiassoftware.com> - 2013-08-27 18:19 -0500
Re: Multiple image preload construct? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-08-28 01:37 +0200
Re: Multiple image preload construct? Ken <usenet-so@abdiassoftware.com> - 2013-08-27 18:47 -0500
Re: Multiple image preload construct? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-08-27 23:02 +0200
Re: Multiple image preload construct? Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2013-08-27 23:20 +0200
Re: Multiple image preload construct? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-08-28 01:27 +0200
Re: Multiple image preload construct? Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2013-08-29 03:56 +0200
Re: Multiple image preload construct? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-08-29 15:16 +0200
Re: Multiple image preload construct? Ken <usenet-so@abdiassoftware.com> - 2013-08-27 18:43 -0500
Re: Multiple image preload construct? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-08-28 02:08 +0200
Re: Multiple image preload construct? Ken <usenet-so@abdiassoftware.com> - 2013-08-27 19:49 -0500
Re: Multiple image preload construct? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-08-28 03:17 +0200
Re: Multiple image preload construct? Ken <usenet-so@abdiassoftware.com> - 2013-08-27 20:35 -0500
Re: Multiple image preload construct? Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-08-29 19:32 +0100
Re: Multiple image preload construct? John Harris <niam@jghnorth.org.uk.invalid> - 2013-08-28 16:20 +0100
Re: Multiple image preload construct? Andrew Poulos <ap_prog@hotmail.com> - 2013-08-28 11:21 +1000
Re: Multiple image preload construct? Ken <usenet-so@abdiassoftware.com> - 2013-08-27 20:48 -0500
Re: Multiple image preload construct? Andrew Poulos <ap_prog@hotmail.com> - 2013-08-28 13:43 +1000
Re: Multiple image preload construct? John Harris <niam@jghnorth.org.uk.invalid> - 2013-08-29 10:00 +0100
Re: Multiple image preload construct? Andrew Poulos <ap_prog@hotmail.com> - 2013-08-30 07:25 +1000
Re: Multiple image preload construct? John Harris <niam@jghnorth.org.uk.invalid> - 2013-08-30 10:11 +0100
Re: Multiple image preload construct? Christoph Michael Becker <cmbecker69@arcor.de> - 2013-08-28 02:17 +0200
Re: Multiple image preload construct? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-08-28 02:38 +0200
Re: Multiple image preload construct? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-08-28 11:04 +0200
Re: Multiple image preload construct? John Harris <niam@jghnorth.org.uk.invalid> - 2013-08-28 16:26 +0100
Page 2 of 2 — ← Prev page 1 [2]
| From | Andrew Poulos <ap_prog@hotmail.com> |
|---|---|
| Date | 2013-08-28 11:21 +1000 |
| Message-ID | <xp-dnXAaA9kuzYDPnZ2dnUVZ_q2dnZ2d@westnet.com.au> |
| In reply to | #21070 |
On 28/08/2013 10:49 AM, Ken wrote: > On 27.08.2013 19:08, Thomas 'PointedEars' Lahn wrote: >> Bad examples are *bad* examples. You should post good examples, >> especially as followup to beginners. > > That's still your opinion. The example works fine - what's easy to read > is up to the eye of the beholder. I'd probably wouldn't hire anyone that presented an example such as yours as an example of their work. > It seems as you are assuming beginner is the same as "has no brain". If > so I disagree. Refuting a bogus claim! > And for the other claims, please provide some evidence and I will be > happy to look at it. Why? Its already been shown that you have incorrect/incomplete understanding yet you try to pretend otherwise. Andrew Poulos
[toc] | [prev] | [next] | [standalone]
| From | Ken <usenet-so@abdiassoftware.com> |
|---|---|
| Date | 2013-08-27 20:48 -0500 |
| Message-ID | <kvjkv5$jqc$1@speranza.aioe.org> |
| In reply to | #21072 |
On 27.08.2013 20:21, Andrew Poulos wrote: > On 28/08/2013 10:49 AM, Ken wrote: >> On 27.08.2013 19:08, Thomas 'PointedEars' Lahn wrote: >>> Bad examples are *bad* examples. You should post good examples, >>> especially as followup to beginners. >> >> That's still your opinion. The example works fine - what's easy to read >> is up to the eye of the beholder. > > I'd probably wouldn't hire anyone that presented an example such as > yours as an example of their work. You don't know any of my work. You have seen a single example to help a user along (more than what you and caveman have produced so far). And I am not hired - I am the one hiring. If a person would state something like you do here he would not be fit to hire anyone (not that I think you are in any position to hire anyone). But that's anyways off-topic. > >> It seems as you are assuming beginner is the same as "has no brain". If >> so I disagree. > > Refuting a bogus claim! > >> And for the other claims, please provide some evidence and I will be >> happy to look at it. > > Why? Its already been shown that you have incorrect/incomplete > understanding yet you try to pretend otherwise. > > Andrew Poulos > The only thing shown here is that you together with pointy-hat are unable to produce any example of your own. You seem to be more concerned on protecting your caves here it seems and attacking anyone coming close to the cave. Whatever makes you happy :-) Have a nice evening. -- Ken Fyrstenberg Abdias Software http://abdiassoftware.com/ (remove usenet- from address)
[toc] | [prev] | [next] | [standalone]
| From | Andrew Poulos <ap_prog@hotmail.com> |
|---|---|
| Date | 2013-08-28 13:43 +1000 |
| Message-ID | <lNednbfJvapx7IDPnZ2dnUVZ_oqdnZ2d@westnet.com.au> |
| In reply to | #21074 |
On 28/08/2013 11:48 AM, Ken wrote: > On 27.08.2013 20:21, Andrew Poulos wrote: >> On 28/08/2013 10:49 AM, Ken wrote: >>> On 27.08.2013 19:08, Thomas 'PointedEars' Lahn wrote: >>>> Bad examples are *bad* examples. You should post good examples, >>>> especially as followup to beginners. >>> >>> That's still your opinion. The example works fine - what's easy to read >>> is up to the eye of the beholder. And my opinion as well. >> I'd probably wouldn't hire anyone that presented an example such as >> yours as an example of their work. > > You don't know any of my work. You have seen a single example to help a > user along (more than what you and caveman have produced so far). And I > am not hired - I am the one hiring. If a person would state something > like you do here he would not be fit to hire anyone (not that I think > you are in any position to hire anyone). But that's anyways off-topic. In the very next sentence you contradict the statement you made in the first sentence. And then you continue to make up facetious statements about people you don't know to back your fictitious conclusions. >>> It seems as you are assuming beginner is the same as "has no brain". If >>> so I disagree. >> >> Refuting a bogus claim! >> >>> And for the other claims, please provide some evidence and I will be >>> happy to look at it. >> >> Why? Its already been shown that you have incorrect/incomplete >> understanding yet you try to pretend otherwise. >> >> Andrew Poulos >> > > The only thing shown here is that you together with pointy-hat are > unable to produce any example of your own. So you're right because I haven't provided an example, LOL. > You seem to be more concerned on protecting your caves here it seems and > attacking anyone coming close to the cave. Whatever makes you happy :-) No calling people names when you've demonstrated a lack of understanding in a technical field is not appropriate. > Have a nice evening. Pleasant dreaming. Andrew Poulos
[toc] | [prev] | [next] | [standalone]
| From | John Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| Date | 2013-08-29 10:00 +0100 |
| Message-ID | <7d3u19p6ln5m3r9vp3sehsj2vs6q4lge1k@4ax.com> |
| In reply to | #21075 |
On Wed, 28 Aug 2013 13:43:16 +1000, Andrew Poulos <ap_prog@hotmail.com> wrote: <snip> >No calling people names when you've demonstrated a lack of understanding >in a technical field is not appropriate. Yes indeed! Thomas Lahn is the only one with permission to do that in this group. John
[toc] | [prev] | [next] | [standalone]
| From | Andrew Poulos <ap_prog@hotmail.com> |
|---|---|
| Date | 2013-08-30 07:25 +1000 |
| Message-ID | <PMSdncuciKX_IYLPnZ2dnUVZ_vidnZ2d@westnet.com.au> |
| In reply to | #21095 |
On 29/08/2013 7:00 PM, John Harris wrote: > On Wed, 28 Aug 2013 13:43:16 +1000, Andrew Poulos > <ap_prog@hotmail.com> wrote: > > > <snip> >> No calling people names when you've demonstrated a lack of understanding >> in a technical field is not appropriate. > > Yes indeed! Thomas Lahn is the only one with permission to do that in > this group. Well done, you've managed to use my criticism of one person's posting to try to cause distress to another. Andrew Poulos
[toc] | [prev] | [next] | [standalone]
| From | John Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| Date | 2013-08-30 10:11 +0100 |
| Message-ID | <tbo029he72b5agsan8u5712ta59k9i6ubb@4ax.com> |
| In reply to | #21110 |
On Fri, 30 Aug 2013 07:25:31 +1000, Andrew Poulos <ap_prog@hotmail.com> wrote: >On 29/08/2013 7:00 PM, John Harris wrote: >> On Wed, 28 Aug 2013 13:43:16 +1000, Andrew Poulos >> <ap_prog@hotmail.com> wrote: >> >> >> <snip> >>> No calling people names when you've demonstrated a lack of understanding >>> in a technical field is not appropriate. >> >> Yes indeed! Thomas Lahn is the only one with permission to do that in >> this group. > >Well done, you've managed to use my criticism of one person's posting to >try to cause distress to another. Thank you for your compliment. Regarding your second point, it's not possible to cause distress to Thomas "If you can't stand the heat, stay out of the kitchen" Lahn. John
[toc] | [prev] | [next] | [standalone]
| From | Christoph Michael Becker <cmbecker69@arcor.de> |
|---|---|
| Date | 2013-08-28 02:17 +0200 |
| Message-ID | <521d4165$0$9512$9b4e6d93@newsspool1.arcor-online.net> |
| In reply to | #21065 |
Ken wrote: > Oh, this is not C, this is ECMAScript in the JavaScript flavor, a > dynamic language. Nothing is compiled, everything is interpreted. I assume most (if not all) recent ECMAScript implementations compile the source code instead of interpreting it. Mostly the compilation is to byte code, but some implementations are (also) JIT compiling to native machine code (e.g. Google's V8 JavaScript Engine). > If you > understand how interpreting works you would know this doesn't really > matter (and in this case the bottleneck is not the loop). I believe Thomas' criticism was not mainly regarding the performance, but about the readability (and maybe the stability) of the code. -- Christoph M. Becker
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2013-08-28 02:38 +0200 |
| Message-ID | <1740412.9NUzr5vJEA@PointedEars.de> |
| In reply to | #21068 |
Christoph Michael Becker wrote: > Ken wrote: >> Oh, this is not C, this is ECMAScript in the JavaScript flavor, a >> dynamic language. Nothing is compiled, everything is interpreted. > > I assume most (if not all) recent ECMAScript implementations compile the > source code instead of interpreting it. Mostly the compilation is to > byte code, but some implementations are (also) JIT compiling to native > machine code (e.g. Google's V8 JavaScript Engine). As a matter of historical fact, the maintainers of Netscape JavaScript and Microsoft JScript, Brendan Eich and Eric Lippert, respectively, have confirmed independently years ago that source code is *compiled* to bytecode by their browser-based script engines, and that this bytecode is executed by a virtual machine. (I might still find the respective statements.) So ISTM that, short of perhaps Netscape Mocha and LiveScript, *never* source code in a programming language that formed the basis of ECMAScript or that is based on ECMAScript has ever been interpreted verbatim, and it has always been compiled (whether you can call the subsequent execution of that bytecode by a virtual machine, or of native machine code by the CPU “interpretation” has always been a matter of hot debate). >> If you >> understand how interpreting works you would know this doesn't really >> matter (and in this case the bottleneck is not the loop). > > I believe Thomas' criticism was not mainly regarding the performance, > but about the readability (and maybe the stability) of the code. ACK. -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2013-08-28 11:04 +0200 |
| Message-ID | <3145125.oXMAan8fah@PointedEars.de> |
| In reply to | #21059 |
Thomas 'PointedEars' Lahn wrote:
> Ken wrote:
>> function loadImages(imgs, callback) {
>>
>> var i = 0, img, count = imgs.length, result = [];
>>
>> /// create images
>> for(; img = imgs[i]; i++) {
>
> That is awful code style for array iteration, in probably every language
> of the C family. Consider this instead:
>
> for (var i = 0, count = len = imgs.length; i < len; ++i)
> {
Considered and rejected :) This creates an “implied global”, “len” (a
ReferenceError in strict mode). It would have to be, for example
var count;
for (var i = 0, len = count = imgs.length; i < len; ++i)
to fix that.
var count = 0;
for (var i = 0, len = imgs.length; i < len; ++i)
and counting “count” up would work, too. If order does not matter,
var count;
for (var i = count = imgs.length; i--;)
and counting “count” down is an optimization to consider.
(Even though there is no block scoping with “var”, it is useful to keep the
declarations of variables that are only used in the loop close to the loop.)
--
PointedEars
Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.
[toc] | [prev] | [next] | [standalone]
| From | John Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| Date | 2013-08-28 16:26 +0100 |
| Message-ID | <hk5s19t38e5q88ep7ff45225c5gl7u6vvd@4ax.com> |
| In reply to | #21059 |
On Tue, 27 Aug 2013 23:02:47 +0200, Thomas 'PointedEars' Lahn <PointedEars@web.de> wrote: <snip> >In these languages (not C#), documentation comments are better written >/*… */, for “//” introduces single-line comments that are best used only >for disabling code (and be used carefully on Usenet with its not fully >defined line length). <snip> Definitely a minority opinion. John
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | comp.lang.javascript
csiph-web