Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Reflection as a tool for generic solutions (variadic.me)
4 points by shintoist on Oct 17, 2012 | hide | past | favorite | 2 comments


The problem with using reflection is it means abandoning the static typing and IDE assistance that are the main advantages of a language like C#. If you don't care about those, and just want the power of code like that in the article, why not use a language designed for this coding style such as Python or Ruby?


Obviously you have to make a choice (another big issue is performance), balance the ease with which you could solve a particular problem with the complexity of the solution.

Just because it's possible to do something doesn't mean it's a good idea. However, there are cases where reflection lets you solve problems in these languages in a nice way. At the very least, understanding the feature of reflection makes you a more competent programmer.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: