this post was submitted on 04 Jun 2025
975 points (98.5% liked)

Programmer Humor

23844 readers
2457 users here now

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

founded 2 years ago
MODERATORS
 
(page 2) 50 comments
sorted by: hot top controversial new old
[–] onion_trial@europe.pub 6 points 2 days ago

Type of "not a number" is number

[–] kubica@fedia.io 24 points 3 days ago (2 children)

Lets fix it. I think that since we are removing the ones, then "11" - 1 should be equal to "".

[–] r00ty@kbin.life 15 points 3 days ago (5 children)

Should it, or should it be "1"? (just removing one, one)

load more comments (5 replies)
load more comments (1 replies)
[–] proctor1432@lemmy.world 10 points 2 days ago

Heck, I need to learn some new languages apparently. Here I was expecting an angry "CS0029 cannot implicitly convert type 'string' to 'int'!

[–] bradbeattie@lemmy.ca 19 points 3 days ago
[–] python@lemmy.world 19 points 3 days ago (1 children)
[–] masterspace@lemmy.ca 10 points 3 days ago* (last edited 3 days ago)

This is a really good interview, and does a good job highlighting Javascript's biggest strength: it's flexibility.

“It was also an incredible rush job, so there were mistakes in it. Something that I think is important about it is that I knew there would be mistakes, and there would be gaps, so I made it very malleable as a language.”

He cites the “discovery” of asm.js inside of JavaScript, calling it “another thing I’m particularly proud of in the last 10 years.” It uses the bitwise operators that were included in the original JavaScript which are now the basis for a statically-typed language with machine types for high-speed performance. “If it hadn’t been in there from 1995, it would’ve been hard to add later. And the fact that it was there all along meant we could do incredibly fast JavaScript.”

He tells InfoWorld it’s “this very potent seed that was in the original JavaScript from the 10 days of May in 1995.” JavaScript’s 32-bit math operators (known as bitwise operators) trace their lineage all the way back to the C programming language — and to Java. This eventually led to WebAssembly — a way to convert instructions into a quickly-executable binary format for virtual machines — and the realization that with a JavaScript engine, “you can have two languages — the old language I did with the curly braces and the functions and the shift operators, and this new language which is a binary language, not meant for reading by humans or writing. But it can be generated by compilers and tools, and can be read by tools…”

[–] bitjunkie@lemmy.world 2 points 1 day ago* (last edited 1 day ago) (5 children)

It's because + is two different operators and overloads based on the type to the left, while - is only a numeric operator and coerces left and right operands to numeric. But frankly if you're still using + for math or string concatenation in 2025, you're doing it wrong.

load more comments (5 replies)
[–] ZILtoid1991@lemmy.world 0 points 1 day ago

What no type safety does to an MF...

[–] bss03@infosec.pub 10 points 2 days ago* (last edited 2 days ago) (6 children)

This is my favorite language: GHC Haskell

GHC Haskell:

GHCi> length (2, "foo")
1
load more comments (6 replies)
[–] wreleven@lemmy.ca 12 points 2 days ago

Feels like it could be one of those facebook posts to test "smart" people. Only the top 1% of people can answer this simple math question: "11" + 2 * 2 - 3

load more comments
view more: ‹ prev next ›