git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Pierre Habouzit <madcoder@debian.org>
To: Marco Costalba <mcostalba@gmail.com>
Cc: David Kastrup <dak@gnu.org>,
	Frank Lichtenheld <frank@lichtenheld.de>,
	Alex Unleashed <alex@flawedcode.org>, Kyle Rose <krose@krose.org>,
	Miles Bader <miles@gnu.org>,
	Dmitry Kakurin <dmitry.kakurin@gmail.com>,
	Git <git@vger.kernel.org>
Subject: Re: [OT] Re: C++ *for Git*
Date: Sun, 23 Sep 2007 12:45:25 +0200	[thread overview]
Message-ID: <20070923104525.GC7118@artemis.corp> (raw)
In-Reply-To: <e5bfff550709230229t79004ce2j5ce8c2ae7744a7f2@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4098 bytes --]

On Sun, Sep 23, 2007 at 09:29:45AM +0000, Marco Costalba wrote:
> On 9/23/07, David Kastrup <dak@gnu.org> wrote:
> > David Brown <git@davidb.org> writes:
> >
> > > On Sun, Sep 23, 2007 at 04:09:51AM +0200, Frank Lichtenheld wrote:
> > >>On Sun, Sep 23, 2007 at 12:50:00AM +0200, Alex Unleashed wrote:
> > >>> I'd say being forced to be explicit is a good thing here, so that the
> > >>> programmer at least has some sort of good understanding of what is
> > >>> going on, and chances are that if he doesn't really know, things just
> > >>> won't work out (quite unlike a lot of other languages where this
> > >>> programmer might actually end up with something half-assed that
> > >>> "mostly" works).
> > >>> For some reason it seems to me a lot harder to find bad programmers
> > >>> surviving using C than a lot of the other languages.
> > >>
> 
> Well, according to your reasoning assembly should be the gotha of
> elite programmers, only very disciplined and meticulous programmers
> survive, much more then in C.

  This non argument was raised before in the recent thread we just had.
Could we at least wait say, a month, before spawning the same trolls
again and again ?

> > C++ is good for creating black boxes.
> 
> Object oriented languages creates black boxes: that's the reason why
> object oriented exsists and also the reason why Linus hates it ;-)

  This is just nonsense. This has been proved, though I can't find the
paper about this anymore, than modules (or packages whichever name you
give them) plus abstract types are as good as OO languages at creating
black boxes. I mean it has been proved that it gives the exact same
amount of expressiveness. So please stop with this myth. And don't speak
for people, I would be very surprised that Linus would dislike "black
boxes". Abstractions are good, when used wisely, and I would be much
surprised to see Linus pretend otherwise.

  The real problem with big applications, is not that they are written
with C, C++, D, APL or Perl, but that they are big. Most of the time,
big means that many people are not able to grok the big picture, and you
end up with 102 implementations of base64, 10 string libraries, 4
general purpose buffers, and at least half of the common lisp
features[0]. And for the record git is _not_ big. It's around 100k
slocs, which rougly the size of postfix or mutt.

  I for one do believe that bad programmers will write bad code
whichever language they use, and that what is wrong is to end with code
bases in one monolithic thing like in [1]. OO design patterns and other
craps of the like helps you generate insane amount of codelines, and
hide all the simplicity under huge loads of proxies and interfaces. In
C, when your API suck, you usually need to refactor it under the
pressure of the huge amount of code you have to repeat each time you use
the API. in an OO language, you add a new class for that purpose. In C++
it's even worse, you just hide it in a copy constructor, or an operator
so that when you write:

  Foo a = b;

  Instead of a simple memcpy, you end up with an horrible pile of crap
to be started and run behind your back. C++ is very good at hiding bad
code. At least in C, when someone writes bad code, it's obvious to any
reader. C has many many quirks, I don't discuss that, but OO programming
solves none of them, and the problems OO addresses are not the one that
may interfere in the git development. I mean, the two really interesting
things in OO (that haven't a tremendous cost in return) are member
overloading and inheritance. I see very few places where git would
benefit from that, and believe me, I looked at git's code with
refactoring in mind and only that.

  Can we go back to git now ?



  [0] http://en.wikipedia.org/wiki/Greenspun's_Tenth_Rule

  [1] http://www.ohloh.net/projects/29/analyses/latest

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2007-09-23 10:45 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-22 10:42 C++ *for Git* Dmitry Kakurin
2007-09-22 11:11 ` David Kastrup
2007-09-22 12:48 ` Johannes Schindelin
2007-09-22 15:23   ` Marco Costalba
2007-09-23  4:54     ` Dmitry Kakurin
2007-09-22 15:15 ` Kyle Rose
2007-09-22 18:08   ` Miles Bader
2007-09-22 18:25     ` [OT] " Kyle Rose
2007-09-22 19:11       ` David Kastrup
2007-09-22 22:50       ` Alex Unleashed
2007-09-23  2:09         ` Frank Lichtenheld
2007-09-23  6:25           ` David Brown
2007-09-23  7:23             ` David Kastrup
2007-09-23  9:29               ` Marco Costalba
2007-09-23  9:42                 ` David Kastrup
2007-09-23  9:50                   ` Marco Costalba
2007-09-23 10:45                 ` Pierre Habouzit [this message]
2007-09-23 13:42                   ` Marco Costalba
2007-09-23 14:23                     ` Nicolas Pitre
2007-09-23 14:45                       ` Marco Costalba
2007-09-23 14:37                     ` David Kastrup
2007-09-23 15:15                       ` Marco Costalba
2007-09-23 17:49                       ` Paul Franz
2007-09-23 16:54                     ` Linus Torvalds
2007-09-23 18:05                       ` Marco Costalba
2007-09-23 18:30                         ` David Kastrup
2007-09-23 18:43                           ` Marco Costalba
2007-09-23 19:11                             ` David Kastrup
2007-09-23 21:22                       ` Dmitry Potapov
2007-09-23 21:31                         ` David Kastrup
2007-09-23 23:10                           ` Robin Rosenberg
2007-09-23 22:25                         ` Reece Dunn
2007-09-24 10:46                           ` Dmitry Potapov
2007-09-22 22:24   ` Martin Langhoff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070923104525.GC7118@artemis.corp \
    --to=madcoder@debian.org \
    --cc=alex@flawedcode.org \
    --cc=dak@gnu.org \
    --cc=dmitry.kakurin@gmail.com \
    --cc=frank@lichtenheld.de \
    --cc=git@vger.kernel.org \
    --cc=krose@krose.org \
    --cc=mcostalba@gmail.com \
    --cc=miles@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).