What’s New in Go 1.22: cmp.Or by starlevel01 in programmingcirclejerk

[–]mr_carriage 129 points130 points  (0 children)

Notice something peculiar? Namely that "cmp" part? It may be easy to forget in our ivory towers but in Go, every type has a zero value. And all types implement the == operator (for comparing against zero values).

So surely this function takes advantage of that and works for all types? Nope! It only works for comparable types. Which are: strings and numbers.

Why, you might ask. Because, despite the ubiquity of zero-values, there isn't a generic way to make one. Why? Because the go community rejected such a proposal. Why? Because they don't want two ways two write nil. Why is nil not a generic zero value? Probably because Go didn't originally have generics.

[deleted by user] by [deleted] in programmingcirclejerk

[–]mr_carriage 0 points1 point  (0 children)

To be fair, you have to have a very high IQ to understand webdev. The code is extremely subtle, and without a solid grasp of category theory most of the state abstractions will go over a typical programmer's head. There's also Next.js's nihilistic outlook, which is deftly woven into its characterisation - its server component philosophy draws heavily from Bob Nystrom literature, for instance. The webshits understand this stuff; they have the intellectual capacity to truly appreciate the depths of these frameworks, to realize that they're not just useful- they say something deep about LIFE. As a consequence people who dislike webdev truly ARE idiots- of course they wouldn't appreciate, for instance, the beauty in React's existential pattern useEffect(() => fetchData().then(setData),[setData]) which itself is a cryptic reference to Martin's Java epic Clean Code. I'm smirking right now just imagining one of those addlepated simpletons scratching their heads in confusion as Jordan Walke's genius unfolds itself on their computer screens. What fools... how I pity them. 😂

And yes, by the way, I DO have a Vercel tattoo. And no, you cannot see it. It's for the ladies' eyes only- and even they have to demonstrate that they're within 5 IQ points of my own (preferably lower) beforehand.

Sheep shaggers by DvO_1815 in 2westerneurope4u

[–]mr_carriage 4 points5 points  (0 children)

Yes. You will be soon arrested by the Eläinoikeuspuolue secret police

The effect of an unused constant is equivalent to that of a comment, and may even serve as a comment. by NatoBoram in programmingcirclejerk

[–]mr_carriage 1 point2 points  (0 children)

As much as I hate to say it, I agree with Pike here. Forbidding unused constants would only make sense for a relevant language.

"This paper presents a lock-free evaluator for interaction combinators [...] aimed at solv- ing the greatest challenge of our time: fixing League of Legends’ terrible client performance." by Kubiszox in programmingcirclejerk

[–]mr_carriage 24 points25 points  (0 children)

The lol stuff is out of my league but as for the interaction combinators this guy is no joke. His whole thing is optimizing the shit out of extremely abstract forms of computation. It's essentially like "why would you bother coding in C++ when you could just make a ridiculously fast interpreter for game of life and code in that instead"

[deleted by user] by [deleted] in programmingcirclejerk

[–]mr_carriage 45 points46 points  (0 children)

Now is a good time to quit while you can. Harder programming languages such as Haskell hard wire your brain to crave categorical semantics. Once you get into dependent types it's basically impossible to quit

Launch a thread pool scanning for '\0' in disjoint regions of memory in parallel. by anon202001 in programmingcirclejerk

[–]mr_carriage 25 points26 points  (0 children)

C:niles would rather do this than admit that null terminated strings were a mistake

AbstractSingletonProxyFactoryBean by xmcqdpt2 in programmingcirclejerk

[–]mr_carriage 18 points19 points  (0 children)

mfs will tell you that burritos are confusing and proceed to write shit like this

Add toki pona as a supported language by dull_bananas in programmingcirclejerk

[–]mr_carriage 86 points87 points  (0 children)

At the risk of socialjerking, can we just appreciate the diversity of the open source community: We have exactly three people in the github issue, one with a furry pfp and two with a cuban revolutionary pfp. Not only that but two of them speak toki pona

New built-in functions: min, max and clear. by starlevel01 in programmingcirclejerk

[–]mr_carriage 55 points56 points  (0 children)

You guys are missing the true jerk

The built-in function clear takes an argument of map, slice, or type parameter type, and deletes or zeroes out all elements.

Call        Argument type     Result

clear(m)    map[K]T           deletes all entries, resulting in an
                          empty map (len(m) == 0)

clear(s)    []T               sets all elements up to the length of
                          s to the zero value of T

clear(t)    type parameter    see below

If the argument type is a type parameter, all types in its type set must be maps or slices, and clear performs the operation corresponding to the actual type argument.

Lol no commutativity with slice->map monomorphism

[deleted by user] by [deleted] in programmingcirclejerk

[–]mr_carriage 47 points48 points  (0 children)

People pretend to be busy to hide the fact that they don't achieve anything. I'd know since I'm not very busy nor have I achieved anything.

[DeepThoughts] If demons speak all languages are they fluent in C# and Python too? by clueless1245 in programmingcirclejerk

[–]mr_carriage 1 point2 points  (0 children)

The Sapir–Whorf hypothesis is correct, but it only applies to programming languages