Dumb question. What are the point of custom attributes when code comments are perfectly fine?

I’ve looked at examples on MSDN and the only examples they have are for storing developer information in your code, but what’s the point in that when you can just use a code comment which will then get stripped once compiled? I’ve used custom attributes once, and that was for tagging classes with an AttachTo attribute which modders can set so my game knows which object to put their script on instead of modders having to add an AttachTo method which then gets invoked via Reflection. Can someone give me some insight on what attributes can do that code comments can’t? Other than just being metadata stored inside of scripts. Thank you!

submitted by /u/CARVER-D12
[link] [comments]

Leave a Reply