Chris,

----- Alkuperäinen viesti ----- 
Lähettäjä: "Chris Nolan" <[EMAIL PROTECTED]>
Vastaanottaja: "Heikki Tuuri" <[EMAIL PROTECTED]>
Kopio: <[EMAIL PROTECTED]>
Lähetetty: Monday, February 16, 2004 1:56 PM
Aihe: Re: InnoDB Hot Backup + MySQL embedded?


> Heikki,
>
> Thank you greatly for answering my questions. Your obvious dedication to
> the open source world and high-quality of software cannot be
> understated.

thank you :).

> Upon reading some of the InnoDB source code, I've noticed that C seems
> to be your language of choice. That said, it seems more and more of the
> literature that is promoted around my university emphasises testing
> methods related to OO languages like Java and C++ or looking at
> different programming paradigms such as logical programming (my
> university formally trains all students in Prolog and optionally
> Mercury) and functional programming (Our very first CS subject involves
> Haskell programming! It used to involve Miranda). Is there anything in
> the way of strategies that you would recommend to developers (I'm
> working on a MySQL/InnoDB based server app at the moment. Anyone else
> who reads this message please hit me with your 2c) regarding  C
> programming and testing (they drill C into us with great rigor at the
> university I attend, but after second year it boils down to assignment
> submissions and that's about it)?

C versus object-oriented lanuguages like C++/Java is a topic I have
discussed a lot with programmers. I believe that traditional procedural
approaches and languages, like C, are the best for 'systems programming', by
which I mean implementing anything with complex data structures and lots of
parallelism. A DBMS is a typical example of such a complex program. My
opinion is based on:

1) The object-oriented paradigm recommends that algorithms are structured
around 'objects', that is, around data structures. But I think it is easier
for humans to understand complex algorithms, like the splitting of a node in
a B-tree, if the algorithms are presented on their own terms, and not
fragmented around the 'objects' involved. Donald Knuth of the Stanford
University remarked that proving the correctness of an 'object-oriented'
algorithm is hard, because keeping track of autonomous 'objects' is
difficult.

2) C++ encourages programmers to use 'implicit' operations. In C++ functions
can have the same name, even though they take a different number of
parameters, and the data type of the parameters can differ. There can be
implicit constructor and destructor operations for objects. I believe that
the use implicit operations is prone to bugs, and makes a program harder to
read.

3) A weakness of C compared to Java is memory management. In C you can
easily write programs that leak memory or run over allocated buffers. In
practice, it has turned out to be relatively easy to keep these memory
management bugs at a tolerable level in our C programs, so that a move to a
language with automatic memory management is not needed.

In all programming languages I think the following are important programming
conventions:

1) Remove redundancy from your code. Analogous to 'normalizing' your
relational database.
2) Use a lot of comments.
3) Use a lot of assertions, which capture bugs early on.

> The reason that I ask is that you have managed to create the world's
> fastest transactional database handler that runs on such a large number
> of different architectures and operating systems. Also, the fact that
> you've taken everything that Oracle tout as making them brilliant and
> doing it many times better than they have displays your commitment and
> incredible set of skills.

I must say that I have never before heard such praise in software world :).
Often it is just the opposite. The Usenet is full of threads saturated with
bashing and name-calling.

> I hope that one day that the software I am currently building will also
> contribute to both the commercial software world and the open source
> community. The fact that you've achieved this with such success and that
> you post to the MySQL mailing list so often is why I ask you these
> questions.
>
> Regards,
>
> Chris

Best regards

Heikki


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to