3 ms·
C/C++ because C is turning 50 years old soon which means there's 50 years worth of libraries to use in your projects, and C++ because it's more flexible & 'meta
by pizza 5y ago
C/C++ because C is turning 50 years old soon which means there's 50 years worth of libraries to use in your projects, and C++ because it's more flexible & 'meta' C, imo.
Languages that really flex their type/category theory muscles (Haskell et al come to mind) also, because I think the best of the next 50 years may have such languages as the origin point for the propagation of insanely good ideas to all the other ones.
- dankoncs 5y agoCing through this, I can tell you that you can C C++: https://godbolt.org/z/sWETvsoKd https://godbolt.org/z/sWETvsoKd (a demo for polymorphism in C90) Not only can you do OOP in C, you can also do FP, implement your own iterators and the like. (Function) pointers are your friend: https://news.ycombinator.com/item?id=28378627#28406874 https://news.ycombinator.com/item?id=28378627#28406874 And remember: FP = pure functions (no side effects) + immutable values Currying in C is essentially taking the address of a function pointer and not calling it. You can do lazy evaluation as well. The Cky is the limit! Yes, C++ is comfy, but you cannot really do FP with its STL. As STL containers require mutability by default. std::transform(v.begin(), v.end(), w.begin(), [](auto const& x){ /* ... */}); Transforming the contents of v requires a buffer(!) w. (The rescue: https://github.com/arximboldi/immer https://github.com/arximboldi/immer) In Python, this would be something akin to: map(lambda x: x, t); # t being a tuple type here This will return another tuple. Yeah, so these are just some pointers. I just wanted to stress that C can enable your creativity once you get the essence of it.