git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Linus TorvaldsNext: Theodore Tso
Message 18 of 32 in “How do get a specific version of a particular file?”
  1. Theodore Ts'oFeb 27, 2007
  2. Christian MICHONFeb 27, 2007
  3. Peter BaumannFeb 27, 2007
  4. Alex RiesenFeb 27, 2007
  5. Alex RiesenFeb 27, 2007
  6. Johannes SchindelinFeb 27, 2007
  7. Theodore TsoFeb 27, 2007
  8. Johannes SchindelinFeb 27, 2007
  9. Theodore TsoFeb 27, 2007
  10. Randal L. SchwartzFeb 27, 2007
  11. Junio C HamanoFeb 27, 2007
  12. Linus TorvaldsFeb 28, 2007
  13. Junio C HamanoFeb 28, 2007
  14. Johannes SchindelinFeb 28, 2007
  15. Linus TorvaldsFeb 28, 2007
  16. Nicolas PitreFeb 28, 2007
  17. Linus TorvaldsFeb 28, 2007
  18. Nicolas PitreFeb 28, 2007
  19. Theodore TsoFeb 28, 2007
  20. Junio C HamanoFeb 28, 2007
  21. Theodore TsoFeb 28, 2007
  22. Junio C HamanoFeb 28, 2007
  23. Nicolas PitreFeb 28, 2007
  24. Johannes SchindelinFeb 28, 2007
  25. Linus TorvaldsFeb 28, 2007
  26. Junio C HamanoFeb 28, 2007
  27. Johannes SchindelinFeb 28, 2007
  28. Fix git-show man page formatting in the EXAMPLES sectionTheodore Tso, Feb 27, 2007
  29. Linus TorvaldsFeb 27, 2007
  30. Bill LearFeb 27, 2007
  31. Theodore TsoFeb 27, 2007
  32. Linus TorvaldsFeb 27, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.