4 ms·
Only that you need to artificially create all those things, even if they would not be necessary, while, when you work with simple functions, you just do them.
by zelphirkalt 6y ago
Only that you need to artificially create all those things, even if they would not be necessary, while, when you work with simple functions, you just do them.
Here is what I mean:
For example you would need to create an interface for some classes (or interface for other concept your language offers), which tells you in another place in the code, that an object implementing the interface will definitely have that one method you need. You need to create a class or whatever your programming language offers, to implement the interface and give that as argument.
There is a lot of boilerplate in this. It also is a question of explicit vs implicit at times. I usually like having things explicit instead of hidden or implicit and encoding knowledge in types is often great. However, if I am forced to create an interface, to be able to create a class implementing the interface, to be able to create an instance of that class, to be able to give that as an argument ... I prefer just being able to pass a procedure or function instead. At some point enough is enough and it does not make understanding the code easier, when I have to check in 3 places.