On Sun, Sep 23, 2007 at 09:54:10AM -0700, Linus Torvalds wrote:Certainly, in this respect, C++ provides only syntactic sugar over C, and there is a real danger of abuse, which leads to horrible programs. This is especially likely to happen to those who think that the evil of C++ is lying in templates, exceptions, or something other feature of C++, because they start to abuse the only "good" feature they know and inevitably end up with horrible code. user_ptr<somestruct> p; Whether it will convert to something or not depends entirely on the definition of user_ptr. So, it can be as explicit as you wish, or completely implicit. C++ does not impose anything on you here. So, the problem is not in C++ but in the crappy mentality -- "let's hide everything behind 'higher' abstraction" or "let's hide this thing too because we can". Yes, these people end up with total crap. And yes, those people tend to prefer C++ over C, just because C++ is better at hiding. But I don't think that C++ forces anyone to do that... Stroustrup was not a big fan of GC, so he made the language to be useful in absence of any GC, and it allows to manage memory and some other resources though not automatically, but with much less efforts than in C. Maybe, your idea of more explicit GC is better than what C++ offers. It is difficult for me to say without trying, but as you said most languages implement GC in the wrong way in your opinion, so I don't think I will have a chance to try any language that does it right. As to "caches" in Git, it works really nicely, but Git is not a programming language. It could do a lot of things implicitly, but it does not force you, except calling destructor when the control leaves the scope of declaration, but I hardly can consider it as implicit. Perhaps, you look at it from the kernel point of view. Otherwise, I would like to hear your arguments against it. In fact, I don't think it is possible to write generic algorithms without exceptions. Of course, if you write a program that can print an error to stderr and exit, there is no much need for them. So, it may depend on the task. I am not sure what is wrong with initializers and destructors in C++, but certainly there is no magic lifetime rules in C++, as it is fully determined by the scope. In fact, other high level languages that use GC have much more unpredictable lifetime rules for objects. Dmitry Potapov PS Please, do not confuse me with Dmitry Kakurin, who started this thread, because my position is opposite to his. Though I like C++, I fully understand most of your consideration in choosing C for Git. - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg Kroah-Hartman | [PATCH 005/196] Chinese: add translation of SubmittingDrivers |
| Vladislav Bolkhovitin | Re: Integration of SCST in the mainstream Linux kernel |
| Jan Engelhardt | intel iommu (Re: -mm merge plans for 2.6.23) |
git: | |
| David Miller | [GIT]: Networking |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Natalie Protasevich | [BUG] New Kernel Bugs |
