Clément Boudereau🦀 · @cboudereau
63 followers · 131 posts · Server fosstodon.org
RJ · @RemeJuan
47 followers · 799 posts · Server fosstodon.org
RJ · @RemeJuan
40 followers · 474 posts · Server fosstodon.org
Jeroen-bart Engelen · @yeep
41 followers · 217 posts · Server mastodon.nl

On today's "Adventures in pattern matching with C#":

Replacing 19 lines of nested if's with this:

return device switch
{
null => Assignability.UnknownDevice,
{ AccountNumber: null } => Assignability.Assignable,
_ => device.AccountNumber!.Value == accountNumber ? Assignability.AlreadyAssigned : Assignability.AssignedToOtherAccount
};

#PatternMatching #csharp #dotnet

Last updated 3 years ago

Jan :rust: :ferris: · @janriemer
405 followers · 665 posts · Server floss.social

@AstraKernel @lx Well, I guess the prompt was something like "Produce a buffer overflow in Rust".

As 's are just stupid statistical models, they think: Hey, I've seen _many_ buffer overflow examples in C and "buffer overflow" mentioned with C, so let's convert that to Rust - et voilá.

It doesn't _understand_ that Rust is a safe language.

We should not expect reasoning or intelligence from an AI.

It is pattern matching, nothing more.

#noreasoning #PatternMatching #ArtificialIntelligence #AI

Last updated 3 years ago

Antonio Hdez. Blas 🔵 · @nihilipster
105 followers · 264 posts · Server fosstodon.org

"Continually extending w/ new "features" is frankly a trap in programming language design that stems right back to the 1970s & 80s when pattern matching was first introduced... Why?"

github.com/fsharp/fslang-sugge

#PatternMatching

Last updated 5 years ago