Re: How do get a specific version of a particular file?
- From
Nicolas Pitre <nico@cam.org>
- Date
- Feb 28, 2007, 01:48 UTC
- Message-ID
- <alpine.LRH.0.82.0702272040050.29426@xanadu.home>
- In-Reply-To
- <Pine.LNX.4.64.0702271719300.12485@woody.linux-foundation.org>
On Tue, 27 Feb 2007, Linus Torvalds wrote:
Show 7 quoted lines
> > > On Tue, 27 Feb 2007, Nicolas Pitre wrote: > > > > /me wonders why Linux wasn't written in C++ with overloaded operators... > > Actually, there was a short while that we tried it.
I know. Amusing piece of history.
Show 5 quoted lines
> Overloading of operators wouldn't be very useful, though: it really only > pays in either real math (where having "+" etc do the right thing for > complex numbers/vectors/matrices/whatever is totally unambiguous and just > makes code a lot more readable) or with really trivial stuff (ie "+" for > string concatenation).
Well... We could have >> and << to replace memcpy(), copy_to_user(), copy_from_user(), and select the appropriate method depending on whether one is a user space pointer.
Or spin_lock++ and spin_lock--.
Or written_data >> file >> filesystem, replacing all fops methods with operators as well.
;-)
> Outside of math and really trivial stuff, it's just a horribly bad idea, > because it just makes for subtle and hard to understand code.
Indeed. Well it can make the intent of the code clearer but certainly not its implementation.
Nicolas