by general_failure · 13y ago · 0 comments
That said, c++11 is a language that wants to be everything. Functional, object oriented, procedural, imperative, declarative and what not. The end result is slush.
I like how it's a lot more expressive than C, but without the needless verbosity of a language like Java.
I prefer that to some "it's automagically captured" behavior (in the context of C++). At least so I know and can choose if the closure captures a reference or makes a copy - which can be a very important detail.
For the stuff I usually do in C++ I love this kind of freedom. For other stuff where speed and/or memory layout/usage are not that important there are higher level languages like Python or Common Lisp.
A high level feature like lexical closures should not get bogged down with low-level details (like the mechanics of how variables are captured). It's a waste of time and mental energy, distracting programmers from important issues and making debugging more complicated and time-consuming. Spending time deciding which method of capturing variables is faster screams "premature optimization."
You can state the same for any multi-paradigm language.
What I would much rather prefer is a "from scratch" approach to learning C++11 (assuming no prior knowledge about programming, but having a basic knowledge about memory etc...) That would really help curb the tide of novice programmers seduced by sexier languages that have no concept of safety, efficiency and correctness.
What I like about this book is that it teaches you the new C++ way right from the beginning. Rather than walking you through the history of C, it gets you to the modern practices immediately.
Disclaimer: I have only read the first 10% of the book myself, but so far I like it.
Why do you consider mixing them bad?