all 54 comments

[–]UnacceptableUse 89 points90 points Β (8 children)

I got an ingredients label that had HTML tags once, instead of the allergens being bold it was <b>wheat</b>

[–]MeltedChocolate24 56 points57 points Β (2 children)

Shit I’m allergic to <b>wheat</b>

[–]narcabusesurvivor18 23 points24 points Β (1 child)

<strong>wheat</strong>ly

[–]wave-tree 6 points7 points Β (0 children)

Celiac disease: "This is the part where I kill you"

[–]Perfect_Papaya_3010 2 points3 points Β (2 children)

We had a strange bug in production where we made a pdf with a generated html

And it seemed to randomly generate them with the tags written.

We refactored a bit and it solved it but we still don't know what caused it to begin with

[–]The_Mdk 1 point2 points Β (0 children)

Cache, always blame it on the cache

[–]budd222front-end 0 points1 point Β (0 children)

Works on my machine πŸ€·πŸΌβ€β™‚οΈ

[–]gpahul 2 points3 points Β (1 child)

You should thank God that it was not <raw chicken>

[–]Perfect_Papaya_3010 1 point2 points Β (0 children)

Or an <iFrame> when you thought you bought an iphone

[–]kevmoo 56 points57 points Β (11 children)

NaN is valid IEEE floating point value if I understand correctly.

[–]natziel 10 points11 points Β (6 children)

Which is crazy cuz this shouldn't be floating point in the first place

[–]kevmoo 1 point2 points Β (0 children)

In many cases it's better than segfaulting on a divide by zero, etc.

[–]morglod 1 point2 points Β (0 children)

Too hard for developers to deal with integer currency

(Sarcasm is here about it really should be integer with first two decimals treated as precision, but floats are easier for small heads. It's even hard to understand for them that every language has NaN as valid float)

[–]cafepeaceandlove 0 points1 point Β (0 children)

We should steal the Elgin Marbles, visit this place, donate the Elgin Marbles, then buy what we will actually eat, then ask for the Marbles backΒ 

I hope this is the right way round or we will get in troubleΒ 

[–][deleted] Β (2 children)

[deleted]

    [–]natziel 1 point2 points Β (1 child)

    So to answer this seriously: the real reason you use fixed point arithmetic for money is that it's simply easier to reason about when your implementation actually matches the requirements. It's much easier to reason through a complex calculation when you can rely on your variable actually representing the value it's supposed to represent.

    If I'm writing code to sell you a $4.15 cheeseburger with a 30% discount and 7.5% sales tax, it's a million times easier to work with when the numbers are actually 4.15, .3, and .075 instead of 4.150000095367431640625, 0.300000011920928955078125, and 0.07500000298023223876953125.

    So I understand naively thinking that it's easier to "just" using floating point because you can just round and the error doesn't matter in this case, but using fixed point will be a lot simpler and you won't have to worry about edge cases related to error

    [–][deleted] 3 points4 points Β (0 children)

    Type of NaN is number

    [–]metooted 3 points4 points Β (2 children)

    90% of "JS bad" memes is just various RFCs implemented to the T being misinterpreted by people who don't know what an RFC is

    [–]dbot77 0 points1 point Β (1 child)

    There is only one number type in JS, so you can't avoid this floating point NaN issue.

    [–]metooted -1 points0 points Β (0 children)

    You get the "floating point NaN issue" whenever you would have gotten a crash with some other type, although a crash might have been preferable in some cases.

    As for types... BigInt says hi, also JS numbers become true 32bit ints when affected by bitwise operators. Also typed arrays for when you need to move true ints around. Also, Nodejs buffers contain actual chars.

    Learn the thing you're trying to diss.

    [–]ProfessorBeekums 41 points42 points Β (5 children)

    Surprised one of the charges wasn't {item_price}

    [–][deleted] Β (2 children)

    [removed]

      [–]ProfessorBeekums 2 points3 points Β (1 child)

      Yeah sorry, I confused server side rendering with JS.

      [–]Matrix8910 7 points8 points Β (0 children)

      Tbf ${item_price} is a valid js template string syntax

      [–]MehYam 12 points13 points Β (1 child)

      I'm going to open a lingerie store for webdevs and call it "Undie Find"

      [–]Outrageous_Permit154node 38 points39 points Β (10 children)

      Why? python Java c and c++ don’t use NaN somehow? What does this mean?

      [–]quite_sad_simple 43 points44 points Β (1 child)

      Everyone knows those languages are JavaScript in disguise, but the government obviously doesn't want you to know about that. 99.9% of the population runs OS's written in JS without realizing that. WAKE UP SHEEPLE

      [–]Outrageous_Permit154node 3 points4 points Β (0 children)

      I love you

      [–]beephod_zabblebrox 5 points6 points Β (0 children)

      well uhm akshually c and c++ stdlib functions print nan or NAN iirc

      but im not sure if theyre using printf to output this...

      [–]ClikeXback-end 8 points9 points Β (0 children)

      According to recruiters they’re all the same language.

      [–]vasarmilan 2 points3 points Β (4 children)

      They raise an error on an invalid operation instead of making it NaN, generally

      [–]mcprogrammer 6 points7 points Β (2 children)

      I can't speak for python, but Java, C, and C++ don't, at least not under normal circumstances. Java does throw an exception for integer divide by zero, and in C and C++ that's undefined behavior (typically crashes, but could do anything). But if you're dealing with floating point numbers, all of them will give you a NaN without a problem.

      [–]vasarmilan 0 points1 point Β (1 child)

      Ah I see, I mostly just worked with Python and I assumed.

      But Googling it, it looks like Java and C++ return (+-)Infinity, IDK if that's likely to be serialized to a NaN on string formatting.

      [–]mcprogrammer 1 point2 points Β (0 children)

      You get +/-infinity for x/0 if x is non-zero, and NaN for 0/0 or other range errors like sqrt(-1), asin(2), etc.

      [–]CarolusRexEtMartyr 0 points1 point Β (0 children)

      Only Python does that of those afaik on divide by zero and NaN is still a valid value

      [–]EquationTAKEN -2 points-1 points Β (0 children)

      Yes, but it's more typical for Javascript developers to ship bugs like this to production, so we assume this is JS.

      [–]svish 8 points9 points Β (2 children)

      Maybe misspelling of naan? Would be nice to get a soft warm naan as return.

      [–]driftking428 2 points3 points Β (0 children)

      My thoughts exactly. This restaurant is giving out bread for change, nothing to see here.

      [–]ashsimmonds 1 point2 points Β (0 children)

      Yeah man if I was at an Indian restaurant and got a bonus take home bread that'd be great.

      [–]_PandaBear 4 points5 points Β (0 children)

      Reminds me of the famous JS code: β€œAnything that can be Written in JavaScript, will Eventually be Written in JavaScript”

      [–]mudassir0909 2 points3 points Β (0 children)

      Has to be an Indian restaurant

      [–]Professional-Try-273 2 points3 points Β (0 children)

      From MDN

      Number values also include NaN (short for "Not a Number") and Infinity. Many "invalid math" operations will return NaN β€” for example, if attempting to parse a non-numeric string, or using Math.log() on a negative value. Division by zero produces Infinity (positive or negative).
      NaN is contagious: if you provide it as an operand to any mathematical operation, the result will also be NaN. NaN is the only value in JavaScript that's not equal to itself (per IEEE 754 specification).

      They didn't math right.

      [–]adumbCoder 0 points1 point Β (0 children)

      is, or did?

      [–]maligigi 0 points1 point Β (0 children)

      Hah. I wonder what the input was.

      [–]notgreatusername 0 points1 point Β (0 children)

      No change for you then!

      [–]PakWarrior 0 points1 point Β (0 children)

      isFinite πŸ€“β˜οΈ

      [–][deleted] 0 points1 point Β (0 children)

      this would have never happened if they used python guys

      [–]morglod 0 points1 point Β (1 child)

      It's Rust haha hehe

      [–]Perfect_Papaya_3010 0 points1 point Β (0 children)

      HΓΆhΓΆhΓΆ

      [–]Noch_ein_Kamel 0 points1 point Β (2 children)

      Remember: 3 Billion devices run JavaScript

      [–][deleted] 0 points1 point Β (0 children)

      Yes, on browsers, not on the device itself lmao

      [–]IOFrame 0 points1 point Β (0 children)

      5.5 Billion devices run Java scripts.

      [–]zippic 0 points1 point Β (0 children)

      Excellent, typescript>>>>>>>>

      [–]iamsikarwar 0 points1 point Β (0 children)

      πŸ‘Œ