▲ 721 ▼ Node Modules (lemmy.ml) submitted 1 year ago by cm0002@lemmy.world to c/programmer_humor@programming.dev 54 comments fedilink hide all child comments
[–] Shawdow194@fedia.io 99 points 1 year ago (33 children) The joke is always Javascript permalink fedilink source hideshow 33 child comments replies: [–] Blue_Morpho@lemmy.world 66 points 1 year ago (32 children) JavaScript itself is fine. The problem is developers who import a library to add two numbers. permalink fedilink source parent hideshow 32 child comments replies: [–] i_stole_ur_taco@lemmy.ca 50 points 1 year ago (2 children) Excuse me, but it’s industry practice to always use PlusJs. Its just annoying that it has its own dependency on MinusJs. permalink fedilink source parent hideshow 2 child comments replies: [–] Artyom@lemm.ee 4 points 1 year ago And MinusJs depends on AngularJs and VueJs for some reason, but that's just the cost of doing business! permalink fedilink source parent [–] kate@lemmy.uhhoh.com 2 points 1 year ago https://www.npmjs.com/package/is-even?activeTab=dependencies permalink fedilink source parent [–] TheGalacticVoid@lemm.ee 34 points 1 year ago (5 children) Maybe we wouldn't need external libraries to do basic things if JavaScript had a standard library permalink fedilink source parent hideshow 5 child comments replies: [–] jaybone@lemmy.zip 9 points 1 year ago What is this crazy talk?? permalink fedilink source parent [–] mindbleach@sh.itjust.works 6 points 1 year ago (3 children) The thing you want from jQuery was added to all browsers in 2018. permalink fedilink source parent hideshow 3 child comments replies: [–] vithigar@lemmy.ca 3 points 1 year ago (2 children) I'm currently on a crusade against lodash where I work. permalink fedilink source parent hideshow 2 child comments replies: [–] mindbleach@sh.itjust.works 1 point 1 year ago (1 child) Lodash provides modular methods for working with arrays, objects, strings, and more. I dunno. If it makes everything Array-like act like a goddamn Array, I'm tempted to start using it. 'What do you mean you can't .map a Set? It's iterable! Figure it out!' permalink fedilink source parent hideshow 1 child comment replies: [–] vithigar@lemmy.ca 3 points 1 year ago You can though? mySet.values().map(mappingFunc) will create a new iterator transformed by the mapping function. permalink fedilink source parent [–] jjjalljs@ttrpg.network 24 points 1 year ago (7 children) I don't know about "fine". It has a lot of weird stuff baked in. Hoisting. Unexpected type coercion. Too many ways to loop over something and I always forget which one is which. "There's more than one way to do it" is kind of a recurring problem, come to think of it. Several function declaration syntaxes. Dot notation AND bracket notation for objects. Also it will forever bother me that object keys aren't quoted. const foo = "hello"; const bar = { foo: "world" } That should be, in my mind, { "hello": "world" } . It's not. It's { "foo": "world" } But if you want to do that, you need to do const bar = { [foo]: world }. Which looks like your key is an array with one entry, a string with a value of "foo" You also end up learning a whole framework, with its syntax and idioms, every couple years. Angular. React. Redux. Whatever. There's also a lot of people who have never used anything else, and want to use javascript for everything. Javascript is basically D&D. Wildly popular. Full of legacy jank. People try to use it for anything even though there are better or more specialized tools. permalink fedilink source parent hideshow 7 child comments replies: [+] JordanZ@lemmy.world 4 points 1 year ago* (last edited 1 year ago) [deleted] permalink fedilink source parent [–] Lemminary@lemmy.world 3 points 1 year ago (2 children) After reading the JS Bible and listening to a lot of Kyle Simpson, I don't find any of those unusual or unexpected, but rather neat in the context of the language. And with enough practice, even the implicit return of an arrow functions jumps out at you. permalink fedilink source parent hideshow 2 child comments replies: [+] felbane@lemmy.world 0 points 1 year ago (1 child) [deleted] permalink fedilink source parent hideshow 1 child comment replies: [–] Lemminary@lemmy.world 0 points 1 year ago Well, I don't think it's a bad language necessarily. It's a language that works, and it's a tool that's tried and true. Stick to the good parts and you're good. permalink fedilink source parent [–] SaharaMaleikuhm@feddit.org 1 point 1 year ago (2 children) No need to convince me it's shit. Also how do you end up only knowing Javascript? Who the hell starts out using Javascript of all the languages? permalink fedilink source parent hideshow 2 child comments replies: [–] jjjalljs@ttrpg.network 12 points 1 year ago (1 child) Anyone entering through web development. If you're self taught or did a "coding boot camp", it might be the only language you've used. A lot of places use it for backend stuff now, too permalink fedilink source parent hideshow 1 child comment replies: [–] marlowe221@lemmy.world 1 point 1 year ago I write back end JS, when I’m not writing back end C#. It’s totally fine. In fact, Node makes it a great back end language. I find that the infamous quirks of JS fall into two categories - “common enough that you internalize the rules for them” and “edge cases that almost never come up in practice.” And when you write back ends in JS… you aren’t on the endless new framework treadmill! permalink fedilink source parent [–] nickwitha_k@lemmy.sdf.org 12 points 1 year ago (1 child) Use the modulo operator? Nah. Need to import the isEven library and a ton of other unnecessary sub-50 LOC libraries "maintained" by a single dev to make their CV look more impressive. /s permalink fedilink source parent hideshow 1 child comment replies: [–] Hupf@feddit.org 2 points 1 year ago https://xkcd.com/2347/ permalink fedilink source parent [–] phoenixz@lemmy.ca 9 points 1 year ago (4 children) Oh Hells no. JavaScript is NOT fine, it's .... I'm really trying to think of a word that will convey the shit that it is without triggering half the people on Lemmy into an aneurysm, but I can't find it. JavaScript is by far the worst. I've been working with JavaScript for the past 6 days and I want to hang myself, it'd be a better fate than continuing permalink fedilink source parent hideshow 4 child comments replies: [–] aev_software@programming.dev 6 points 1 year ago 6 Whole Days! Try 25 years. And it still surprises me. permalink fedilink source parent [–] Hoimo@ani.social 4 points 1 year ago Yeah, I had some webpages archived and tried to use javascript to clean them up, but I ended up parsing it as xml through Powershell instead. I've done something with Python and BeautifulSoup too, a long time ago. Both much easier than JS, but somehow JS is designed to work with web pages? Make it make sense. permalink fedilink source parent [–] Aqarius@lemmy.world 3 points 1 year ago (1 child) JavaScript is by far the worst. PHP permalink fedilink source parent hideshow 1 child comment replies: [–] phoenixz@lemmy.ca 2 points 1 year ago PHP was shit 25 years ago (like everything else back then) and I never bothered to look at it ever again but to this day I keep shitting on it because reasons You permalink fedilink source parent [–] mindbleach@sh.itjust.works 6 points 1 year ago Or ship a browser to run a script. permalink fedilink source parent [–] Shanmugha@lemmy.world 4 points 1 year ago (6 children) console.log([] == []) permalink fedilink source parent hideshow 6 child comments replies: [–] marlowe221@lemmy.world 2 points 1 year ago (1 child) It’s false. Different memory addresses, etc. permalink fedilink source parent hideshow 1 child comment replies: [–] Shanmugha@lemmy.world 1 point 1 year ago Like I didn't know 😂 permalink fedilink source parent [–] phoenixz@lemmy.ca 1 point 1 year ago (3 children) JavaScript sucks but I'll give it this one Arrays are complex structures with multiple values. Just because one looks like the other doesn't make them the same object. It's like taking two new objects form the same class, they look the same but work independently from eachother. I can add a value to one and the other would be unaffected, they'd both still be the same class permalink fedilink source parent hideshow 3 child comments replies: [–] Shanmugha@lemmy.world 1 point 1 year ago* (2 children) And I can't take this one. I did not ask if an object referenced by a is the same object referenced by b, I asked if two empty collections of values are equal. And an empty bag can easily be substituted by another empty bag, there is no class/instance tricky business here. And the fact that in JS arrays are objects is again JS-specific insanity. Still I thank you for sharing your thoughts permalink fedilink source parent hideshow 2 child comments replies: [–] phoenixz@lemmy.ca 2 points 1 year ago (1 child) Well it's what you'd want but not what it does, for one, but for another: comparing scalars is very easy, comparing complex structures is not. To compare one array with another you'd need to iterate over each element, recursively. That JavaScript handles arrays as objects is also not bad, that's just a language feature that you may like or not, not much can go wrong there. The reassignment of "this" or how JS handlesnumber comparison, yeah, that is infuriatingly bad permalink fedilink source parent hideshow 1 child comment replies: [–] Shanmugha@lemmy.world 1 point 1 year ago* (last edited 1 year ago) Yeah. JS is okay with lots of funny (and not fun) type coercions (toString on everything? really?), has no notion of reference as data type, but somehow automatic iteration on array by "==" operator is too much You are right, that's not want I would want from it, it is bad, I will never like that. And you are also right there are things even worse than this, no question there Edit: "implementing iteration on == would have been too much" is an invalid argument, if anyone had doubts permalink fedilink source parent
[–] Blue_Morpho@lemmy.world 66 points 1 year ago (32 children) JavaScript itself is fine. The problem is developers who import a library to add two numbers. permalink fedilink source parent hideshow 32 child comments replies: [–] i_stole_ur_taco@lemmy.ca 50 points 1 year ago (2 children) Excuse me, but it’s industry practice to always use PlusJs. Its just annoying that it has its own dependency on MinusJs. permalink fedilink source parent hideshow 2 child comments replies: [–] Artyom@lemm.ee 4 points 1 year ago And MinusJs depends on AngularJs and VueJs for some reason, but that's just the cost of doing business! permalink fedilink source parent [–] kate@lemmy.uhhoh.com 2 points 1 year ago https://www.npmjs.com/package/is-even?activeTab=dependencies permalink fedilink source parent [–] TheGalacticVoid@lemm.ee 34 points 1 year ago (5 children) Maybe we wouldn't need external libraries to do basic things if JavaScript had a standard library permalink fedilink source parent hideshow 5 child comments replies: [–] jaybone@lemmy.zip 9 points 1 year ago What is this crazy talk?? permalink fedilink source parent [–] mindbleach@sh.itjust.works 6 points 1 year ago (3 children) The thing you want from jQuery was added to all browsers in 2018. permalink fedilink source parent hideshow 3 child comments replies: [–] vithigar@lemmy.ca 3 points 1 year ago (2 children) I'm currently on a crusade against lodash where I work. permalink fedilink source parent hideshow 2 child comments replies: [–] mindbleach@sh.itjust.works 1 point 1 year ago (1 child) Lodash provides modular methods for working with arrays, objects, strings, and more. I dunno. If it makes everything Array-like act like a goddamn Array, I'm tempted to start using it. 'What do you mean you can't .map a Set? It's iterable! Figure it out!' permalink fedilink source parent hideshow 1 child comment replies: [–] vithigar@lemmy.ca 3 points 1 year ago You can though? mySet.values().map(mappingFunc) will create a new iterator transformed by the mapping function. permalink fedilink source parent [–] jjjalljs@ttrpg.network 24 points 1 year ago (7 children) I don't know about "fine". It has a lot of weird stuff baked in. Hoisting. Unexpected type coercion. Too many ways to loop over something and I always forget which one is which. "There's more than one way to do it" is kind of a recurring problem, come to think of it. Several function declaration syntaxes. Dot notation AND bracket notation for objects. Also it will forever bother me that object keys aren't quoted. const foo = "hello"; const bar = { foo: "world" } That should be, in my mind, { "hello": "world" } . It's not. It's { "foo": "world" } But if you want to do that, you need to do const bar = { [foo]: world }. Which looks like your key is an array with one entry, a string with a value of "foo" You also end up learning a whole framework, with its syntax and idioms, every couple years. Angular. React. Redux. Whatever. There's also a lot of people who have never used anything else, and want to use javascript for everything. Javascript is basically D&D. Wildly popular. Full of legacy jank. People try to use it for anything even though there are better or more specialized tools. permalink fedilink source parent hideshow 7 child comments replies: [+] JordanZ@lemmy.world 4 points 1 year ago* (last edited 1 year ago) [deleted] permalink fedilink source parent [–] Lemminary@lemmy.world 3 points 1 year ago (2 children) After reading the JS Bible and listening to a lot of Kyle Simpson, I don't find any of those unusual or unexpected, but rather neat in the context of the language. And with enough practice, even the implicit return of an arrow functions jumps out at you. permalink fedilink source parent hideshow 2 child comments replies: [+] felbane@lemmy.world 0 points 1 year ago (1 child) [deleted] permalink fedilink source parent hideshow 1 child comment replies: [–] Lemminary@lemmy.world 0 points 1 year ago Well, I don't think it's a bad language necessarily. It's a language that works, and it's a tool that's tried and true. Stick to the good parts and you're good. permalink fedilink source parent [–] SaharaMaleikuhm@feddit.org 1 point 1 year ago (2 children) No need to convince me it's shit. Also how do you end up only knowing Javascript? Who the hell starts out using Javascript of all the languages? permalink fedilink source parent hideshow 2 child comments replies: [–] jjjalljs@ttrpg.network 12 points 1 year ago (1 child) Anyone entering through web development. If you're self taught or did a "coding boot camp", it might be the only language you've used. A lot of places use it for backend stuff now, too permalink fedilink source parent hideshow 1 child comment replies: [–] marlowe221@lemmy.world 1 point 1 year ago I write back end JS, when I’m not writing back end C#. It’s totally fine. In fact, Node makes it a great back end language. I find that the infamous quirks of JS fall into two categories - “common enough that you internalize the rules for them” and “edge cases that almost never come up in practice.” And when you write back ends in JS… you aren’t on the endless new framework treadmill! permalink fedilink source parent [–] nickwitha_k@lemmy.sdf.org 12 points 1 year ago (1 child) Use the modulo operator? Nah. Need to import the isEven library and a ton of other unnecessary sub-50 LOC libraries "maintained" by a single dev to make their CV look more impressive. /s permalink fedilink source parent hideshow 1 child comment replies: [–] Hupf@feddit.org 2 points 1 year ago https://xkcd.com/2347/ permalink fedilink source parent [–] phoenixz@lemmy.ca 9 points 1 year ago (4 children) Oh Hells no. JavaScript is NOT fine, it's .... I'm really trying to think of a word that will convey the shit that it is without triggering half the people on Lemmy into an aneurysm, but I can't find it. JavaScript is by far the worst. I've been working with JavaScript for the past 6 days and I want to hang myself, it'd be a better fate than continuing permalink fedilink source parent hideshow 4 child comments replies: [–] aev_software@programming.dev 6 points 1 year ago 6 Whole Days! Try 25 years. And it still surprises me. permalink fedilink source parent [–] Hoimo@ani.social 4 points 1 year ago Yeah, I had some webpages archived and tried to use javascript to clean them up, but I ended up parsing it as xml through Powershell instead. I've done something with Python and BeautifulSoup too, a long time ago. Both much easier than JS, but somehow JS is designed to work with web pages? Make it make sense. permalink fedilink source parent [–] Aqarius@lemmy.world 3 points 1 year ago (1 child) JavaScript is by far the worst. PHP permalink fedilink source parent hideshow 1 child comment replies: [–] phoenixz@lemmy.ca 2 points 1 year ago PHP was shit 25 years ago (like everything else back then) and I never bothered to look at it ever again but to this day I keep shitting on it because reasons You permalink fedilink source parent [–] mindbleach@sh.itjust.works 6 points 1 year ago Or ship a browser to run a script. permalink fedilink source parent [–] Shanmugha@lemmy.world 4 points 1 year ago (6 children) console.log([] == []) permalink fedilink source parent hideshow 6 child comments replies: [–] marlowe221@lemmy.world 2 points 1 year ago (1 child) It’s false. Different memory addresses, etc. permalink fedilink source parent hideshow 1 child comment replies: [–] Shanmugha@lemmy.world 1 point 1 year ago Like I didn't know 😂 permalink fedilink source parent [–] phoenixz@lemmy.ca 1 point 1 year ago (3 children) JavaScript sucks but I'll give it this one Arrays are complex structures with multiple values. Just because one looks like the other doesn't make them the same object. It's like taking two new objects form the same class, they look the same but work independently from eachother. I can add a value to one and the other would be unaffected, they'd both still be the same class permalink fedilink source parent hideshow 3 child comments replies: [–] Shanmugha@lemmy.world 1 point 1 year ago* (2 children) And I can't take this one. I did not ask if an object referenced by a is the same object referenced by b, I asked if two empty collections of values are equal. And an empty bag can easily be substituted by another empty bag, there is no class/instance tricky business here. And the fact that in JS arrays are objects is again JS-specific insanity. Still I thank you for sharing your thoughts permalink fedilink source parent hideshow 2 child comments replies: [–] phoenixz@lemmy.ca 2 points 1 year ago (1 child) Well it's what you'd want but not what it does, for one, but for another: comparing scalars is very easy, comparing complex structures is not. To compare one array with another you'd need to iterate over each element, recursively. That JavaScript handles arrays as objects is also not bad, that's just a language feature that you may like or not, not much can go wrong there. The reassignment of "this" or how JS handlesnumber comparison, yeah, that is infuriatingly bad permalink fedilink source parent hideshow 1 child comment replies: [–] Shanmugha@lemmy.world 1 point 1 year ago* (last edited 1 year ago) Yeah. JS is okay with lots of funny (and not fun) type coercions (toString on everything? really?), has no notion of reference as data type, but somehow automatic iteration on array by "==" operator is too much You are right, that's not want I would want from it, it is bad, I will never like that. And you are also right there are things even worse than this, no question there Edit: "implementing iteration on == would have been too much" is an invalid argument, if anyone had doubts permalink fedilink source parent
[–] i_stole_ur_taco@lemmy.ca 50 points 1 year ago (2 children) Excuse me, but it’s industry practice to always use PlusJs. Its just annoying that it has its own dependency on MinusJs. permalink fedilink source parent hideshow 2 child comments replies: [–] Artyom@lemm.ee 4 points 1 year ago And MinusJs depends on AngularJs and VueJs for some reason, but that's just the cost of doing business! permalink fedilink source parent [–] kate@lemmy.uhhoh.com 2 points 1 year ago https://www.npmjs.com/package/is-even?activeTab=dependencies permalink fedilink source parent
[–] Artyom@lemm.ee 4 points 1 year ago And MinusJs depends on AngularJs and VueJs for some reason, but that's just the cost of doing business! permalink fedilink source parent
[–] kate@lemmy.uhhoh.com 2 points 1 year ago https://www.npmjs.com/package/is-even?activeTab=dependencies permalink fedilink source parent
[–] TheGalacticVoid@lemm.ee 34 points 1 year ago (5 children) Maybe we wouldn't need external libraries to do basic things if JavaScript had a standard library permalink fedilink source parent hideshow 5 child comments replies: [–] jaybone@lemmy.zip 9 points 1 year ago What is this crazy talk?? permalink fedilink source parent [–] mindbleach@sh.itjust.works 6 points 1 year ago (3 children) The thing you want from jQuery was added to all browsers in 2018. permalink fedilink source parent hideshow 3 child comments replies: [–] vithigar@lemmy.ca 3 points 1 year ago (2 children) I'm currently on a crusade against lodash where I work. permalink fedilink source parent hideshow 2 child comments replies: [–] mindbleach@sh.itjust.works 1 point 1 year ago (1 child) Lodash provides modular methods for working with arrays, objects, strings, and more. I dunno. If it makes everything Array-like act like a goddamn Array, I'm tempted to start using it. 'What do you mean you can't .map a Set? It's iterable! Figure it out!' permalink fedilink source parent hideshow 1 child comment replies: [–] vithigar@lemmy.ca 3 points 1 year ago You can though? mySet.values().map(mappingFunc) will create a new iterator transformed by the mapping function. permalink fedilink source parent
[–] mindbleach@sh.itjust.works 6 points 1 year ago (3 children) The thing you want from jQuery was added to all browsers in 2018. permalink fedilink source parent hideshow 3 child comments replies: [–] vithigar@lemmy.ca 3 points 1 year ago (2 children) I'm currently on a crusade against lodash where I work. permalink fedilink source parent hideshow 2 child comments replies: [–] mindbleach@sh.itjust.works 1 point 1 year ago (1 child) Lodash provides modular methods for working with arrays, objects, strings, and more. I dunno. If it makes everything Array-like act like a goddamn Array, I'm tempted to start using it. 'What do you mean you can't .map a Set? It's iterable! Figure it out!' permalink fedilink source parent hideshow 1 child comment replies: [–] vithigar@lemmy.ca 3 points 1 year ago You can though? mySet.values().map(mappingFunc) will create a new iterator transformed by the mapping function. permalink fedilink source parent
[–] vithigar@lemmy.ca 3 points 1 year ago (2 children) I'm currently on a crusade against lodash where I work. permalink fedilink source parent hideshow 2 child comments replies: [–] mindbleach@sh.itjust.works 1 point 1 year ago (1 child) Lodash provides modular methods for working with arrays, objects, strings, and more. I dunno. If it makes everything Array-like act like a goddamn Array, I'm tempted to start using it. 'What do you mean you can't .map a Set? It's iterable! Figure it out!' permalink fedilink source parent hideshow 1 child comment replies: [–] vithigar@lemmy.ca 3 points 1 year ago You can though? mySet.values().map(mappingFunc) will create a new iterator transformed by the mapping function. permalink fedilink source parent
[–] mindbleach@sh.itjust.works 1 point 1 year ago (1 child) Lodash provides modular methods for working with arrays, objects, strings, and more. I dunno. If it makes everything Array-like act like a goddamn Array, I'm tempted to start using it. 'What do you mean you can't .map a Set? It's iterable! Figure it out!' permalink fedilink source parent hideshow 1 child comment replies: [–] vithigar@lemmy.ca 3 points 1 year ago You can though? mySet.values().map(mappingFunc) will create a new iterator transformed by the mapping function. permalink fedilink source parent
[–] vithigar@lemmy.ca 3 points 1 year ago You can though? mySet.values().map(mappingFunc) will create a new iterator transformed by the mapping function. permalink fedilink source parent
[–] jjjalljs@ttrpg.network 24 points 1 year ago (7 children) I don't know about "fine". It has a lot of weird stuff baked in. Hoisting. Unexpected type coercion. Too many ways to loop over something and I always forget which one is which. "There's more than one way to do it" is kind of a recurring problem, come to think of it. Several function declaration syntaxes. Dot notation AND bracket notation for objects. Also it will forever bother me that object keys aren't quoted. const foo = "hello"; const bar = { foo: "world" } That should be, in my mind, { "hello": "world" } . It's not. It's { "foo": "world" } But if you want to do that, you need to do const bar = { [foo]: world }. Which looks like your key is an array with one entry, a string with a value of "foo" You also end up learning a whole framework, with its syntax and idioms, every couple years. Angular. React. Redux. Whatever. There's also a lot of people who have never used anything else, and want to use javascript for everything. Javascript is basically D&D. Wildly popular. Full of legacy jank. People try to use it for anything even though there are better or more specialized tools. permalink fedilink source parent hideshow 7 child comments replies: [+] JordanZ@lemmy.world 4 points 1 year ago* (last edited 1 year ago) [deleted] permalink fedilink source parent [–] Lemminary@lemmy.world 3 points 1 year ago (2 children) After reading the JS Bible and listening to a lot of Kyle Simpson, I don't find any of those unusual or unexpected, but rather neat in the context of the language. And with enough practice, even the implicit return of an arrow functions jumps out at you. permalink fedilink source parent hideshow 2 child comments replies: [+] felbane@lemmy.world 0 points 1 year ago (1 child) [deleted] permalink fedilink source parent hideshow 1 child comment replies: [–] Lemminary@lemmy.world 0 points 1 year ago Well, I don't think it's a bad language necessarily. It's a language that works, and it's a tool that's tried and true. Stick to the good parts and you're good. permalink fedilink source parent [–] SaharaMaleikuhm@feddit.org 1 point 1 year ago (2 children) No need to convince me it's shit. Also how do you end up only knowing Javascript? Who the hell starts out using Javascript of all the languages? permalink fedilink source parent hideshow 2 child comments replies: [–] jjjalljs@ttrpg.network 12 points 1 year ago (1 child) Anyone entering through web development. If you're self taught or did a "coding boot camp", it might be the only language you've used. A lot of places use it for backend stuff now, too permalink fedilink source parent hideshow 1 child comment replies: [–] marlowe221@lemmy.world 1 point 1 year ago I write back end JS, when I’m not writing back end C#. It’s totally fine. In fact, Node makes it a great back end language. I find that the infamous quirks of JS fall into two categories - “common enough that you internalize the rules for them” and “edge cases that almost never come up in practice.” And when you write back ends in JS… you aren’t on the endless new framework treadmill! permalink fedilink source parent
[+] JordanZ@lemmy.world 4 points 1 year ago* (last edited 1 year ago) [deleted] permalink fedilink source parent
[–] Lemminary@lemmy.world 3 points 1 year ago (2 children) After reading the JS Bible and listening to a lot of Kyle Simpson, I don't find any of those unusual or unexpected, but rather neat in the context of the language. And with enough practice, even the implicit return of an arrow functions jumps out at you. permalink fedilink source parent hideshow 2 child comments replies: [+] felbane@lemmy.world 0 points 1 year ago (1 child) [deleted] permalink fedilink source parent hideshow 1 child comment replies: [–] Lemminary@lemmy.world 0 points 1 year ago Well, I don't think it's a bad language necessarily. It's a language that works, and it's a tool that's tried and true. Stick to the good parts and you're good. permalink fedilink source parent
[+] felbane@lemmy.world 0 points 1 year ago (1 child) [deleted] permalink fedilink source parent hideshow 1 child comment replies: [–] Lemminary@lemmy.world 0 points 1 year ago Well, I don't think it's a bad language necessarily. It's a language that works, and it's a tool that's tried and true. Stick to the good parts and you're good. permalink fedilink source parent
[–] Lemminary@lemmy.world 0 points 1 year ago Well, I don't think it's a bad language necessarily. It's a language that works, and it's a tool that's tried and true. Stick to the good parts and you're good. permalink fedilink source parent
[–] SaharaMaleikuhm@feddit.org 1 point 1 year ago (2 children) No need to convince me it's shit. Also how do you end up only knowing Javascript? Who the hell starts out using Javascript of all the languages? permalink fedilink source parent hideshow 2 child comments replies: [–] jjjalljs@ttrpg.network 12 points 1 year ago (1 child) Anyone entering through web development. If you're self taught or did a "coding boot camp", it might be the only language you've used. A lot of places use it for backend stuff now, too permalink fedilink source parent hideshow 1 child comment replies: [–] marlowe221@lemmy.world 1 point 1 year ago I write back end JS, when I’m not writing back end C#. It’s totally fine. In fact, Node makes it a great back end language. I find that the infamous quirks of JS fall into two categories - “common enough that you internalize the rules for them” and “edge cases that almost never come up in practice.” And when you write back ends in JS… you aren’t on the endless new framework treadmill! permalink fedilink source parent
[–] jjjalljs@ttrpg.network 12 points 1 year ago (1 child) Anyone entering through web development. If you're self taught or did a "coding boot camp", it might be the only language you've used. A lot of places use it for backend stuff now, too permalink fedilink source parent hideshow 1 child comment replies: [–] marlowe221@lemmy.world 1 point 1 year ago I write back end JS, when I’m not writing back end C#. It’s totally fine. In fact, Node makes it a great back end language. I find that the infamous quirks of JS fall into two categories - “common enough that you internalize the rules for them” and “edge cases that almost never come up in practice.” And when you write back ends in JS… you aren’t on the endless new framework treadmill! permalink fedilink source parent
[–] marlowe221@lemmy.world 1 point 1 year ago I write back end JS, when I’m not writing back end C#. It’s totally fine. In fact, Node makes it a great back end language. I find that the infamous quirks of JS fall into two categories - “common enough that you internalize the rules for them” and “edge cases that almost never come up in practice.” And when you write back ends in JS… you aren’t on the endless new framework treadmill! permalink fedilink source parent
[–] nickwitha_k@lemmy.sdf.org 12 points 1 year ago (1 child) Use the modulo operator? Nah. Need to import the isEven library and a ton of other unnecessary sub-50 LOC libraries "maintained" by a single dev to make their CV look more impressive. /s permalink fedilink source parent hideshow 1 child comment replies: [–] Hupf@feddit.org 2 points 1 year ago https://xkcd.com/2347/ permalink fedilink source parent
[–] phoenixz@lemmy.ca 9 points 1 year ago (4 children) Oh Hells no. JavaScript is NOT fine, it's .... I'm really trying to think of a word that will convey the shit that it is without triggering half the people on Lemmy into an aneurysm, but I can't find it. JavaScript is by far the worst. I've been working with JavaScript for the past 6 days and I want to hang myself, it'd be a better fate than continuing permalink fedilink source parent hideshow 4 child comments replies: [–] aev_software@programming.dev 6 points 1 year ago 6 Whole Days! Try 25 years. And it still surprises me. permalink fedilink source parent [–] Hoimo@ani.social 4 points 1 year ago Yeah, I had some webpages archived and tried to use javascript to clean them up, but I ended up parsing it as xml through Powershell instead. I've done something with Python and BeautifulSoup too, a long time ago. Both much easier than JS, but somehow JS is designed to work with web pages? Make it make sense. permalink fedilink source parent [–] Aqarius@lemmy.world 3 points 1 year ago (1 child) JavaScript is by far the worst. PHP permalink fedilink source parent hideshow 1 child comment replies: [–] phoenixz@lemmy.ca 2 points 1 year ago PHP was shit 25 years ago (like everything else back then) and I never bothered to look at it ever again but to this day I keep shitting on it because reasons You permalink fedilink source parent
[–] aev_software@programming.dev 6 points 1 year ago 6 Whole Days! Try 25 years. And it still surprises me. permalink fedilink source parent
[–] Hoimo@ani.social 4 points 1 year ago Yeah, I had some webpages archived and tried to use javascript to clean them up, but I ended up parsing it as xml through Powershell instead. I've done something with Python and BeautifulSoup too, a long time ago. Both much easier than JS, but somehow JS is designed to work with web pages? Make it make sense. permalink fedilink source parent
[–] Aqarius@lemmy.world 3 points 1 year ago (1 child) JavaScript is by far the worst. PHP permalink fedilink source parent hideshow 1 child comment replies: [–] phoenixz@lemmy.ca 2 points 1 year ago PHP was shit 25 years ago (like everything else back then) and I never bothered to look at it ever again but to this day I keep shitting on it because reasons You permalink fedilink source parent
[–] phoenixz@lemmy.ca 2 points 1 year ago PHP was shit 25 years ago (like everything else back then) and I never bothered to look at it ever again but to this day I keep shitting on it because reasons You permalink fedilink source parent
[–] mindbleach@sh.itjust.works 6 points 1 year ago Or ship a browser to run a script. permalink fedilink source parent
[–] Shanmugha@lemmy.world 4 points 1 year ago (6 children) console.log([] == []) permalink fedilink source parent hideshow 6 child comments replies: [–] marlowe221@lemmy.world 2 points 1 year ago (1 child) It’s false. Different memory addresses, etc. permalink fedilink source parent hideshow 1 child comment replies: [–] Shanmugha@lemmy.world 1 point 1 year ago Like I didn't know 😂 permalink fedilink source parent [–] phoenixz@lemmy.ca 1 point 1 year ago (3 children) JavaScript sucks but I'll give it this one Arrays are complex structures with multiple values. Just because one looks like the other doesn't make them the same object. It's like taking two new objects form the same class, they look the same but work independently from eachother. I can add a value to one and the other would be unaffected, they'd both still be the same class permalink fedilink source parent hideshow 3 child comments replies: [–] Shanmugha@lemmy.world 1 point 1 year ago* (2 children) And I can't take this one. I did not ask if an object referenced by a is the same object referenced by b, I asked if two empty collections of values are equal. And an empty bag can easily be substituted by another empty bag, there is no class/instance tricky business here. And the fact that in JS arrays are objects is again JS-specific insanity. Still I thank you for sharing your thoughts permalink fedilink source parent hideshow 2 child comments replies: [–] phoenixz@lemmy.ca 2 points 1 year ago (1 child) Well it's what you'd want but not what it does, for one, but for another: comparing scalars is very easy, comparing complex structures is not. To compare one array with another you'd need to iterate over each element, recursively. That JavaScript handles arrays as objects is also not bad, that's just a language feature that you may like or not, not much can go wrong there. The reassignment of "this" or how JS handlesnumber comparison, yeah, that is infuriatingly bad permalink fedilink source parent hideshow 1 child comment replies: [–] Shanmugha@lemmy.world 1 point 1 year ago* (last edited 1 year ago) Yeah. JS is okay with lots of funny (and not fun) type coercions (toString on everything? really?), has no notion of reference as data type, but somehow automatic iteration on array by "==" operator is too much You are right, that's not want I would want from it, it is bad, I will never like that. And you are also right there are things even worse than this, no question there Edit: "implementing iteration on == would have been too much" is an invalid argument, if anyone had doubts permalink fedilink source parent
[–] marlowe221@lemmy.world 2 points 1 year ago (1 child) It’s false. Different memory addresses, etc. permalink fedilink source parent hideshow 1 child comment replies: [–] Shanmugha@lemmy.world 1 point 1 year ago Like I didn't know 😂 permalink fedilink source parent
[–] phoenixz@lemmy.ca 1 point 1 year ago (3 children) JavaScript sucks but I'll give it this one Arrays are complex structures with multiple values. Just because one looks like the other doesn't make them the same object. It's like taking two new objects form the same class, they look the same but work independently from eachother. I can add a value to one and the other would be unaffected, they'd both still be the same class permalink fedilink source parent hideshow 3 child comments replies: [–] Shanmugha@lemmy.world 1 point 1 year ago* (2 children) And I can't take this one. I did not ask if an object referenced by a is the same object referenced by b, I asked if two empty collections of values are equal. And an empty bag can easily be substituted by another empty bag, there is no class/instance tricky business here. And the fact that in JS arrays are objects is again JS-specific insanity. Still I thank you for sharing your thoughts permalink fedilink source parent hideshow 2 child comments replies: [–] phoenixz@lemmy.ca 2 points 1 year ago (1 child) Well it's what you'd want but not what it does, for one, but for another: comparing scalars is very easy, comparing complex structures is not. To compare one array with another you'd need to iterate over each element, recursively. That JavaScript handles arrays as objects is also not bad, that's just a language feature that you may like or not, not much can go wrong there. The reassignment of "this" or how JS handlesnumber comparison, yeah, that is infuriatingly bad permalink fedilink source parent hideshow 1 child comment replies: [–] Shanmugha@lemmy.world 1 point 1 year ago* (last edited 1 year ago) Yeah. JS is okay with lots of funny (and not fun) type coercions (toString on everything? really?), has no notion of reference as data type, but somehow automatic iteration on array by "==" operator is too much You are right, that's not want I would want from it, it is bad, I will never like that. And you are also right there are things even worse than this, no question there Edit: "implementing iteration on == would have been too much" is an invalid argument, if anyone had doubts permalink fedilink source parent
[–] Shanmugha@lemmy.world 1 point 1 year ago* (2 children) And I can't take this one. I did not ask if an object referenced by a is the same object referenced by b, I asked if two empty collections of values are equal. And an empty bag can easily be substituted by another empty bag, there is no class/instance tricky business here. And the fact that in JS arrays are objects is again JS-specific insanity. Still I thank you for sharing your thoughts permalink fedilink source parent hideshow 2 child comments replies: [–] phoenixz@lemmy.ca 2 points 1 year ago (1 child) Well it's what you'd want but not what it does, for one, but for another: comparing scalars is very easy, comparing complex structures is not. To compare one array with another you'd need to iterate over each element, recursively. That JavaScript handles arrays as objects is also not bad, that's just a language feature that you may like or not, not much can go wrong there. The reassignment of "this" or how JS handlesnumber comparison, yeah, that is infuriatingly bad permalink fedilink source parent hideshow 1 child comment replies: [–] Shanmugha@lemmy.world 1 point 1 year ago* (last edited 1 year ago) Yeah. JS is okay with lots of funny (and not fun) type coercions (toString on everything? really?), has no notion of reference as data type, but somehow automatic iteration on array by "==" operator is too much You are right, that's not want I would want from it, it is bad, I will never like that. And you are also right there are things even worse than this, no question there Edit: "implementing iteration on == would have been too much" is an invalid argument, if anyone had doubts permalink fedilink source parent
[–] phoenixz@lemmy.ca 2 points 1 year ago (1 child) Well it's what you'd want but not what it does, for one, but for another: comparing scalars is very easy, comparing complex structures is not. To compare one array with another you'd need to iterate over each element, recursively. That JavaScript handles arrays as objects is also not bad, that's just a language feature that you may like or not, not much can go wrong there. The reassignment of "this" or how JS handlesnumber comparison, yeah, that is infuriatingly bad permalink fedilink source parent hideshow 1 child comment replies: [–] Shanmugha@lemmy.world 1 point 1 year ago* (last edited 1 year ago) Yeah. JS is okay with lots of funny (and not fun) type coercions (toString on everything? really?), has no notion of reference as data type, but somehow automatic iteration on array by "==" operator is too much You are right, that's not want I would want from it, it is bad, I will never like that. And you are also right there are things even worse than this, no question there Edit: "implementing iteration on == would have been too much" is an invalid argument, if anyone had doubts permalink fedilink source parent
[–] Shanmugha@lemmy.world 1 point 1 year ago* (last edited 1 year ago) Yeah. JS is okay with lots of funny (and not fun) type coercions (toString on everything? really?), has no notion of reference as data type, but somehow automatic iteration on array by "==" operator is too much You are right, that's not want I would want from it, it is bad, I will never like that. And you are also right there are things even worse than this, no question there Edit: "implementing iteration on == would have been too much" is an invalid argument, if anyone had doubts permalink fedilink source parent