git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Ian Molton <ian.molton@collabora.co.uk>
To: git@vger.kernel.org
Subject: Re: [RFC] Convert builin-mailinfo.c to use The Better String Library.
Date: Thu, 10 Jun 2010 19:12:36 +0000 (UTC)	[thread overview]
Message-ID: <loom.20100610T204637-685@post.gmane.org> (raw)
In-Reply-To: 4AFD7EAD1AAC4E54A416BA3F6E6A9E52@ntdev.corp.microsoft.com

Dmitry Kakurin <dmitry.kakurin <at> gmail.com> writes:

> 
> [ snip ]
> 
> When I first looked at Git source code two things struck me as odd:
> 1. Pure C as opposed to C++. No idea why. Please don't talk about 
> portability, it's BS.

Word to the wise... you effectively just told one of *the* best known
programmers of all time that they are talking BS... nice one. Hope you've got
some flameproof undies. Whats that? no? ah well...

I smell a troll, but since everyone else has had a go...

Heres some comments picked out from the thread, in no particular order...

> > You have a very strange way of not meaning to start a C vs. C++ war.

> I honestly didn't. I didn't even think it's possible. In the
> environment of mainstream commercial software development the last war
> on this subj was over 8-10 years ago.

Really? I dont know what planet you're from, but this 'war' has been raging for
decades, and will probably continue until one side or the other gets round to
using tactical nukes.

And besides, this *isn't* the commercial (closed) software world - we've moved
on. We no longer depend on closed companies handing out features like orphans in
the Victorian times...

>>> [bitfields in D]

>>   Really, I feel this is a big lack, for a language that aims at
>> simplicity, conciseness _and_ correctness.
>>
>>   OK, maybe I'm biased, I work with networks protocols all day long, so
>> I often need bitfields, but still, a lot of people deal with network
>> protocols, it's not a niche.
>
> And strictly speaking, C bitfields are completely useless for that
> purpose since the compiler is free to use whatever method he wants for
> allocating bit fields.  So if you want to write a portable program,
> you are back to making the masks yourself.

Sadly. Thats always been one of the things I found annoying in C. There are
times when you want access to the types the hardware itself uses, and there are
times when you want to know your int is 32 bits long, and there isnt really a
standardised way of doing that. Of course, its worked around in practice, but it
all seems so unnecessary.

> in the *real world* rewriting Git in assembly would be like  
> painting a house using a single horse hair instead of a paint brush  
> or roller. Your SHA-1 example is a perfect example of where you  
> benefit from doing a tiny embellished detail using the single hair  
> (assembly) and leave all the rest in C.

The above comment is pure epic win :-)

On another note, some people talked about code reuse...

IMHO Sourcecode reuse is something of a myth in any language. Sure, some small
algorithms get reused, but thats really not a language dependent characteristic.
As soon as you build something much bigger than an algorithm, it starts to need
an interface, and at that point you may as well turn it into a library. Thats
where the REAL code reuse happens. And as it happens at runtime, its good for
users - bugfixes help everyone.

On to language choice...

I have NEVER understood why people seem to think theres some kind of hierarchy
in either ease of coding or speed. You see it all the time, people think that:

assembler is faster than c is faster than c++ is faster than perl etc.

WHY? I've seen some truely braindamaged assembler that could be outperformed by
BASIC on a BBC micro. I've seen 'handcrafted' C and C++ that looked like it was
written during a skydive whilst on crack.

languages are *tools*. Pick the most appropriate. Use two. Embrace the power of
and...

Linux make good use of C and assembler, both compiled/assembled seperately and
inline. Some stuff like accessing weird registers with oddball opcodes is
actually impossible under C. But (say) write a filesystem in assembler? no
thanks! (not that it hasn't been done, but for the love of god, why?)

So, anyway, why do these kind of threads never go away? because opinions are
like arseholes. Everyones got one. As you grow older, you learn stuff. You
hopefully dont repeat the mistakes of ones youth. (theres at least one
ill-conceived C string library out there which I'm embarrased to admit is my
fault (hopefully it'll never leave the company I was at when I wrote it...).
These threads are where the n00bs meet the pros. Usually, the n00bs just need to
suck it up and admit it when they've been dumb. Its a very rare day when
something truely radical comes along, and its even rarer when its born of total
inexperience.

Nothing to see here...

All the best,

-Ian

PS. ironically, in order to post this, gmane required me to enter a word. That
word was "restraint". Gotta love karma.

  parent reply	other threads:[~2010-06-11 11:55 UTC|newest]

Thread overview: 102+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-04 20:50 [RFC] Convert builin-mailinfo.c to use The Better String Library Lukas Sandström
2007-09-04 21:38 ` Alex Riesen
2007-09-04 23:01   ` Pierre Habouzit
2007-09-05 14:54 ` Kristian Høgsberg
2007-09-05 17:29   ` Matthieu Moy
2007-09-06  2:30     ` Miles Bader
2007-09-06  4:48     ` Dmitry Kakurin
2007-09-06  4:59       ` Shawn O. Pearce
2007-09-06  9:12         ` Andreas Ericsson
2007-09-06  9:35           ` Junio C Hamano
2007-09-06 10:21             ` Andreas Ericsson
2007-09-06  9:52           ` David Kastrup
2007-09-06  5:03       ` Miles Bader
2007-09-06 12:08         ` Johannes Schindelin
2007-09-06 17:50       ` Linus Torvalds
2007-09-07  0:21         ` Dmitry Kakurin
2007-09-07  0:38           ` Linus Torvalds
2007-09-07  1:08             ` Dmitry Kakurin
2007-09-07  1:27               ` Linus Torvalds
2007-09-07  3:09                 ` Dmitry Kakurin
2007-09-07  5:48                   ` David Symonds
2007-09-07  6:15                   ` Theodore Tso
2007-09-20 14:06                     ` Steven Burns
2007-09-20 14:56                       ` Andreas Ericsson
2007-09-07  6:31                   ` Andreas Ericsson
2007-09-07 22:17                     ` Dmitry Kakurin
2007-09-07 22:28                       ` David Kastrup
2007-09-08  0:37                         ` Dmitry Kakurin
2007-09-08  6:25                           ` David Kastrup
2007-09-09  0:29                       ` Andreas Ericsson
2007-09-07  6:52                   ` David Kastrup
2007-09-07 10:28                   ` Johannes Schindelin
2007-09-07 10:26                 ` Johannes Schindelin
2007-09-07  6:50               ` David Kastrup
2007-09-07  1:12             ` Linus Torvalds
2007-09-07  1:40               ` alan
2007-09-07  5:09               ` Walter Bright
2007-09-07  7:40                 ` David Kastrup
2007-09-07  8:15                   ` Walter Bright
2007-09-07  8:26                     ` David Kastrup
2007-09-07  9:14                       ` Walter Bright
2007-09-07  9:31                         ` David Kastrup
2007-09-07 20:22                           ` Walter Bright
2007-09-07 20:27                             ` David Kastrup
2007-09-07 23:16                               ` Walter Bright
2007-09-08 23:50                             ` Andreas Ericsson
2007-09-09  0:37                               ` Pierre Habouzit
2007-09-09  1:36                                 ` Andreas Ericsson
2007-09-07 11:36                   ` Wincent Colaiuta
2007-09-07  9:41                 ` Pierre Habouzit
2007-09-07 19:03                   ` Walter Bright
2007-09-07 19:31                     ` David Kastrup
2007-09-07 20:49                       ` Walter Bright
2007-09-07 19:41                     ` Pierre Habouzit
2007-09-07 19:51                       ` David Kastrup
2007-09-07 19:59                         ` Pierre Habouzit
2007-09-07 20:40                       ` Walter Bright
2007-09-07 20:56                         ` Pierre Habouzit
2007-09-07 22:54                           ` Walter Bright
2007-09-08  0:56               ` John 'Z-Bo' Zabroski
2007-09-08  6:36                 ` David Kastrup
2007-09-19 19:56               ` Steven Burns
2007-09-07  3:06           ` Wincent Colaiuta
2007-09-07  4:06             ` Paul Wankadia
2007-09-07  4:30               ` Nicolas Pitre
2007-09-07  9:19               ` Wincent Colaiuta
2007-09-07  6:25             ` Andreas Ericsson
2007-09-07 10:56               ` Johannes Schindelin
2007-09-07 11:54                 ` Andreas Ericsson
2007-09-07 12:33                   ` Wincent Colaiuta
2007-09-07 12:55                     ` Karl Hasselström
2007-09-07 13:58                     ` Andreas Ericsson
2007-09-07 14:13                       ` Wincent Colaiuta
2007-09-09  0:09                         ` Andreas Ericsson
2007-09-07 16:09                 ` David Kastrup
2007-09-07 11:30               ` Wincent Colaiuta
2007-09-07  8:36             ` Walter Bright
2007-09-07  9:41               ` Andreas Ericsson
2007-09-07 19:23                 ` Walter Bright
2007-09-07 19:40                   ` David Kastrup
2007-09-09  0:25                   ` Andreas Ericsson
2009-09-17 16:23                   ` Bernd Jendrissek
2007-09-07 11:52               ` Wincent Colaiuta
2007-09-07 19:25                 ` Walter Bright
2007-09-22 16:52               ` Steven Burns
2007-09-07  6:47           ` David Kastrup
2007-09-07  7:41             ` Andy Parkins
2007-09-07  8:08               ` David Kastrup
2007-09-07 10:21           ` Johannes Schindelin
2007-09-08  0:32             ` Dmitry Kakurin
2007-09-08  6:24               ` David Kastrup
2007-09-08 23:25               ` Alex Riesen
2007-09-24 13:41         ` figo
2007-09-24 13:57           ` David Kastrup
2007-09-25 19:19             ` Steven Burns
2007-09-25 19:55               ` David Kastrup
2012-05-22 18:30         ` Syed M Raihan
2010-06-10 19:12       ` Ian Molton [this message]
2010-06-11 12:23         ` Jakub Narebski
2010-06-11 13:33           ` Dario Rodriguez
2007-09-05 15:27 ` Kristian Høgsberg
2007-09-07 10:47 ` Lukas Sandström

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=loom.20100610T204637-685@post.gmane.org \
    --to=ian.molton@collabora.co.uk \
    --cc=git@vger.kernel.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).