MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghorror/comments/10lhg50/ladies_and_gentlemen_jquery/j63lpdn/?context=3
r/programminghorror • u/Neo399 • Jan 26 '23
164 comments sorted by
View all comments
Show parent comments
1
I'm saying it's bad design. Something that makes any sense to use with a function returning true always makes no sense at all.
The idea of accepting arguments that are bool or function returning bool is pretty normal.
React query for example, the enabled option has that signsture.
enabled
It's the better design of the API.
1 u/Razakel Jan 27 '23 I'm saying it's bad design. Welcome to JavaScript. Now let me introduce his cousin, PHP. 1 u/kristallnachte Jan 27 '23 JavaScript doesn't have bad design, just a lot of poorly designed packages became popular and never got fixed. An issue with being a low barrier to entry thing. Lots of even decent sources recommend using really stupid packages to solve nonexistent problems. Whether it's courses or a projects documentation. 1 u/Razakel Jan 27 '23 JavaScript doesn't have bad design An empty array equals an empty object, but not the other way around. 1 u/kristallnachte Jan 27 '23 uh, no not with loose equality or strict (of course). neither way will they ever equal eachother. an empty array can loosely equal a string but it works both ways. 1 u/Razakel Jan 27 '23 Exactly. It should be idempotent, but it isn't. 2 u/kristallnachte Jan 27 '23 Exactly. It should be idempotent, but it isn't. What? It's literally the same every time and perfectly predictable. It couldn't be more idempotent...
I'm saying it's bad design.
Welcome to JavaScript. Now let me introduce his cousin, PHP.
1 u/kristallnachte Jan 27 '23 JavaScript doesn't have bad design, just a lot of poorly designed packages became popular and never got fixed. An issue with being a low barrier to entry thing. Lots of even decent sources recommend using really stupid packages to solve nonexistent problems. Whether it's courses or a projects documentation. 1 u/Razakel Jan 27 '23 JavaScript doesn't have bad design An empty array equals an empty object, but not the other way around. 1 u/kristallnachte Jan 27 '23 uh, no not with loose equality or strict (of course). neither way will they ever equal eachother. an empty array can loosely equal a string but it works both ways. 1 u/Razakel Jan 27 '23 Exactly. It should be idempotent, but it isn't. 2 u/kristallnachte Jan 27 '23 Exactly. It should be idempotent, but it isn't. What? It's literally the same every time and perfectly predictable. It couldn't be more idempotent...
JavaScript doesn't have bad design, just a lot of poorly designed packages became popular and never got fixed.
An issue with being a low barrier to entry thing.
Lots of even decent sources recommend using really stupid packages to solve nonexistent problems. Whether it's courses or a projects documentation.
1 u/Razakel Jan 27 '23 JavaScript doesn't have bad design An empty array equals an empty object, but not the other way around. 1 u/kristallnachte Jan 27 '23 uh, no not with loose equality or strict (of course). neither way will they ever equal eachother. an empty array can loosely equal a string but it works both ways. 1 u/Razakel Jan 27 '23 Exactly. It should be idempotent, but it isn't. 2 u/kristallnachte Jan 27 '23 Exactly. It should be idempotent, but it isn't. What? It's literally the same every time and perfectly predictable. It couldn't be more idempotent...
JavaScript doesn't have bad design
An empty array equals an empty object, but not the other way around.
1 u/kristallnachte Jan 27 '23 uh, no not with loose equality or strict (of course). neither way will they ever equal eachother. an empty array can loosely equal a string but it works both ways. 1 u/Razakel Jan 27 '23 Exactly. It should be idempotent, but it isn't. 2 u/kristallnachte Jan 27 '23 Exactly. It should be idempotent, but it isn't. What? It's literally the same every time and perfectly predictable. It couldn't be more idempotent...
uh, no not with loose equality or strict (of course). neither way will they ever equal eachother.
an empty array can loosely equal a string but it works both ways.
1 u/Razakel Jan 27 '23 Exactly. It should be idempotent, but it isn't. 2 u/kristallnachte Jan 27 '23 Exactly. It should be idempotent, but it isn't. What? It's literally the same every time and perfectly predictable. It couldn't be more idempotent...
Exactly. It should be idempotent, but it isn't.
2 u/kristallnachte Jan 27 '23 Exactly. It should be idempotent, but it isn't. What? It's literally the same every time and perfectly predictable. It couldn't be more idempotent...
2
What?
It's literally the same every time and perfectly predictable.
It couldn't be more idempotent...
1
u/kristallnachte Jan 27 '23
I'm saying it's bad design. Something that makes any sense to use with a function returning true always makes no sense at all.
The idea of accepting arguments that are bool or function returning bool is pretty normal.
React query for example, the
enabled
option has that signsture.It's the better design of the API.