3 ms·
> I mean, this is true. But traits are also very useful. Feels a bit like saying "driving is dangerous; avoid driving where possible". I agree. Just because it
by zzo38computer 3y ago
> I mean, this is true. But traits are also very useful. Feels a bit like saying "driving is dangerous; avoid driving where possible".
I agree. Just because it can be misused does not mean it is no good for anything. Note that you can declare types explicitly, and is usually how I do when I write anything in Haskell anyways, which makes the program clearer.
Also, changing the types after the rest of the program is already written, is going to be a problem in any programming language even without ad-hoc polymorphism, if you do not then consider everything that needs to be changed due to that.
> Also "allow-list" is so gross. Maybe pick something less divisive for future examples.
I agree with this, too. You can call it "allowed clients" or "list of allowed clients" if you want to, which is better in my opinion. (Simply "allow-list" does not even describe very well what it is for; what is being allowed?)