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 79A117FBA7 for ; Tue, 5 Jan 2016 10:55:29 +0100 (CET) IronPort-PHdr: 9a23:30+h5B9iRE2/lf9uRHKM819IXTAuvvDOBiVQ1KB92+4cTK2v8tzYMVDF4r011RmSDduds6oMotGVmp6jcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47AblHf6ke/8SQVUk2mc1EleKKtQsb7tIee6aObw9XreQJGhT6wM/tZDS6dikHvjPQQmpZoMa0ryxHE8TNicuVSwn50dxrIx06vru/5xpNo8jxRtvQ97IYAFPyiJ+VrBYBfWQ+nOWku+Mzmsy7jTA2D62ERSC1CqRdCChPZ7Rz8GLfwtCf3rOdn8CicJ8z/C74uD2eM9aBuHSXhkCcOtDoOyHvQl9dsxPZBqQqhoxV7xJP8b4ScNf44daTYK4BJDVFdV9pcAnQSSri3aJECWq9YZb5V Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=raphlalou@gmail.com; spf=Pass smtp.mailfrom=raphlalou@gmail.com; spf=None smtp.helo=postmaster@mail-vk0-f68.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of raphlalou@gmail.com) identity=pra; client-ip=209.85.213.68; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="raphlalou@gmail.com"; x-sender="raphlalou@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of raphlalou@gmail.com designates 209.85.213.68 as permitted sender) identity=mailfrom; client-ip=209.85.213.68; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="raphlalou@gmail.com"; x-sender="raphlalou@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-vk0-f68.google.com) identity=helo; client-ip=209.85.213.68; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="raphlalou@gmail.com"; x-sender="postmaster@mail-vk0-f68.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AVAwCJkotWlETVVdFeg1g0bQaIU6IXhweMOCKFbQKBFAc8EAEBAQEBAQEBEAEBAQEHCwsJHzCCLYIIAQEEEhEdARsdAQMMBgULDQICJgICIgERAQUBHAYTCRmHdwEDEg6iOYExPjGLSIFqgnmIVgoZJw1Wgh4BAQEBBgEBAQEBARcBBQ5zilSHc4FJBZcIhUGIEIFcSoxWik2CJxEkgRc5gi8igWQ+NIUQAQEB X-IPAS-Result: A0AVAwCJkotWlETVVdFeg1g0bQaIU6IXhweMOCKFbQKBFAc8EAEBAQEBAQEBEAEBAQEHCwsJHzCCLYIIAQEEEhEdARsdAQMMBgULDQICJgICIgERAQUBHAYTCRmHdwEDEg6iOYExPjGLSIFqgnmIVgoZJw1Wgh4BAQEBBgEBAQEBARcBBQ5zilSHc4FJBZcIhUGIEIFcSoxWik2CJxEkgRc5gi8igWQ+NIUQAQEB X-IronPort-AV: E=Sophos;i="5.20,524,1444687200"; d="scan'208";a="159425637" Received: from mail-vk0-f68.google.com ([209.85.213.68]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 05 Jan 2016 10:55:28 +0100 Received: by mail-vk0-f68.google.com with SMTP id a188so22567608vkc.1 for ; Tue, 05 Jan 2016 01:55:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=x0M8H3yQx8jSbhv0Y5Nf/3lWqcV6CNSOanlVSLLXIT8=; b=o7ddNeqFeakn3fTwzSUROQuJpK+WXatyttjxJa00BnSGRjSiWTFD9CaiDsLN1mY2XL b0Zz1jApoPZxBemAW+dX5QvIQXSraEZQr/IDUlys1FT2V4fy2+Uut5BXnX3f+aBc3fB5 ajoCXaZYgNgAoSSBdHLwXIRJxsbWuNz4TDtcP7EMnOyBQ7zq+bVsU1/1MoCFlU64QBYJ w+XhjkLtWLyrfFIwRHNElM3R/oHj2jIn1sdp5L6GaAZm51J2vZkrXH/B3rUXb6uX3yhm h3wFdzCX2OhCC6A3h10PrUAecSlhEdqm3D5LF9bnqq4C/LBwVu7Je9pSf7nWaQKTPT9P mwhg== MIME-Version: 1.0 X-Received: by 10.31.52.147 with SMTP id b141mr57380224vka.82.1451987727020; Tue, 05 Jan 2016 01:55:27 -0800 (PST) Received: by 10.31.182.75 with HTTP; Tue, 5 Jan 2016 01:55:26 -0800 (PST) In-Reply-To: <20160105091224.GA10087@pl-59055.rocqadm.inria.fr> References: <20160105091224.GA10087@pl-59055.rocqadm.inria.fr> Date: Tue, 5 Jan 2016 09:55:26 +0000 Message-ID: From: =?UTF-8?Q?Rapha=C3=ABl_Proust?= To: =?UTF-8?Q?S=C3=A9bastien_Hinderer?= Cc: caml-list@yquem.inria.fr Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] Coding style: mixing tabs and spaces in indentation On 5 January 2016 at 09:12, S=C3=A9bastien Hinderer wrote: > 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? A sane guidelines for mixing both is to use tabs for indentation only (i.e., indicating how deep in the syntax tree you are) and spaces for alignment only (i.e., to make the code pretty if you have to break line in the middle of something). You can find a discussion about it on http://blog.codinghorror.com/death-to-the-space-infidels/ and some editor specific hints for emacs http://www.emacswiki.org/emacs/SmartTabs and vim http://vim.wikia.com/wiki/Indent_with_tabs,_align_with_spaces (and more general, search the web for "tab space indent align".) Basically it gives code like let numpad =3D [1;2;3; 4;5;6; 7;8;9; 0; ] where the tab indicates you are inside the let binding and the spaces align the numbers in the list so that they look pretty. The code looks nice for any tabstop value (i.e., any number of space you use to represent them). If you ever have to interact with code in a non-monospace environment, alignment is useless and actually annoying. I used to align my code a lot, to the point of writing things like type t =3D { x: int ; y: int ; width: int ; height: int ; color: color; } but I don't anymore. I just indent and focus on readability more than prettiness. One thing to keep in mind is that merlin uses indentation as a hint for recovering from parsing errors. The more "correct" your indentation is, the easiest it will be for merlin to recover. Cheers, --=20 ______________ Rapha=C3=ABl Proust