mori on Nostr: Yes, don't get me wrong. C#, C++ and C all have their "putty". C has `void*` (c++ by ...
Yes, don't get me wrong. C#, C++ and C all have their "putty". C has `void*` (c++ by extension although people tend to use templates) C# has `object` (but again, most people tend to use generics). The difference between generics and putty is simple. Generics give you some constraint, you can go "Hey, I don't really care if your input is brown, green, red or white but it must be expected to do X Y and Z." The language helps you enforce that. C++ has https://en.cppreference.com/w/cpp/language/constraints, C# has https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/generics/constraints-on-type-parameters, C has ??? (typically you don't do void*, if anything you do c style unions and most c unions are tagged using an enum. there's also other approaches to this. sjolsen.cdda.wav (npub144d…mn7h) did a post about this!). Javascript? The closest approximation to "constraints" and "generics" is typescript. So yeah, my analogy of javascript literally being "versatile putty" is hitting the nail right on the head.