experchange > javascript

Jonas Thörnvall (09-22-18, 06:53 AM)
Often i find it a bit backward reading code, so i wonder a bit about the reason behind choices done in programming languages.

Why
track[recTrack].midiMess.splice(trackevent,1);
and not
track[recTrack].midiMess[trackevent].splice(1);

Isn't the later more readable, maybe it is just a personal preference?
But if you replace the indexname with just the index, the former make no sense if you do not know the parameter order.

But the later is still readable right out of the box?
Well i could be wrong but i find the later more intuitive.
Thomas 'PointedEars' Lahn (09-22-18, 03:17 PM)
</killfile>

Jonas Thörnvall wrote:
> Often i find it a bit backward reading code, so i wonder a bit about the
> reason behind choices done in programming languages.
> Why track[recTrack].midiMess.splice(trackevent,1); and not
> track[recTrack].midiMess[trackevent].splice(1);


Because they mean completely different things.

The first one is calling the splice() method of an object referred to by
“track[recTrack].midiMess”, i.e. specified by the property named “midiMess”
of the object referred to by “track[recTrack]”, passing to it a value
identified by “trackevent”, and the value 1.

The second one is calling the splice() method of an object referred to by
“track[recTrack].midiMess[trackevent]”, i.e. an object referred to by a
*property* of an object where the property *name* is specified by the
*value* of “trackevent”, passing to it the value 1.

(If that was too complex for you to understand, dissect the sentences and
draw a diagram.)

The object on which the standard splice() method is called is supposed to be
*Array*-like because of the way the method works.

> Isn't the later more readable, maybe it is just a personal preference?


Yes, it is not; and no, it is not.

> But if you replace the indexname with just the index, the former make no
> sense if you do not know the parameter order.


*You* are not making sense.

> But the later is still readable right out of the box?


It does not matter if a sentence is readable if it means something else than
what it replaces, or if it does not mean anything at all.

The cat’s eye is looking at the mouse’s tail.

means something else than

The cat’s mouse is looking at the eye’s tail.

Incidentally, the latter sentence is meaningless nonsense as is your
suggestion for alternative code.

> Well i could be wrong but i find the later more intuitive.


You will never succeed at software development in general, and programming
in particular, if you continue to go by gut feeling alone, ignoring logic.
I have observed you fiddling around with source code for several years now,
obviously without your gaining a deeper understanding of anything.

Why do you expect to make any progress with your current approach when it
has not helped you to make any considerable progress in the past? Has it
not occurred to you by now that something with your approach to programming
might be deeply wrong?

I can promise you that one year, two years, three years aso. from now you
will still not have made any considerable progress unless you change your
approach to really *learning* these things *from the ground up*, *with
rigor* instead of your current sloppiness, and putting all your (illogical,
uninformed) preconceptions aside about how programming should be.

Mark my words.

<killfile>

PointedEars
Jonas Thörnvall (09-22-18, 07:23 PM)
Den lördag 22 september 2018 kl. 15:17:32 UTC+2 skrev Thomas 'PointedEars' Lahn:
[..]
> PointedEars
> --
> When all you know is jQuery, every problem looks $(olvable).


You are indeed a prisoner of your own faulthy idea world Thomas.
What you want to do is to splice the element midiMess[index].splice(one in a million you low IQ moron, 1 to whatever below 100)

Only a total idiot or someone building fantasy castles would think otherwise.

Only lowIQ idiots would create a syntax where splice is a parmeter upon array.
midiMess.splice(trackevent,1);

You see the cardhouse you built is wrong altogehter both lexical and semantical outside javascript. You do not splice a parameter, you some splice some elements using a specific engine.

Now you little lowIQ bastard go do that IQ test, and get it confirmed you are not even average.

When they set lowIQ people like you to be caretakers of programming languages they always in the end to be useless and abandoned because in the the end the actual syntax to do something get ridiculous.
Jonas Thörnvall (09-22-18, 07:31 PM)
Den lördag 22 september 2018 kl. 15:17:32 UTC+2 skrev Thomas 'PointedEars' Lahn:
[..]
> PointedEars
> --
> When all you know is jQuery, every problem looks $(olvable).


If your actually part of some board making designing choices for ECMA/Javascript i feel sorry for the whole project, sooner or later the syntax will be so convoluted/polluted by bad ideas that it start to stink.
Jonas Thörnvall (09-22-18, 07:39 PM)
Den lördag 22 september 2018 kl. 19:31:37 UTC+2 skrev Jonas Thörnvall:
> Den lördag 22 september 2018 kl. 15:17:32 UTC+2 skrev Thomas 'PointedEars' Lahn:
> If your actually part of some board making designing choices for ECMA/Javascript i feel sorry for the whole project, sooner or later the syntax willbe so convoluted/polluted by bad ideas that it start to stink.


Yeah the choice of syntax looks like shit and stink "blip,blop semantics"

track[tracknr].midiMess.splice(trackEvent,0,{time:instime,data0: 144,data1:insnote,data2:insvel});

No in a logical language with working semantics it should be

track[tracknr].midiMess[trackEvent].splice(0,{time:instime,data0:144,data1:insnote,da ta2:insvel});

Only lowIQ morons would chose the former syntax.
Jonas Thörnvall (09-22-18, 08:20 PM)
Den lördag 22 september 2018 kl. 19:39:29 UTC+2 skrev Jonas Thörnvall:
> Den lördag 22 september 2018 kl. 19:31:37 UTC+2 skrev Jonas Thörnvall:
> Yeah the choice of syntax looks like shit and stink "blip,blop semantics"
> track[tracknr].midiMess.splice(trackEvent,0,{time:instime,data0: 144,data1:insnote,data2:insvel});
> No in a logical language with working semantics it should be
> track[tracknr].midiMess[trackEvent].splice(0,{time:instime,data0:144,data1:insnote,da ta2:insvel});
> Only lowIQ morons would chose the former syntax.


For fuck sake the index is a property of the array not of the object you fucking idiots.

You have to have a fucking weird polluted brain to come with your syntax choices, they are built around some weird fucking paper model of object oriented programming, that isn't even coherent.
Jonas Thörnvall (09-23-18, 12:21 AM)
Den lördag 22 september 2018 kl. 15:17:32 UTC+2 skrev Thomas 'PointedEars' Lahn:
[..]
> PointedEars
> --
> When all you know is jQuery, every problem looks $(olvable).


Thomas 'PointedEars' Lahn (09-23-18, 09:14 AM)
</killfile>

Jonas Thörnvall full-quoted, and replied with nonsense and insults to,
the same posting for the fifth(!) time within four(!) hours:

> […]
>


<https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect>
<https://en.wikipedia.org/wiki/Logorrhea_(psychology)>

Hopeless case.

*PLONK*

PointedEars
Jonas Thörnvall (09-23-18, 09:23 AM)
Den söndag 23 september 2018 kl. 09:14:48 UTC+2 skrev Thomas 'PointedEars' Lahn:
> </killfile>
> Jonas Thörnvall full-quoted, and replied with nonsense and insults to,
> the same posting for the fifth(!) time within four(!) hours:
> <https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect>
> <https://en.wikipedia.org/wiki/Logorrhea_(psychology)>
> Hopeless case.
> *PLONK*
> PointedEars


Well how sad, lowIQ and out of arguments who could had thoght...
Silvio (09-24-18, 12:33 AM)
On 22-09-18 06:53, Jonas Thörnvall wrote:
> Often i find it a bit backward reading code, so i wonder a bit about the reason behind choices done in programming languages.
> Why
> track[recTrack].midiMess.splice(trackevent,1);
> and not
> track[recTrack].midiMess[trackevent].splice(1);
> Isn't the later more readable, maybe it is just a personal preference?
> But if you replace the indexname with just the index, the former make no sense if you do not know the parameter order.
> But the later is still readable right out of the box?
> Well i could be wrong but i find the later more intuitive.


Programming language syntax is just a way of writing down programming
semantics. Since you do not grasp the latter at all it is hard to
explain the former to you.
The syntactic alternative you propose is an expression of completely
different semantics.

Elsewhere in this thread you boast about your own high IQ versus the low
IQ of people you do not understand. I am sure you will also not
understand what I said above and cope with that by calling me stupid.
The world must be a strange and hostile place for you.
Maik Koenig (09-24-18, 12:56 AM)
Am 23.09.2018 um 09:23 schrieb Jonas Thörnvall:

> Well how sad, lowIQ and out of arguments who could had thoght...


Can't say I like Thomas, but he at least knows what he is talking about.
You on the other hand... don't.

Greetz,
MK
Jonas Thörnvall (09-24-18, 01:07 AM)
Den måndag 24 september 2018 kl. 00:33:55 UTC+2 skrev Silvio:
> On 22-09-18 06:53, Jonas Thörnvall wrote:
> Programming language syntax is just a way of writing down programming
> semantics. Since you do not grasp the latter at all it is hard to
> explain the former to you.
> The syntactic alternative you propose is an expression of completely
> different semantics.
> Elsewhere in this thread you boast about your own high IQ versus the low
> IQ of people you do not understand. I am sure you will also not
> understand what I said above and cope with that by calling me stupid.
> The world must be a strange and hostile place for you.


Mo syntax and semantics are just models of what actions taken at lowlevel.
But there is rules created from when the primitives was invented.
One of them is that the index is a part of the array to reach an element object, it is not a part of the object even in object oriented languages.
But javascript have methods upon arrays not upon elements, that is why the parameters includes the index but in look fucking weird.

Yes it is semantics but it is weird.

track[tracknr].midiMess.splice(trackEvent,0,{time:instime,data0: 144,data1:insnote,data2:insvel});

Below the splice is done upon element, because index is part of the array, it simply a matter of choice of syntax, i claim the one below is much easier to read. "Because the index as parameter to splice will just be a name", you can't see it is the index. But index is already part of the array primitive so why throw into the method.

track[tracknr].midiMess[trackEvent].splice(0,{time:instime,data0:144,data1:insnote,da ta2:insvel});
Jonas Thörnvall (09-24-18, 01:13 AM)
Den måndag 24 september 2018 kl. 00:33:55 UTC+2 skrev Silvio:
> On 22-09-18 06:53, Jonas Thörnvall wrote:
> Programming language syntax is just a way of writing down programming
> semantics. Since you do not grasp the latter at all it is hard to
> explain the former to you.
> The syntactic alternative you propose is an expression of completely
> different semantics.
> Elsewhere in this thread you boast about your own high IQ versus the low
> IQ of people you do not understand. I am sure you will also not
> understand what I said above and cope with that by calling me stupid.
> The world must be a strange and hostile place for you.


No that is not the way it started but i do not suck up to lowIQ people on amission to ridicule me, it is quite easy don't fuck with me and i will notfuck with you.

But the moron ENTP Thomas should pull out the ENTP polluted stick he has uphis ass, and go take an IQ test to get his lowIQ confirmed.
Jonas Thörnvall (09-24-18, 01:24 AM)
Den måndag 24 september 2018 kl. 00:33:55 UTC+2 skrev Silvio:
> On 22-09-18 06:53, Jonas Thörnvall wrote:
> Programming language syntax is just a way of writing down programming
> semantics. Since you do not grasp the latter at all it is hard to
> explain the former to you.
> The syntactic alternative you propose is an expression of completely
> different semantics.
> Elsewhere in this thread you boast about your own high IQ versus the low
> IQ of people you do not understand. I am sure you will also not
> understand what I said above and cope with that by calling me stupid.
> The world must be a strange and hostile place for you.


Yes syntax is just semantics "of ones choices", the choice they did was to make the method splice work on the array, not upon the element.

That made it necessary to pass the index as a parameter to the method, it was a bad choice. Because it do get hard to read.

Is that clear enough?
Jonas Thörnvall (09-24-18, 01:37 AM)
Den måndag 24 september 2018 kl. 01:24:45 UTC+2 skrev Jonas Thörnvall:
> Den måndag 24 september 2018 kl. 00:33:55 UTC+2 skrev Silvio:
> Yes syntax is just semantics "of ones choices", the choice they did was to make the method splice work on the array, not upon the element.
> That made it necessary to pass the index as a parameter to the method, itwas a bad choice. Because it do get hard to read.
> Is that clear enough?


Bad design choice.

Similar Threads