3 ms·
Extension methods can only use the public API of objects. Opening a class and adding methods allows one to access the private API, too. That, of course, is only
by Someone 14y ago
Extension methods can only use the public API of objects. Opening a class and adding methods allows one to access the private API, too. That, of course, is only a difference in languages that have the public/private distinction.
- grn 14y agoBut it doesn't make reopening classes bad. You have a choice: you can use a public API or mess with implementation (for example for performance reasons).