DEV Community

Discussion on: Sometimes, the elegant implementation is just a function

Collapse
 
kungtotte profile image
Thomas Landin • Edited

I agree completely. Languages should enable the programmer, not hamper them. This is one of the reasons why my new favourite language is Nim. It lets you do pretty much whatever you want and with its Unified Function Call Syntax you can mix freely between OOP-style code and functional-style code without changing your coding style.

Example:

# These two are equivalent and will result in 
# some_procedure being called with arg1 and arg2
# as the first and second argument respectively
# 
# This works for independent procedures and class
# methods alike.
some_procedure(arg1, arg2)
arg1.some_procedure(arg2)