systemml-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deron Eriksson <deroneriks...@gmail.com>
Subject Re: Standard code styles for DML and Java?
Date Wed, 03 May 2017 16:48:59 GMT
Hi Matthias,

I like your suggestion of space indentation for DML scripts and tab
indentation for Java. I definitely support this and think this would be a
great way to go.

I also really like the idea of standardizing other aspects of our Java.

For inline formatting in Java, we might want to use // @formatter:off/on
comments  (
http://stackoverflow.com/questions/1820908/how-to-turn-off-the-eclipse-code-formatter-for-certain-sections-of-java-code),
since occasionally inline formatting can be very useful for readability
(such as DMLScript.DMLOptions).

Deron



On Tue, May 2, 2017 at 5:25 PM, Matthias Boehm <mboehm7@googlemail.com>
wrote:

> 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
>>
>>


-- 
Deron Eriksson
Spark Technology Center
http://www.spark.tc/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message