summaryrefslogtreecommitdiff
path: root/9b/1728fd401edae3e678b6f7a7544abcff8c1e1c
blob: 4a8613a179a01b7e89c8fab4138136e899f60239 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191]
	helo=mx.sourceforge.net)
	by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76)
	(envelope-from <jgarzik@exmulti.com>) id 1QgVNf-0001uR-1n
	for bitcoin-development@lists.sourceforge.net;
	Tue, 12 Jul 2011 05:19:35 +0000
X-ACL-Warn: 
Received: from mail-iy0-f175.google.com ([209.85.210.175])
	by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128)
	(Exim 4.76) id 1QgVNd-0005or-TI
	for bitcoin-development@lists.sourceforge.net;
	Tue, 12 Jul 2011 05:19:35 +0000
Received: by iym10 with SMTP id 10so5887047iym.34
	for <bitcoin-development@lists.sourceforge.net>;
	Mon, 11 Jul 2011 22:19:28 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.231.20.133 with SMTP id f5mr4921320ibb.197.1310447968454; Mon,
	11 Jul 2011 22:19:28 -0700 (PDT)
Received: by 10.231.35.67 with HTTP; Mon, 11 Jul 2011 22:19:28 -0700 (PDT)
X-Originating-IP: [99.173.148.118]
In-Reply-To: <4E1BC9D0.3080104@speakeasy.net>
References: <97305540.4426247.1310337435268.JavaMail.fmail@mwmweb052>
	<201107102201.53937.luke@dashjr.org>
	<4E1BC9D0.3080104@speakeasy.net>
Date: Tue, 12 Jul 2011 01:19:28 -0400
Message-ID: <CA+8xBpcu8dT54sPKCJyjdEcYD=TWsrNx80fjj4S9qtq_XzcFOQ@mail.gmail.com>
From: Jeff Garzik <jgarzik@exmulti.com>
To: Alan Grimes <agrimes@speakeasy.net>
Content-Type: text/plain; charset=ISO-8859-1
X-Spam-Score: 0.1 (/)
X-Spam-Report: Spam Filtering performed by mx.sourceforge.net.
	See http://spamassassin.org/tag/ for more details.
	0.1 AWL AWL: From: address is in the auto white-list
X-Headers-End: 1QgVNd-0005or-TI
Cc: bitcoin-development@lists.sourceforge.net
Subject: Re: [Bitcoin-development] overall bitcoin client code quality
X-BeenThere: bitcoin-development@lists.sourceforge.net
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <bitcoin-development.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=bitcoin-development>
List-Post: <mailto:bitcoin-development@lists.sourceforge.net>
List-Help: <mailto:bitcoin-development-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=subscribe>
X-List-Received-Date: Tue, 12 Jul 2011 05:19:35 -0000

On Tue, Jul 12, 2011 at 12:13 AM, Alan Grimes <agrimes@speakeasy.net> wrote:
> While spying on the old code, I noticed one major problem that could be
> fixed quite easily. That is, the 1 class-per .h/.cpp rule is completely
> ignored in main.h/cpp and net.h/cpp If all of the classes in the project
> were re-factored to their own files,

This is about the last thing we should do, and it's one of the worst
coding practices of many C++ projects (and unfortunately carried over
to Java by force).  See Knuth and his work on literate programming.
Putting logically similar code -together- is often more impactful and
meaningful than splitting up files into dozens (hundreds or thousands,
in large projects) of tiny, 20-line files.

A project attains zen in the -balance-.  Bitcoin was not well served
by "everything in main.cpp" approach -- but neither is it well served
by splitting wallet / transaction / etc. logic across a great many
files.  We should not have to ask ourselves, Is This Code In
WalletFactory.cpp, WalletTx.cpp, WalletStore.cpp, WalletKey.cpp,
WalletCrypt.cpp, or in s/$F.cpp/$F.h/ ?

Strict, unthinking rules do not buy anything, and can cost us much.

Plus, no matter how you slice it, bitcoin is Hard To Learn and there's
no getting around that.

-- 
Jeff Garzik
exMULTI, Inc.
jgarzik@exmulti.com