41 points

Programming Javascript is roughly the equivalent of hitting your head with a hammer or trying to uninstall McAfee.

permalink
report
reply
0 points

As if Javascript wasn’t complex enough, let’s introduce TypeScript and Coffescript and then write transpilers so we can convert said languages back into Javascript, which we could have done in the first place.

permalink
report
parent
reply
30 points

Nobody uses coffeescript anymore, and typescript is there to make things easier not harder.

permalink
report
parent
reply
2 points
*
Deleted by creator
permalink
report
parent
reply
1 point

These languages only exist because JS is so dumb in the first place

permalink
report
parent
reply
10 points

Use stringly-typed everything, and always padStart your numbers.
Saves running into issues with numbers outside the 52-bit integer range.
And padding start means you don’t have to worry about pesky sort functions.

Just don’t do maths. Simple.

Maybe you could do a manual sort.
Provide a “captcha” prompt, and ask which comes first in the list… You know, to make sure the user is a human! And you get free sorting.

permalink
report
reply
26 points

Use stringly-typed everything

Instructions unclear. Now 1+2=12.

permalink
report
parent
reply
16 points

I got 000001000002.

permalink
report
parent
reply
13 points

Provide a “captcha” prompt, and ask which comes first in the list… You know, to make sure the user is a human! And you get free sorting.

I mean, this strangely is a compelling idea…

permalink
report
parent
reply
11 points

I always try to prove myself human with wrong answers. Typically the first screen is an AI training screen, then the next screen is one the computer knows but wants to see if you know. By answering the first one wrong and the second correct, I’m hoping to poison the data.

permalink
report
parent
reply
5 points

Iirc they require 5 votes with the same response. Your effort won’t do anything, other than flag you as unreliable.

Afaik 4chan (of course) did that poisoning correctly, “classifying” the unknown words as “penis” (of course).

permalink
report
parent
reply
3 points

Based

permalink
report
parent
reply
2 points

o7

permalink
report
parent
reply
7 points

Just don’t do maths. Simple.

That’s a good rule for life in general, really.

permalink
report
parent
reply
3 points

Turn JavaScript into Bash with these easy steps…

permalink
report
parent
reply
7 points

Is there even any case where you would want this?

permalink
report
reply
7 points
*

Note if you put the image link in the url bar of the post rather than the body it lets people see it while scrolling (url + title can be edited so you can edit it to do that still if you want)

permalink
report
reply
3 points

thanks!

using 3rd party client (and first “image post” I’ve made on this platform) and wasn’t sure how image post should be made.

permalink
report
parent
reply
7 points

I couldn’t believe it, tried it out, what the actual heck? I mean I get all these weird string vs number comparison but sorting actual numbers and this comes out? What kind of drugs were the designers of javascript (or at least this function) on… Who thought it was a good idea to sort numbers lexicographically??

permalink
report
reply
5 points

Probably meth or cocaine, considering js was written by a single person in 10 days

permalink
report
parent
reply
1 point
*
Deleted by creator
permalink
report
parent
reply
1 point

Iirc Array.sort requires you to pass a function in, or it casts into strings and sort them.

permalink
report
parent
reply
1 point

That way they get to reuse the code for sorting strings!

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 7.2K

    Monthly active users

  • 954

    Posts

  • 36K

    Comments