Does functions being virtual as default violate close for modification? Does functions being final as default violate open for extension?
Should functions be final as default if multiple inheritance is implemented?
How about classes? Should them be virtual as default or final as default?
Or should both final and virtual be explicit? (i.e. Force coder to declare every functions or classes as final or virtual like how in most language there isn't a default return type.) Since explicit is better than implicit.
Final means a function or a class can't be inherited or overrode, virtual means a function or a class can be inherited or overrode.
Set classes being virtual as default will imply a tighter coupling across the code, as inheritance is encouraged, but the composition and interface over inheritance, hence inheritance should be discouraged, so in my opinion, classes should be final as default. Same with functions, they being virtual as default not only violate close for modification but encourages inheritance which will imply a tighter coupling across the code.
Explicitly stating them could be an option, but that just adds redundancy to your code..