16 ms·
We use templates, exceptions, STL, and Boost and deploy to tens of thousands of devices in the field. We have the advantage of a uniform hardware and OS platfo
by dkarl 16y ago
We use templates, exceptions, STL, and Boost and deploy to tens of thousands of devices in the field. We have the advantage of a uniform hardware and OS platform, so we don't have to worry about compiler issues.
We could reasonably replace C++ with a combination of C and a higher-level language. However, C++ is a much better language for our low-level code than C, and we have a lot of low-level code, so we have to take it seriously. If we took the route of using a high-level language to coordinate functionality implemented in C, we would end up using C++ to implement the "C" libraries, just for the benefits of RAII, exceptions, smart pointers, etc.
We could also succeed with a stable and efficient Common Lisp implementation. Other languages such as OCaml might work for us, but I'm not qualified to say.
We wouldn't bother changing at this point, though, unless we decided to create an entirely new product to compete with our current one. C++ is not a problem or a limitation for us. The shortcomings of C++ add a little bit of extra work, but they aren't a multiplier. Most other languages would aggravate our existing problems instead of just adding a constant factor of inconvenience.
And that's with templates, exceptions, STL, and Boost!
- suraj 16y agoOur project uses ICE (http://www.zeroc.com http://www.zeroc.com) for some scalable computing and a large part of the system is indeed written in C++ (with bunch of other libraries). However, developing large scale application in C++ requires discipline even at smaller level (Should I use auto_ptr or shared_ptr? Should I pass by reference or by pointer? Macro or template? GCC does what?). I have found C++ to be too complex to fit within my head. Even though I am programming almost exclusively in it for a while; I get a feeling that I am spending more time on placating the compiler than thinking about code. For cross platform work that uses a lot of libraries I would not recommend C++. It is where my frustration stems from.
- dkarl 16y agoI guess "discipline" is something we're lucky to have a lot of. 99% of usage questions are answered by looking at existing code -- just stay consistent unless there's a really good reason to depart. There are a bunch of things that would get you lynched in our group, but we rarely have to lynch anybody. There's a lot of mutual respect and a lot of respect for the existing coding style, especially among programmers who have done C++ programming elsewhere and suffered through unsafe and unscalable practices. I think most good C++ programmers spend years coming up to speed. I know I spent many hours coding for fun in college and read through TC++PL a couple of times (also for fun) before I started programming in C++ professionally. It was a wise investment, no doubt about it. It's an open question whether it would be a wise investment today, though.