WTF Bites
-
-
To put it in perspective of a different genre, it's like in fpp you would mow down 5000 enemies for tens of hours in many locations, all in persuit of a final boss. You finally get to his hq and... he's not there. He just left. No final battle. The end.
I see you've played Rage too.
-
@boomzilla said in [WTF Bites](/post/1580684
Likewise, the advice to not worry about performance of reflections is just as ridiculous.
Meh. I could reflect my ass off and not notice the difference. In fact, because I use JSF and Java Beans and shit, I do!
If you do shit, I recommend not reflecting your ass off.
-
@boomzilla said in [WTF Bites](/post/1580684
Likewise, the advice to not worry about performance of reflections is just as ridiculous.
Meh. I could reflect my ass off and not notice the difference. In fact, because I use JSF and Java Beans and shit, I do!
If you do shit, I recommend not reflecting your ass off.
Too late!
-
-
@pie_flavor said in WTF Bites:
@topspin C# has three methods of equality -
==
,IEquatable.Equals
, andobject.Equals
. All three are overridable, and all three could mean separate things.And you think JavaScript is
?
-
-
@Mason_Wheeler said in WTF Bites:
Just out of curiosity, have you ever played Eversion?
No, why?
I see you've played Rage too.
Bingo.
-
@Vixen I'm sure Kia would like that very much but I've got a perfectly good one already
-
@Mason_Wheeler said in WTF Bites:
Just out of curiosity, have you ever played Eversion?
No, why?
Just wondering. You should try it. It's a Mario-esque platformer about a cute flower-person-thing who has to use his reality-bending powers to rescue the princess. It's a lot of fun.
-
@Mason_Wheeler said in WTF Bites:
Mario-esque platformer
reality-bending powersSounds neat, and apparently I've got it on Steam already.
-
I just checked my Gmail spam folder. It's full of YouTube notifications.
Aren't YouTube and Gmail both owned by Google?
-
@pie_flavor said in WTF Bites:
@topspin C# has three methods of equality -
==
,IEquatable.Equals
, andobject.Equals
. All three are overridable, and all three could mean separate things.And you think JavaScript is
?
Well, JavaScript has around 27 ways to do coercion before testing equality, and the result isn’t even transitive.
-
-
coercion
Found your problem.
JavaScript?
No, not my problem.
-
That's an accurate depiction of the Holy Trinity, but not all Christians believe in such a thing.
Filed under: I'm an atheist so I'm obliged to bring it up almost as often as vegans.
-
I didn't even fucking know about the '\t' thing.
-
There are only a few values you should ever put to the right of
==
in JavaScript.== true
|== false
to determine if a value is truthy or falsy, respectively (alternatively,!!foo
and!foo
),== null
to determine if a value is nullish. For everything else, use===
.
-
There are only 2 values you should ever put to the right of
==
in JavaScript.== false
to determine if a value is falsy (alternatively,!foo
),== null
to determine if a value is nullish. For everything else, use===
.I cringe whenever I see
== false
or== true
, so either you’reor JavaScript is
. Since the latter is true anyway, I’m giving you the benefit of the doubt.
-
I cringe whenever I see == false or == true
It's just casting a value to boolean.
-
The real problem is:
==
doesn't mean what people expect it to mean.Same issue with
this
andArray
. These all have the same name as familiar constructs from other languages, but are actually something different.
-
Arrays for example are exotic objects, with a special behavior with the
length
property (thus exotic), and a prototype with lots of useful methods,Apart from that, they're hashmaps like all other JS objects, and can have gaps, and non-numeric properties.
-
you think your tab backlog is high....
i have four windows that are maximized open. all four windows have so many tabs open there's not enough room to show the favicons without squishing them.
it's probably time to open a fifth window so i can find the tabs i'm using again...I'm at about 50 browser windows, each with multiple tabs (sometimes with a lot of tabs, but usually no more than 6 or 7). I perhaps ought to close a few sometime.
I had about that many in Chrome, but it was unusable. Tens of seconds for every page load, and making my computer work so hard that my CPU fan would run full-speed within just seconds of waking up from sleep and constantly until putting it to sleep again. So I switched to FF. Now only 37 tabs in 11 windows.
-
-
@Tsaukpaetra said in WTF Bites:
@levicki said in WTF Bites:
I don't think that is how arguing between normal adults works
YMBNH.
E_NORMAL_ADULTS_NOT_FOUND
-
Another JS gotcha:
x || y || z
will evaluate to the first value that is truthy, or the last value if none are. Similarly,x && y && z
will return the first value that is falsy, or the last value if none are.These results are often treated as if they are boolean, but that's only true if the arguments are booleans! You get a truthy or a falsy result, not necessarily true or false.
Oh, and some people use these as if they were
if
statements. Those people are.
-
@HardwareGeek said in WTF Bites:
@levicki said in WTF Bites:
your point is mute.
If only the posters with moot points would be mute!
This is Mute
Apparently this is Moot..... ¯_(ツ)_/¯ okay Google, whatever you say.... That's Moot.
-
Another JS gotcha: x || y || z will evaluate to the first value that is truthy, or the last value if none are.
that's not a gotcha! That's just Javascript having null coalescing before null coalescing was cool!
function doAThing(options) { options = options || { default: 'value' } // ... Code here }
-
Another JS gotcha: x || y || z will evaluate to the first value that is truthy, or the last value if none are.
that's not a gotcha! That's just Javascript having null coalescing before null coalescing was cool!
OK, then the gotcha is that
false
and0
are often valid choices, and what you meant wasfoo = ( foo == null ) ? {} : foo;
-
What in the hells. I don't even.
https://www.youtube.com/watch?time_continue=30&v=sJbF6k-e4-s
Nope! thread is
.
-
OK, then the gotcha is that false and 0 are often valid choices
not if you intend
options
to be an object.if on the other hand they are valid values then.... well you're on your own there. guess you'll need the ternary.
though if you are using the ternary at least use triple equals instead of double to disable type coersion rules.
-
though if you are using the ternary at least use triple equals instead of double to disable type coersion rules.
No, I used double equal there deliberately to test for
nullish
values. (undefined
andnull
are nullish)
-
typeof null === 'object'
typeof NaN === 'number'
-
-
-
That's Moot.
Shoe on head or GTFO!
okay.........
-takes shoe off left foot and puts on her head-
Is this better?
-
@Vixen I'm sure Kia would like that very much but I've got a perfectly good one already
Let me guess. You just bought it; that's why you're seeing so many "targeted" ads.
-
I cringe whenever I see == false or == true
It's just casting a value to boolean.
I personally like
!!whatever
-
-
@topspin said in WTF Bites:
That's an accurate depiction of the Holy Trinity, but not all “Christians” believe in such a thing.
FTFY
-
@HardwareGeek Yes, I don't believe in Christians either.
-
@HardwareGeek said in WTF Bites:
@Vixen I'm sure Kia would like that very much but I've got a perfectly good one already
Let me guess. You just bought it; that's why you're seeing so many "targeted" ads.
I don't think over three years is recent, especially in online ad terms. I have no idea why I got this particular ad, much less six of it
-
@pie_flavor said in WTF Bites:
@topspin C# has three methods of equality -
==
,IEquatable.Equals
, andobject.Equals
. All three are overridable, and all three could mean separate things.And you think JavaScript is
?
Absolutely. A language where access of an invalid variable or property does not error at compile time and does not error at runtime but instead silently hands you an invalid value (which will throw if you try to access any of its properties) is quite literally the worst thing I've ever heard of. I'm sure everything else is much worse (like function literals and
this
) but that one thing sets it miles apart from all other languages.There are like three features, total, of C# that can be annoying, and equatability is one, and it's not even as bad as I made it sound. Most importantly it's only godawful in the hands of someone seeking to make it so. Compare to
undefined
, a feature that you would never use intentionally but will bite you in the ass a hundred thousand times when the runtime uses it on you in a situation that wouldn't exist in literally every other language.
-
six of it
I've seen many news (or "news") sites where the same ad is repeated multiple times — fixed banner at the top and/or bottom of the page, sidebar, and inline every screenful of content.
-
@pie_flavor said in WTF Bites:
A language where access of an invalid variable or property does not error at compile time
quite literally the worst thing I've ever heard of
Be glad you've never used NVelocity.
-
@error aha, so it's just properties now. Great. That lessens it by about 0.03%.
-
@pie_flavor said in WTF Bites:
@error aha, so it's just properties now. Great. That lessens it by about 0.03%.
For about a decade now.
You could use proxies to test for non-existing property access. The problem is, a lot (a lot) of JavaScript code uses property introspection. It literally relies on this behavior.
-
@error like I said, genuinely the worst thing I've ever heard of.
-
WTF of my day: Today's evening saw a meeting of local business men in our auditorium, with there being a keynote speaker.
As I'm the resident tech wizard, I was supposed to set everything up and my principal told me that I was allowed to leave after the speech. The notes stated that the speech was supposed to take about 30 minutes, tops, and it was supposed to start after 30 minutes of some announcements and handing out prices.
The first part took 45 minutes instead and the speech is now fast approaching 90 minutes. It's also full of platitudes.
Someone kill me.
-
I didn't even fucking know about the '\t' thing.
Nothing special about '\t'. Any whitespace string will do.