- One of my previous side projects used this idea in the extreme: It's a two-player online word game (scrabble with some twists) but all the state is stored in the URL so it doesn't need a backend.
https://scrobburl.com/ https://github.com/Jcparkyn/scrobburl
- Not to mention tracepoints (logging breakpoints), which are functionally the same as printf but don't require compiling/restarting.
- > I think if you [...] and have some luck you will succeed no matter what
Ignoring the politics of it, this wording is pretty funny to me.
- To be fair, this is the first thing that comes up when I google search for "DuPont connector" (after some sponsored shopping links).
- Genuine question: Is it illegal to advertise for a product that doesn't exist, can't be bought, and you have no intention of taking money for?
- > Conditionals are common enough that they can justify the indulgence
I think there's another much more important factor that distinguishes conditionals from most other ternary operations (clamp, mix, FMA, etc): The "conditional evaluation" part, which is what makes it hard to replicate with a regular function call.
- Agreed, and then there's the time of check/time of use issue with creating a user. Probably not a vulnerability if userService is designed well, but still a bit dubious.
- > squash an output into a range
This isn't the primary purpose of the activation function, and in fact it's not even necessary. For example see ReLU (probably the most common activation function), leaky ReLU, or for a sillier example: https://youtu.be/Ae9EKCyI1xU?si=KgjhMrOsFEVo2yCe
- > sorts and prints the latest results at a regular interval
Slightly more complicated than that, because you can only sort and print elements once you have _all_ the elements that came before them. Once you add that layer you've got quite a lot more code (and potential for mistakes) than the promises version.
- The real answer IMO is how they (don't) integrate with generics, first-class functions, and the type system in general. If you try using a checked function inside a stream() call you'll know exactly what I mean. Yes, it's technically possible to make a "functional interface" with a fixed number of checked exceptions, but in practice it's a huge PITA and most functions just don't allow checked exceptions at all.
Compare to ATDs, where any generic function taking a T can also be used with Result<T> exactly the same. (Not a perfect comparison, but there are lots of other scenarios where ATDs just compose better)
- > Java is perfectly capable of expressing an enum
I think this is a bit of an exaggeration, unless you're talking about very modern versions of Java (sealed interfaces and better pattern matching). Java has no good way to attach different data types to each enum variant (a la ADTs) except inheritance, and until recently switching over class types was a PITA.
- But then what name would they use for tuples, which are distinct from records?
- You forgot to test for associativity: ((1-1)-1) vs (1-(1-1)).
Your implementation does handle it correctly though, but it requires some care when using parser generators :)
- 3 points
- I've never experienced this. Have you tried disabling all your extensions to see if one of them is causing it?
- > what's wrong with pip freeze?
Aside from all the obvious issues of having no distinction between transitive and direct dependencies, it completely breaks cross-platform support if any of your dependencies have platform-specific sub-dependencies (which is not uncommon in python).
- Installing it is easy, what's harder is making sure all your collaborators have the same packages and versions of everything.
- I don't think anyone had tried copying it until after I figured out the problem, the bug report would've just been a screenshot.
- Here's a fun one that's not really code-related:
I was working on a web application with a maintenance mode feature where it would show a "system offline" while changes were rolled out etc. We noticed there was a typo (or so we thought) in the message, so it said "system olffine" instead.
Because this message could be overridden by site admins, there was a somewhat convoluted data flow to produce the final message. I grepped the codebase for "olffine" and found nothing. Then I checked my local DB to see what message was stored - it was spelled correctly. Then I stepped through the backend code to look at the message being returned - still correct.
Eventually I was back in my web browser with the page open on the left (spelled incorrectly) and devtools on the right (spelled correctly). What the hell?
It turned out the problem was that the font we were using had made a mistake with the "ffl" ligature so it rendered as "lff". We contacted the font author and they fixed it.
I actually agree with this, but that's exactly the opposite of what TFA is arguing.