Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #36355 > unrolled thread

Re: Prevention of selection

Started byJJ <jj4public@vfemail.net>
First post2019-04-18 09:05 +0700
Last post2019-04-19 12:16 +0700
Articles 15 — 5 participants

Back to article view | Back to comp.lang.javascript

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Prevention of selection JJ <jj4public@vfemail.net> - 2019-04-18 09:05 +0700
    Re: Prevention of selection Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-04-18 04:45 +0200
    Re: Prevention of selection Julio Di Egidio <julio@diegidio.name> - 2019-04-17 23:46 -0700
      Re: Prevention of selection Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-04-18 15:14 +0200
        Re: Prevention of selection Julio Di Egidio <julio@diegidio.name> - 2019-04-18 22:50 -0700
          Re: Prevention of selection Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-04-19 15:49 +0200
            Re: Prevention of selection John G Harris <niam@jghnorth.org.uk.invalid> - 2019-04-19 15:15 +0100
              Re: Prevention of selection Julio Di Egidio <julio@diegidio.name> - 2019-04-19 08:35 -0700
            Re: Prevention of selection Julio Di Egidio <julio@diegidio.name> - 2019-04-19 08:53 -0700
              Re: Prevention of selection Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-04-20 03:27 +0200
                Re: Prevention of selection Julio Di Egidio <julio@diegidio.name> - 2019-04-20 01:54 -0700
                Re: Prevention of selection Julio Di Egidio <julio@diegidio.name> - 2019-04-20 02:00 -0700
            Re: Prevention of selection "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2019-04-19 20:37 -0700
              Re: Prevention of selection Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-04-20 12:41 +0200
      Re: Prevention of selection JJ <jj4public@vfemail.net> - 2019-04-19 12:16 +0700

#36355 — Re: Prevention of selection

FromJJ <jj4public@vfemail.net>
Date2019-04-18 09:05 +0700
SubjectRe: Prevention of selection
Message-ID<1jpvv3qulw0us$.me8a8r3yda1d.dlg@40tude.net>
On 17 Apr 2019 23:57:01 GMT, Stefan Ram wrote:
> 
> doReset = () => span.innerHTML = +span.innerHTML + 1;

Shouldn't that function reset the number instead of incrementing it?

[toc] | [next] | [standalone]


#36356

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2019-04-18 04:45 +0200
Message-ID<79dc4469-af30-53a2-43f3-36aa8a9582f1@PointedEars.de>
In reply to#36355
JJ wrote:
> On 17 Apr 2019 23:57:01 GMT, Stefan Ram wrote:
>> doReset = () => span.innerHTML = +span.innerHTML + 1;
> 
> Shouldn't that function reset the number instead of incrementing it?

In any case, that function should never be written that way.

Avoid .innerHTML as it requires expensive serialization and parsing.  If the
content is only a text node, use .textContent instead:

  doReset = (() => { span.textContent = +span.textContent + 1; })

    [As you can see here, use parentheses to signify arrow functions,
     and only use the shorthand return if you are actually returning
     something.]

And if feasible, read the content only once and then use the stored value to
write the proeprty value.

If the content is markup, create element objects and append a document
fragment instead (which will append all its children in one step):

  var fragment = document.createDocumentFragment();
  // …
  fragment.appendChild(…);
  fragment.appendChild(…);
  fragment.appendChild(…);
  target.appendChild(fragment);

See also: <https://github.com/airbnb/javascript>

-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#36359

FromJulio Di Egidio <julio@diegidio.name>
Date2019-04-17 23:46 -0700
Message-ID<d4c648c8-616d-471c-8d89-231ae9870d3b@googlegroups.com>
In reply to#36355
On Thursday, 18 April 2019 04:05:36 UTC+2, JJ  wrote:
> On 17 Apr 2019 23:57:01 GMT, Stefan Ram wrote:
> > 
> > doReset = () => span.innerHTML = +span.innerHTML + 1;
> 
> Shouldn't that function reset the number instead of incrementing it?

No, that +span.innerHTML is a conversion to number: it's a super ugly way
by recent javascripters to convert to number, as well as, as already noted
by others, it's a super inefficient and again super ugly way to present
results in the DOM.

Julio

[toc] | [prev] | [next] | [standalone]


#36363

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2019-04-18 15:14 +0200
Message-ID<dc2220b4-1c61-171f-12cb-a5ef4507c955@PointedEars.de>
In reply to#36359
Julio Di Egidio wrote:
> On Thursday, 18 April 2019 04:05:36 UTC+2, JJ  wrote:
>> On 17 Apr 2019 23:57:01 GMT, Stefan Ram wrote:
>>> doReset = () => span.innerHTML = +span.innerHTML + 1;
>> Shouldn't that function reset the number instead of incrementing it?
> 
> No, that +span.innerHTML is a conversion to number: […]

Certainly, but “JJ”’s gripe was with what the function does as opposed to
how it is named.

Either the function identifier is misleading or the function body is
algorithmically wrong.  This function should be named e.g. “increment” or
what it does should be changed so that it actually does reset something (in
which case it should be named ”reset”).

Also, the identifier – “doReset”, “increment”, or whatever – should be
declared in a “let”, “const” (with transpilers) or (also without, but
backwards-compatible) “var” declaration, or it should be used in a method
declaration (with transpilers) or a property definition (also without, but
backwards-compatible).

> […] as already noted by others, […]

New address, new killfile? ;-)

-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#36365

FromJulio Di Egidio <julio@diegidio.name>
Date2019-04-18 22:50 -0700
Message-ID<1fd5d379-b0dd-49e4-9253-f0590c4f6fde@googlegroups.com>
In reply to#36363
On Thursday, 18 April 2019 15:14:24 UTC+2, Thomas 'PointedEars' Lahn  wrote:
> Julio Di Egidio wrote:
> > On Thursday, 18 April 2019 04:05:36 UTC+2, JJ  wrote:
> >> On 17 Apr 2019 23:57:01 GMT, Stefan Ram wrote:
> >>> doReset = () => span.innerHTML = +span.innerHTML + 1;
> >> 
> >> Shouldn't that function reset the number instead of incrementing it?
> > 
> > No, that +span.innerHTML is a conversion to number: […]
> 
> Certainly, but “JJ”’s gripe was with what the function does as opposed to
> how it is named.

Sure, but who cares?  I have explained the interesting part, while your
considerations, i.e. your language preferences, are even more beside the
point than my explanations, in fact are more misleading than even useless.

> Either the function identifier is misleading or the function body is
> algorithmically wrong.  This function should be named e.g. “increment” or
> what it does should be changed so that it actually does reset something (in
> which case it should be named ”reset”).

Most "programmers" nowadays are just too stupid and too lazy to name things
properly, and just to begin with: which is the explanation, not algorithmically
wrong anything.

> Also, the identifier – “doReset”, “increment”, or whatever – should be
> declared in a “let”, “const” (with transpilers) [...]

Utter bullshit: ES>5 is *utter bullshit* and yet another blow to anything
reasonable or beautiful or alive on this planet.

> > […] as already noted by others, […]
> 
> New address, new killfile? ;-)

Neither, neither: and same morons, too.  ;)

*Plonk*

Julio

[toc] | [prev] | [next] | [standalone]


#36366

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2019-04-19 15:49 +0200
Message-ID<94bafca3-0c9b-ac48-9d5c-c8eb93c2b8f5@PointedEars.de>
In reply to#36365
Julio Di Egidio wrote:
> On Thursday, 18 April 2019 15:14:24 UTC+2, Thomas 'PointedEars' Lahn
> wrote:

It is called attribution line, not attribution novel.  Learn to quote.

>> Julio Di Egidio wrote:
>>> On Thursday, 18 April 2019 04:05:36 UTC+2, JJ  wrote:
>>>> On 17 Apr 2019 23:57:01 GMT, Stefan Ram wrote:
>>>>> doReset = () => span.innerHTML = +span.innerHTML + 1;
>>>> Shouldn't that function reset the number instead of incrementing
>>>> it?
>>> No, that +span.innerHTML is a conversion to number: […]
>> Certainly, but “JJ”’s gripe was with what the function does as opposed
>> to how it is named.
> 
> Sure, but who cares?

Everyone interested in a *constructive* discussion.  Apparently it is still
escaping your attention that the question asked by “JJ” was “Shouldn't that
function *reset* the number instead of incrementing it?” (emphasis mine) to
which you answered “No” (which, no matter how it is interpreted, is the
*wrong* answer) and then went off track to explain something that nobody had
visibly wondered about (what unary “+” means).

> I have explained the interesting part,

Nobody had visibly wondered about what you have explained in the first
place.  You are not paying attention.

> while your considerations, i.e. your language preferences, are even more 
> beside the point

Not at all.  “JJ” asked a rhetorical question, implying the question
“Why was this function named ‘doReset’ when it does not actually reset
anything?” and the conclusion “It should not be”.

I have explained the situation to you twice now.  How many more times will
be required?  Are you even able to admit a mistake that you made?

> than my explanations, in fact are more misleading than even useless.

Not at all.  It is important for code to be easily understandable so that it
is easily, i.e. efficiently, maintainable.  In *professional* software
development, time is money *literally*.  Using misleading function
identifiers and misleading syntax (such as indicating a return value when
the return value is probably never 1used) is not a good idea.

>> Either the function identifier is misleading or the function body is 
>> algorithmically wrong.  This function should be named e.g. “increment”
>> or what it does should be changed so that it actually does reset
>> something (in which case it should be named ”reset”).
> 
> Most "programmers" nowadays are just too stupid and too lazy to name
> things properly, and just to begin with: which is the explanation, not
> algorithmically wrong anything.

ISTM that you are making the argument here that because there are
incompetent people we should all become incompetent and behave
irresponsibly.  If so, then I am relieved that it is not up to you to set
the standards according to which source code is being written and judged.

>> Also, the identifier – “doReset”, “increment”, or whatever – should be 
>> declared in a “let”, “const” (with transpilers) [...]
> 
> Utter bullshit:

Not at all.

> ES>5 is *utter bullshit*

You have no clue what you are talking about.  *Professional* software
developers like me have been using ES 6(+) for years to write efficiently
concise, less error-prone code.  This is why there are the Airbnb JavaScript
Code Guidelines (referred to in my previous follow-up) and tools like ESLint
to check source code (against them).

However, since using unsupported syntax can be a compatibility issue
*client-side* (you cannot be sure which runtime environment your code will
be exposed to), transpilers (transcoding compilers) like Babel
<https://babeljs.io/> are being used in the build process to produce ES
5-conforming code from ES 6+ conforming code *automatically*.  This often
removes the need for deferring to explicit workarounds like polyfills and is
an important evolutionary step in ECMAScript-based software development,
following the conclusions in my bachelor’s thesis (2012).

AISB, where I am working now we are using Babel as a Node module, triggered
by another Node module, Webpack: <https://github.com/babel/babel-loader>
(I did not introduce this.)

> and yet another blow to anything reasonable or beautiful or alive on this
> planet.

Obviously you are not an authority on reason, beauty, or *real* life on this
planet.

>>> […] as already noted by others, […]
>> New address, new killfile? ;-)
> 
> Neither, neither: and same morons, too.  ;)
> 
> *Plonk*

You do not understand what a rhetorical question is, do you?

My *rhetorical* *tongue-in-cheek* question (see the *smiley*) expressed my
amusement of your irrational behavior.  Because either you are unaware of
what “*Plonk*” means in Usenet (adding a person to one’s killfile, NOT
reading their postings anymore) or you have been lying to us all the time as
you were referring to *my* posting in the other subthread (so you *have*
read it, even though you “*Plonk*“ed me before).  (Either one would be
unsurprising given your antisocial attitude.)

So, in conclusion, you have only changed your *address*.  That’s a pity.

-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#36367

FromJohn G Harris <niam@jghnorth.org.uk.invalid>
Date2019-04-19 15:15 +0100
Message-ID<osljbel0386a0ur110cmk89su53gp52ece@4ax.com>
In reply to#36366
On Fri, 19 Apr 2019 15:49:04 +0200, Thomas 'PointedEars' Lahn
<PointedEars@web.de> wrote:

>Julio Di Egidio wrote:
>> On Thursday, 18 April 2019 15:14:24 UTC+2, Thomas 'PointedEars' Lahn
>> wrote:
>
>It is called attribution line, not attribution novel.  Learn to quote.
  <snip>

Obviously Julio should have written this :-

>> On Thursday, 18 April 2019 15:14:24 UTC+2, Thomas Lahn wrote:

  John

[toc] | [prev] | [next] | [standalone]


#36368

FromJulio Di Egidio <julio@diegidio.name>
Date2019-04-19 08:35 -0700
Message-ID<05f12619-ffbf-4a19-8c01-128245034d80@googlegroups.com>
In reply to#36367
On Friday, 19 April 2019 16:15:54 UTC+2, John G Harris  wrote:
> On Fri, 19 Apr 2019 15:49:04 +0200, Thomas 'PointedEars' Lahn
> <PointedEars@web.de> wrote:
> 
> >Julio Di Egidio wrote:
> >> On Thursday, 18 April 2019 15:14:24 UTC+2, Thomas 'PointedEars' Lahn
> >> wrote:
> >
> >It is called attribution line, not attribution novel.  Learn to quote.
>   <snip>
> 
> Obviously Julio should have written this :-
> 
> >> On Thursday, 18 April 2019 15:14:24 UTC+2, Thomas Lahn wrote:

In fact, it's that "Julio Di Egidio wrote:" that is utterly inappropriate
as it is completely useless for finding the post he is replying to, which
is the very point of that "attribution line".

Which of course is just the tip of the iceberg with that eight year old
delusions self-righteous moron, whose great merit is that he is as stupid
as our demented times require...

Julio

[toc] | [prev] | [next] | [standalone]


#36369

FromJulio Di Egidio <julio@diegidio.name>
Date2019-04-19 08:53 -0700
Message-ID<d84434af-4f0c-4706-b1b6-01559ae6801c@googlegroups.com>
In reply to#36366
On Friday, 19 April 2019 15:49:09 UTC+2, Thomas 'PointedEars' Lahn  wrote:
> Julio Di Egidio wrote:
> > On Thursday, 18 April 2019 15:14:24 UTC+2, Thomas 'PointedEars' Lahn
> > wrote:
> 
> It is called attribution line, not attribution novel.  Learn to quote.

Just LOL.

> >> Julio Di Egidio wrote:
> >>> On Thursday, 18 April 2019 04:05:36 UTC+2, JJ  wrote:
> >>>> On 17 Apr 2019 23:57:01 GMT, Stefan Ram wrote:
> >>>>> doReset = () => span.innerHTML = +span.innerHTML + 1;
> >>>> Shouldn't that function reset the number instead of incrementing
> >>>> it?
> >>> No, that +span.innerHTML is a conversion to number: […]
> 
> >> Certainly, but “JJ”’s gripe was with what the function does as opposed
> >> to how it is named.
> > 
> > Sure, but who cares?
> 
> Everyone interested in a *constructive* discussion.

Fuck off, you and those two trolls: *I* am the one constructive around
here, while you are stupid and delusional and an arrogant ass at that.

> > than my explanations, in fact are more misleading than even useless.
> 
> Not at all.  It is important for code to be easily understandable

Sure, idiot, it's THE HOW you realise those fucking slogans that makes
the difference between competent and your fucking cluelessness.

> > Most "programmers" nowadays are just too stupid and too lazy to name
> > things properly, and just to begin with: which is the explanation, not
> > algorithmically wrong anything.
> 
> ISTM that you are making the argument here that because there are
> incompetent people we should all become incompetent and behave
> irresponsibly.

ISTY because you are full of shit: which is your problem, not mine.

> > ES>5 is *utter bullshit*
> 
> You have no clue what you are talking about.  *Professional* software
> developers like me have been using ES 6(+) for years

You bloody retard, your "for years" is not even half of my career, and
your technical reasons, which I have snipped for decency, are LUDICROUS
at best!

> to write efficiently concise, less error-prone code.

Sure, moron...

> > and yet another blow to anything reasonable or beautiful or alive on this
> > planet.
> 
> Obviously you are not an authority on reason, beauty, or *real* life on this
> planet.

I have been an authority on these matters since before you stopped drinking
milk, you stupid fuck just full of shit...

> >>> […] as already noted by others, […]
> >> New address, new killfile? ;-)
> > 
> > Neither, neither: and same morons, too.  ;)
> > 
> > *Plonk*
> 
> You do not understand what a rhetorical question is, do you?
> My *rhetorical* *tongue-in-cheek* question (see the *smiley*)

And have you see my *smiley* in reply, you self-deluded blind moron?
What is it, you can use rhetoric but what I say holds to the letter,
you aspiring nazi fuck??

> Because either you are unaware of what “*Plonk*” means in Usenet

MORON: the fact that you rewrite history and wrong articles on WP is YOUR
insanity: I'll keep calling thing by their name for as long as I am around.
That said, I have even taken the time, not once,not twice, but at lest trice,
to explain TO YOU WHAT I MEAN by "plonk", so at best you should disagree with
me, not demonstrate again and again that you are fucking demented...

Go fuck yourself.

*Plonk*

Julio

[toc] | [prev] | [next] | [standalone]


#36373

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2019-04-20 03:27 +0200
Message-ID<769ebcd8-cdd4-d9cb-b276-4d349a25af95@PointedEars.de>
In reply to#36369
Julio Di Egidio wrote:
> On Friday, 19 April 2019 15:49:09 UTC+2, Thomas 'PointedEars' Lahn  wrote:
>> Julio Di Egidio wrote:
>>> On Thursday, 18 April 2019 15:14:24 UTC+2, Thomas 'PointedEars' Lahn
>>> wrote:
>> It is called attribution line, not attribution novel.  Learn to quote.
> 
> Just LOL.

Simple minds are easily amused.

>>>> Julio Di Egidio wrote:
>>>>> On Thursday, 18 April 2019 04:05:36 UTC+2, JJ  wrote:
>>>>>> On 17 Apr 2019 23:57:01 GMT, Stefan Ram wrote:
>>>>>>> doReset = () => span.innerHTML = +span.innerHTML + 1;
>>>>>> Shouldn't that function reset the number instead of incrementing
>>>>>> it?
>>>>> No, that +span.innerHTML is a conversion to number: […]
>>
>>>> Certainly, but “JJ”’s gripe was with what the function does as opposed
>>>> to how it is named.
>>>
>>> Sure, but who cares?
>>
>> Everyone interested in a *constructive* discussion.
> 
> Fuck off, […] ou and those two trolls:

It takes one to know one.

> *I* am the one constructive around

LOL.  You poor lunatic.

> ES>5 is *utter bullshit*

Once again:

<https://github.com/airbnb/javascript#ecmascript-6-es-2015-styles>

>> You have no clue what you are talking about.  *Professional* software
>> developers like me have been using ES 6(+) for years
> 
> You bloody retard,

He who has no reasonable arguments thinks that the only thing that he has
left is to throw insults.  Something of it might stick, he thinks.
How very wrong he is, deconstructing himself.

> your "for years" is not even half of my career,

With that antisocial attitude it is highly unlikely that you have a career,
much more likely that you have a detainment cell.  I wonder, might that be
the *actual* source of your frustration?

> and your technical reasons, which I have snipped for decency, are LUDICROUS
> at best!

Bare assertion fallacy.

>> to write efficiently concise, less error-prone code.
> 
> Sure, moron...

Yes, sure.  I could give you many examples, but you make it obvious that
collecting them for you would already be a waste of time.  Learn to read.

>>> and yet another blow to anything reasonable or beautiful or alive on this
>>> planet.
>>
>> Obviously you are not an authority on reason, beauty, or *real* life on this
>> planet.
> 
> I have been an authority on these matters since before you stopped drinking
> milk, you stupid fuck just full of shit...

LOL.  Take your pills.

>>>>> […] as already noted by others, […]
>>>> New address, new killfile? ;-)
>>>
>>> Neither, neither: and same morons, too.  ;)
>>>
>>> *Plonk*
>>
>> You do not understand what a rhetorical question is, do you?
>> My *rhetorical* *tongue-in-cheek* question (see the *smiley*)
> 
> And have you see my *smiley* in reply, you self-deluded blind moron?

The difference is that you do not mean it because you obviously have no
sense of humor, only a lot of repressed (and now partially released) anger.

I pity you.

> What is it, you can use rhetoric but what I say holds to the letter,
> you aspiring nazi fuck??

Godwin’s Law.  You lose.

>> Because either you are unaware of what “*Plonk*” means in Usenet
> 
> MORON: the fact that you rewrite history

*You* are the moron.  I am *documenting* history.

> and wrong articles on WP

There is no falsehood in what I write on Wikipedia, for example.

> is YOUR insanity:

*You* are insane.

> I'll keep calling thing by their name for as long as I am around.

You are completely delusional.  Go see a psychiatrist and/or take your pills.

> That said, I have even taken the time, not once,not twice, but at lest trice,
> to explain TO YOU WHAT I MEAN by "plonk",

It does not matter what you mean by it.  You cannot go around redefining
words to fit your fantasies of how things ought to be.  That way lies
madness, obviously.

> Go fuck yourself.
> 
> *Plonk*

You know that you do not mean it, for you are obviously *craving* the
attention to fill a large void in your life.

Tough luck, because with the next sound the number of people that take
notice of your sorry existence *will* reduce by one:

*PLONK*

F’up2 poster

-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#36376

FromJulio Di Egidio <julio@diegidio.name>
Date2019-04-20 01:54 -0700
Message-ID<3916c6f0-b12d-475c-989c-858c8d610f18@googlegroups.com>
In reply to#36373
On Saturday, 20 April 2019 03:27:15 UTC+2, Thomas 'PointedEars' Lahn  wrote:

> > ES>5 is *utter bullshit* 
> 
> Once again:
> 
> <https://github.com/airbnb/javascript#ecmascript-6-es-2015-styles> 

And, once again, what does that list of features prove except that you are a
self-deluded and of course just personally abusive MORON who can't distinguish
a technical argument from yet another instance of the usual scam slogans?

Julio

[toc] | [prev] | [next] | [standalone]


#36377

FromJulio Di Egidio <julio@diegidio.name>
Date2019-04-20 02:00 -0700
Message-ID<9a22f8f3-c895-4061-ab32-dbce690f84ca@googlegroups.com>
In reply to#36373
On Saturday, 20 April 2019 03:27:15 UTC+2, Thomas 'PointedEars' Lahn  wrote:
> Julio Di Egidio wrote:
> > On Friday, 19 April 2019 15:49:09 UTC+2, Thomas 'PointedEars' Lahn  wrote:
> >> Julio Di Egidio wrote:
> >>> On Thursday, 18 April 2019 15:14:24 UTC+2, Thomas 'PointedEars' Lahn
> >>> wrote:
> >> It is called attribution line, not attribution novel.  Learn to quote.
> > 
> > Just LOL.
> 
> Simple minds are easily amused.

I have hinted in my reply to John G Harris at how utterly stupid even that
stance of yours is: and you just keep lying and making an ass of yourself,
you self-deluded, unreasonable, then just abusive, fucking retard...

*Plonk*

Julio

[toc] | [prev] | [next] | [standalone]


#36375

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2019-04-19 20:37 -0700
Message-ID<98bcd287-7896-47c2-8015-ea02ed52f198@googlegroups.com>
In reply to#36366
Thomas 'PointedEars' Lahn wrote:

> AISB, where I am working now we are using Babel as a Node module, triggered
> by another Node module, Webpack: <https://github.com/babel/babel-loader>
> (I did not introduce this.)

What do you prefer instead? 

[toc] | [prev] | [next] | [standalone]


#36378

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2019-04-20 12:41 +0200
Message-ID<5e95cda2-aa83-0574-ba67-745cf0f14e62@PointedEars.de>
In reply to#36375
Michael Haufe (TNO) wrote:
> Thomas 'PointedEars' Lahn wrote:
>> AISB, where I am working now we are using Babel as a Node module, triggered
>> by another Node module, Webpack: <https://github.com/babel/babel-loader>
>> (I did not introduce this.)
> 
> What do you prefer instead? 

I have no preferences in that regard because I have not had the time (and
probably are not going to have it anytime soon; my astrophysics studies take
precedence now) to evaluate alternatives.

The point that I was trying to make is that it was NOT *my* decision to use
Babel and Webpack; *other* developers had made that decision for me before
I joined the company, based on recommendations of yet *other* developers;
*and* I can find nothing *inherently* wrong in their decision.

So (the /ad hominem/ fallacy aside) it is illogical to argue that I would be
a “moron” pointing out the usefulness of ES 6+.  Because if I would be a
“moron” using it then virtually all developers of ECMAScript-based programs
today, including those at Airbnb, except The Greatest Software Developer of
All Times[tm] Julio Di Egidio, would be “morons”.

    [Unfortunately, it is all too evident that it is the other way around.
     It is the mental patient calling the asylum’s nurses “crazy” instead;
     or, as we say in the German-speaking Usenet: „*Ein* Geisterfahrer?
     *Hunderte*!“.

     That is not to say that the majority has to be correct:

       “The fact that an opinion has been widely held is no evidence
        whatever that it is not utterly absurd; indeed in view of the
        silliness of the majority of mankind, a widespread belief is
        more likely to be foolish than sensible.”

          –Bertrand Russell, “Marriage and Morals” (1929)

     However, to reject a widely held opinion, and to hold a different
     opinion, *without* any reason, is irrational itself – no matter how
     irrational the rejected opinion might be.]

Now that I am using Babel in my employment, I appreciate the fact that with
a few exceptions (one being “let … of” which Babel transpiles to code that
uses Symbol.iterator and is thus incompatible with IE 11; but I might be
close to a solution for that) I can use ES 6+ syntax in client-side code.
I would use it in my free time, too (if I had any free time left to
restructure my build process).

However, I do object to the fact that Webpack is creating one large script
resource (despite minifying) that tends to be more difficult to be debugged
(despite source maps); I would prefer the more modular requireJS() approach
(load dependencies only as needed).  I have just read “Bracer Jack”’s LCARS
Manifesto¹ [1] again, and I find most reasonable their idea that the
compiler of a programming language, not the software developer, should
determine from the source code which dependencies need to be loaded before
the program can be successfully executed.  This should indeed be possible by
the source code analysis that the compiler does anyway, and appears to be a
way forward in modularization.

On the other hand, I appreciate the code structuring that comes with ES 6+
modules that are supported by Webpack, and I have no data to prove that the
requireJS() approach would not be less efficient, especially with mobile
devices, or less error-prone.  And since in the foreseeable future I am not
going have the time to develop my alternative approach, I have no problem
sticking with Webpack for now, at least in my employment.

_______
¹  I have referred their LCARS research (not the Manifesto, but it is
   referred at the end of that) on the home page of my Web site, since it
   helped me a lot designing my Web site; however, FTR, now that I have
   read it more carefully, I must strongly object to their use of racial
   slurs to describe approaches that they consider wrong.  (That might also
   explain why the original is not online anymore.)

[1]
<http://web.archive.org/web/20120308211518/http://www.bracercom.com/tutorial/content/lcars_manifesto/the_lcars_manifesto.html>
-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#36364

FromJJ <jj4public@vfemail.net>
Date2019-04-19 12:16 +0700
Message-ID<1lx35opblgwdw$.1ck51k79c9r0x$.dlg@40tude.net>
In reply to#36359
On Wed, 17 Apr 2019 23:46:02 -0700 (PDT), Julio Di Egidio wrote:
> On Thursday, 18 April 2019 04:05:36 UTC+2, JJ  wrote:
>> On 17 Apr 2019 23:57:01 GMT, Stefan Ram wrote:
>>> 
>>> doReset = () => span.innerHTML = +span.innerHTML + 1;
>> 
>> Shouldn't that function reset the number instead of incrementing it?
> 
> No, that +span.innerHTML is a conversion to number: it's a super ugly way
> by recent javascripters to convert to number, as well as, as already noted
> by others, it's a super inefficient and again super ugly way to present
> results in the DOM.
> 
> Julio

That's irrelevant.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web