From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 139A37FDBE for ; Tue, 5 Jan 2016 22:25:47 +0100 (CET) IronPort-PHdr: 9a23:Gt1NkRPnKTwEPwaufxsl6mtUPXoX/o7sNwtQ0KIMzox0KPj6rarrMEGX3/hxlliBBdydsKIazbSH+Pm8BiQp2tWojjMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpQAbFhi3DwdpPOO9QteU1JTpkb7jsMSPPE1hv3mUX/BbFF2OtwLft80b08NJC50a7V/3mEZOYPlc3mhyJFiezF7W78a0+4N/oWwL46pyv50IbaKvdK09SflcDS86G2Ez/szi8xfZHiWV4X5JcmgQngBJAEDv6xb/FsPxvy32rOt+8DWdJcr3C6gzXi3k5KBuHky7wBwbPiI0pTmEwvd7i7hW9Uqs Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=hendrik@topoi.pooq.com; spf=None smtp.mailfrom=hendrik@topoi.pooq.com; spf=None smtp.helo=postmaster@april.topoi.pooq.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of hendrik@topoi.pooq.com) identity=pra; client-ip=69.165.131.134; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="hendrik@topoi.pooq.com"; x-sender="hendrik@topoi.pooq.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of hendrik@topoi.pooq.com) identity=mailfrom; client-ip=69.165.131.134; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="hendrik@topoi.pooq.com"; x-sender="hendrik@topoi.pooq.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@april.topoi.pooq.com) identity=helo; client-ip=69.165.131.134; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="hendrik@topoi.pooq.com"; x-sender="postmaster@april.topoi.pooq.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CtCAC7M4xW/4aDpUVehFSDB4V3tVuGDwKBWxABAQEBAQEBAYEJgi2CCAEBBDIBVgsYCSUPBRiIc8JYAQEIAiGLVYUjgn6BGwWOMIhYjUoJXn6NIYpOg3M5K4QoIIYVAQEB X-IPAS-Result: A0CtCAC7M4xW/4aDpUVehFSDB4V3tVuGDwKBWxABAQEBAQEBAYEJgi2CCAEBBDIBVgsYCSUPBRiIc8JYAQEIAiGLVYUjgn6BGwWOMIhYjUoJXn6NIYpOg3M5K4QoIIYVAQEB X-IronPort-AV: E=Sophos;i="5.20,526,1444687200"; d="scan'208";a="159497465" Received: from topoi.pooq.com (HELO april.topoi.pooq.com) ([69.165.131.134]) by mail3-smtp-sop.national.inria.fr with ESMTP; 05 Jan 2016 22:25:42 +0100 Received: by april.topoi.pooq.com (Postfix, from userid 1001) id 2B57D1A029E; Tue, 5 Jan 2016 16:25:33 -0500 (EST) Date: Tue, 5 Jan 2016 16:25:33 -0500 From: Hendrik Boom To: caml-list@inria.fr Message-ID: <20160105212532.GE31106@topoi.pooq.com> References: <20160105091224.GA10087@pl-59055.rocqadm.inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160105091224.GA10087@pl-59055.rocqadm.inria.fr> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [Caml-list] Coding style: mixing tabs and spaces in indentation On Tue, Jan 05, 2016 at 10:12:24AM +0100, Sébastien Hinderer wrote: > Dear all, > > I am wondering whether there are some guidelines that have been proposed > regarding the way OCaml code should be presented? > > More specifically: am I correct that it is considered not such a good > practise to mix tabs and spaces in code indentation? And if so, are > there objective reasons for that? > > It seems Emacs is configured to do that (mixing tabs and spaces) by > default, can anybody confirm? It used to be (I'm talking 1960's and 70's here) that the standard was for a tab to be equivalent to eight spaces. No problem mixing tabs and spaces then. But when people started programming a lot in C instead of assembler, the problem arose. The recommended style was to use tabs for indentation. The result was functions with very short lines of actual code when control structure was significantly nested. Of course the style gurus would say that you had to break functions up at that point and that this wasa a useful indication that your indentation was too deep. But many thought differently about style and started to indent less aggressively, perhaps two, four or even three spaces for each indent. And to make that easy, they would set tab stops accordingly. The result was that if tabs and only tabs were used for indentation, it would format nicely whatever your tab stop settings, and if spaces and only sppaces were used, it would also format nicely. But if they were mixed, you would get a total mess if the tab width in the display were diffferent for that used when coding. -- hendrik