Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 446CC200CA3 for ; Wed, 3 May 2017 02:25:29 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 43120160BAC; Wed, 3 May 2017 00:25:29 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8917D160B9D for ; Wed, 3 May 2017 02:25:28 +0200 (CEST) Received: (qmail 19021 invoked by uid 500); 3 May 2017 00:25:27 -0000 Mailing-List: contact dev-help@systemml.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@systemml.incubator.apache.org Delivered-To: mailing list dev@systemml.incubator.apache.org Received: (qmail 19009 invoked by uid 99); 3 May 2017 00:25:27 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 May 2017 00:25:27 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 08FBEC04EF for ; Wed, 3 May 2017 00:25:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.07 X-Spam-Level: X-Spam-Status: No, score=-0.07 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=googlemail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id iTViMhewP1kf for ; Wed, 3 May 2017 00:25:25 +0000 (UTC) Received: from mail-qt0-f182.google.com (mail-qt0-f182.google.com [209.85.216.182]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id DC59C5F4A7 for ; Wed, 3 May 2017 00:25:24 +0000 (UTC) Received: by mail-qt0-f182.google.com with SMTP id g60so126387595qtd.3 for ; Tue, 02 May 2017 17:25:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=ER3d3jSI7J+Xjcpcwdg+RUHwp9K+kmbCtUNapP5+QzQ=; b=KfOtMxZH0T/imh0uhyQHWD3vercfBe89dMvGKozSTq/7txKwn1s03wnaCw1Cuj78zo adtedmztURlGcfo3XEy8vODYea3pZQglz0gbLCeOj+dooriZnuhMrskn2FKAk/e6atFh 2LSwjcf4eto4fGtMxtMskZiG+GY9ihZ4cJO3dOloAG6Roql574MHZGBo0ilfrl+OaXd6 nHQDkpVFpkebE86oxtRe5oMTQJdbekEMj2j5Op3LFBjG3gylp5paUUF9R5PnAHZHOOJy eReDlCQ0zQd4JVLJlVRNANYp3VtARGq3KMOP2efIcg1jbZFeqHfBVt89g6fc4czVboyj Vnag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=ER3d3jSI7J+Xjcpcwdg+RUHwp9K+kmbCtUNapP5+QzQ=; b=o/8JgfaqGdwcDonW+wiwMLEv3c5Nw9i3MIMEjhBD0oOFdPQ2OL7ycriIZqBebZe2U9 JthvCZHHt7A33SXGIMDyB5dMrZxItA6N3Mxm9NGLXVr8A7fhxe0vU51fSG0tyS0ZG4L4 2yMj/h9DjYFXhLdSlwcQBbF2RYXfYVaKodQbqAO7ESasp3xHA9q2UUC0Na4OzGmzqwbJ OVhVMDcCVQEoj7n3bZC8QO4GzUsfM3ljuVfb3Bw8/X9mgdx9WCL/dUT8Rm48TefEBSko bl+GMrN4nBf+kMX/YxdrF1wD5GDtob3NXX/yg1i2M0jVu/K209x47f3gSrWu0idlVYqj MHnw== X-Gm-Message-State: AN3rC/6+CcK1VCTNFQhaxk8STVB1PvGXGy1VK7p68KF32xYz5V4/JjB6 RtyitdM0Xw3TNJA8 X-Received: by 10.237.51.99 with SMTP id u90mr21337114qtd.32.1493771124423; Tue, 02 May 2017 17:25:24 -0700 (PDT) Received: from [172.20.15.113] (75-147-11-69-NewEngland.hfc.comcastbusiness.net. [75.147.11.69]) by smtp.googlemail.com with ESMTPSA id x139sm309291qkb.21.2017.05.02.17.25.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 May 2017 17:25:24 -0700 (PDT) From: Matthias Boehm X-Google-Original-From: Matthias Boehm Subject: Re: Standard code styles for DML and Java? To: dev@systemml.incubator.apache.org References: Message-ID: <1b749616-bc07-8996-1fe2-1629f9c1b97a@gmail.com> Date: Tue, 2 May 2017 20:25:21 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit archived-at: Wed, 03 May 2017 00:25:29 -0000 thanks Deron for centralizing this discussion, as this could help to avoid redundancy spread across many individual JIRAs and PRs. Overall, I think it would be good to agree on individual style guides for DML and Java. I'm fine with using spaces for DML scripts because they are rarely changed once written. However, for Java, I'd strongly prefer tabs for indentation because tabs are (1) faster to navigate, and (2) allow to configure the dev environment according to subjective preferences. For inline formatting both should use spaces though. Finally, I would recommend to also include common inconsistency such as exception handling (catch all vs redundant error messages), hashcode/equals, unnecessary branches, etc. Regards, Matthias On 5/2/2017 7:15 PM, Deron Eriksson wrote: > Recently Matthias, Mike, and I discussed the issue of DML code style on > SYSTEMML-1406 (https://issues.apache.org/jira/browse/SYSTEMML-1406). We > also have an issue regarding Java code style on SYSTEMML-137 ( > https://issues.apache.org/jira/browse/SYSTEMML-137). > > In the discussion on SYSTEMML-1406, it sounds like Matthias, Mike, and I > all see value in having a consistent style, although individual preferences > differ. I would like to start a short discussion to see if we could apply > common style standards to our Java and DML files. > > WRT Java, perhaps the Google Style Guide ( > https://google.github.io/styleguide/javaguide.html) would be a good place > to start. > https://github.com/google/styleguide/blob/gh-pages/eclipse-java-google-style.xml > https://github.com/google/styleguide/blob/gh-pages/intellij-java-google-style.xml > > We could use these Eclipse/IntelliJ Java style templates as a base and > modify them for any changes we agree upon (for example, tabs vs spaces for > indentation). We could then check these templates into our project so that > everyone who contributes to SystemML can apply the common style to code, > thus adding consistency to the project. > > WRT DML, the main issue we discussed was tabs vs spaces for indentation. > > Some options I see are: > 1) No official DML/Java styles > 2) DML/Java styles (use spaces for indents, with style guide as basis for > Java) > 3) DML/Java styles (use tabs for indents, with style guide as basis for > Java) > > Although I would prefer 2), I would be happy with 3) as an improvement from > our existing 1). We could also have alternate options such as spaces for > DML and tabs for Java. > > Thoughts? > Deron >