3 ms·
The clojure analogy actually works in favor of them switching to C++. Clojure takes the good ideas of Lisp and bolts extra convenience (and modernization) on to
by mcav 16y ago
The clojure analogy actually works in favor of them switching to C++. Clojure takes the good ideas of Lisp and bolts extra convenience (and modernization) on top, just like C++ adds extra convenience to straight C.
- tptacek 16y agoC++ is not just C with extra stuff. C++ programming and C progamming are different enterprises. The Linux kernel is full of all sorts of explicit "this block of memory is a struct txaz_fooblock and here's how we link them together" that C++ programmers simply don't write. This is before you even get into things like the template-y standard C++ library.
- mcav 16y agoTrue. I hadn't considered that.
- fleitz 16y agoAgreed. C++ is more like Bjarne Stroustrup bolts everything he's ever heard of onto C than "C with classes". Blatantly plagarized from: http://www.cvaieee.org/html/humor/programming_history.html http://www.cvaieee.org/html/humor/programming_history.html
- tptacek 16y agoI'm not making value judgements (yet). I'm just saying that, for instance, programming with templates, or modeling events as objects that are stored and passed around, or just basic nuts-and-bolts stuff like what your go-to code is for an array of elements; these are very different in C++ than they are in C. The idioms are different, the libraries are different, the principles are different.
- dman 16y agoC++ played the C as a gateway card very heavily early on, in the 80s that was a brilliant strategy, now not so much. If youre interested in efficiency straight C does fairly well (also because building foreign function interfaces for C code is much easier), if youre interested in correctness then some variant of haskell or ml will serve you with actual type checking, and if speed of writing code is what youre after then some dynamic language will do.
- silentbicycle 16y agoNo. It isn't about avoiding "modern" conveniences, it's about avoiding the specific baggage (a highly contextually-dependent grammar and operator overloading are two examples given) that C++ drags with it. He ends with: "But C++? I really don't think the "good features" of it are very good at all. If you leave C behind, do it properly and get some real features that matter. GC, some concurrency support, dynamic code generation, whatever."
- dman 16y agoClojure actually removes a lot of things from lisp. So it might not be a very good analogy to c and c++. For eg clojure doesnt have an object oriented framework like CLOS, does not have reader macros, currently has a much smaller set of inbuilt functions. Not to say it hasnt added new stuff, it has, eg persistent data structures, deep integration with the jvm. Also importantly all valid lisp programs are not valid clojure programs. In short, its a clean break from lisp which carries the useful ideas and the spirit of lisp forward.