• 0 Posts
  • 9 Comments
Joined 1 year ago
cake
Cake day: June 15th, 2023

help-circle


  • Vim or emacs? I mean I know they were created a long time ago, but they are both pretty good pieces of software, both highly configurable. I don’t understand people aversion to them, rather than having the false belief that they are too complicated? When in reality they just aren’t intuitive in terms of modern stuff. But they aren’t difficult, just different.



  • Depending on your language, your closest analogue is going to be interfaces. C# even has a where clause where you can restrict a generic type such that any type substituted must implements one or more interfaces. You can get quite a bit of trait like working there, from the function input side of stuff.

    The biggest problem is, you can’t implement an interface for a type unless you have access to the type. So you’d have to really on wrapping types you don’t own to apply trait like interfaces to it.

    And then there’s minor issues like, no such thing as associated types, or being able to specify constants in a definition. But you can usually work around that in a less nice way.