[jira] [Comment Edited] (SYSTEMML-1406) Fix whitespace issues in main algorithms

2017-03-17 Thread Mike Dusenberry (JIRA)

[ 
https://issues.apache.org/jira/browse/SYSTEMML-1406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15930486#comment-15930486
 ] 

Mike Dusenberry edited comment on SYSTEMML-1406 at 3/17/17 6:53 PM:


Also, +1 for removing all trailing whitespace and enforcing it with git errors.


was (Author: mwdus...@us.ibm.com):
Also, +1 for remove all trailing whitespace and enforcing it with git errors.

> Fix whitespace issues in main algorithms
> 
>
> Key: SYSTEMML-1406
> URL: https://issues.apache.org/jira/browse/SYSTEMML-1406
> Project: SystemML
>  Issue Type: Improvement
>  Components: Algorithms
>Reporter: Deron Eriksson
>Assignee: Deron Eriksson
>
> 1) The main algorithms in scripts/algorithms use both spaces and tabs, which 
> can lead to readability issues when looking at the scripts in an environment 
> such as GitHub. See 
> https://github.com/apache/incubator-systemml/tree/master/scripts/algorithms. 
> We should convert tabs to spaces and format accordingly to improve script 
> readability.
> 2) Remove trailing whitespace since git does not like it.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Comment Edited] (SYSTEMML-1406) Fix whitespace issues in main algorithms

2017-03-17 Thread Mike Dusenberry (JIRA)

[ 
https://issues.apache.org/jira/browse/SYSTEMML-1406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15930471#comment-15930471
 ] 

Mike Dusenberry edited comment on SYSTEMML-1406 at 3/17/17 6:49 PM:


Strong -1 on tabs.

People attempt to use tabs to line up code & docs, and in the process, just 
cause more problems.  This leads to messy code such as  [this entire section| 
https://github.com/apache/incubator-systemml/blob/master/scripts/algorithms/bivar-stats.dml#L84],
 [this| 
https://github.com/apache/incubator-systemml/blob/master/scripts/algorithms/bivar-stats.dml#L190],
 [this| 
https://github.com/apache/incubator-systemml/blob/master/scripts/algorithms/Cox-predict.dml#L43],
 [this| 
https://github.com/apache/incubator-systemml/blob/master/scripts/algorithms/GLM.dml#L608],
 [this| 
https://github.com/apache/incubator-systemml/blob/master/scripts/algorithms/stratstats.dml#L263],
 [this (Java)| 
https://github.com/apache/incubator-systemml/blob/master/src/main/java/org/apache/sysml/hops/AggBinaryOp.java#L646],
 [this (Java)| 
https://github.com/apache/incubator-systemml/blob/master/src/main/java/org/apache/sysml/api/DMLScript.java#L850],
 etc.

Spaces never have this problem due to the size of a space being deterministic 
in comparison to any other character in a monospaced font.

I'm 100% in favor of standardizing our DML to spaces, with 2-space indention, 
and 4-space continuation lines, all of which is pretty common.  The SystemML-NN 
library already uses this format consistently.


was (Author: mwdus...@us.ibm.com):
Strong -1 on tabs.

People attempt to use tabs to line up code & docs, and in the process, just 
cause more problems.  This leads to messy code such as  [this entire section| 
https://github.com/apache/incubator-systemml/blob/master/scripts/algorithms/bivar-stats.dml#L84],
 [this| 
https://github.com/apache/incubator-systemml/blob/master/scripts/algorithms/bivar-stats.dml#L190],
 [this| 
https://github.com/apache/incubator-systemml/blob/master/scripts/algorithms/Cox-predict.dml#L43],
 [this| 
https://github.com/apache/incubator-systemml/blob/master/scripts/algorithms/GLM.dml#L608],
 [this| 
https://github.com/apache/incubator-systemml/blob/master/scripts/algorithms/stratstats.dml#L263],
 [this (Java)| 
https://github.com/apache/incubator-systemml/blob/master/src/main/java/org/apache/sysml/hops/AggBinaryOp.java#L646],
 [this (Java)| 
https://github.com/apache/incubator-systemml/blob/master/src/main/java/org/apache/sysml/api/DMLScript.java#L850],
 etc.

Spaces never have this problem due to the size of a space in being 
deterministic in comparison to any other character in a monospaced font.

I'm 100% in favor of standardizing our DML to spaces, with 2-space indention, 
and 4-space continuation lines, all of which is pretty common.  The SystemML-NN 
library already uses this format consistently.

> Fix whitespace issues in main algorithms
> 
>
> Key: SYSTEMML-1406
> URL: https://issues.apache.org/jira/browse/SYSTEMML-1406
> Project: SystemML
>  Issue Type: Improvement
>  Components: Algorithms
>Reporter: Deron Eriksson
>Assignee: Deron Eriksson
>
> 1) The main algorithms in scripts/algorithms use both spaces and tabs, which 
> can lead to readability issues when looking at the scripts in an environment 
> such as GitHub. See 
> https://github.com/apache/incubator-systemml/tree/master/scripts/algorithms. 
> We should convert tabs to spaces and format accordingly to improve script 
> readability.
> 2) Remove trailing whitespace since git does not like it.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Comment Edited] (SYSTEMML-1406) Fix whitespace issues in main algorithms

2017-03-17 Thread Deron Eriksson (JIRA)

[ 
https://issues.apache.org/jira/browse/SYSTEMML-1406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15930413#comment-15930413
 ] 

Deron Eriksson edited comment on SYSTEMML-1406 at 3/17/17 6:28 PM:
---

Hi [~mboehm7]. If we standardize, I think it may actually be better to use 
spaces rather than tabs. The reasoning for this is because spaces always render 
the same in all environments whereas tabs can be unpredictable.

As an example, here are two DML comment blocks, one formatted with spaces and 
the other formatted with tabs. The formatting looks identical for me in Eclipse:

Spaces:
{code}
#
# INPUT PARAMETERS:
# 
-
# NAME  TYPEDEFAULT MEANING
# 
-
# X String  --- Location to read feature matrix X
# Y String  --- Location to read label matrix Y
{code}

Tabs:
{code}
#
# INPUT PARAMETERS:
# 
-
# NAME  TYPEDEFAULT MEANING
# 
-
# X String  --- Location to 
read feature matrix X
# Y String  --- Location to 
read label matrix Y
{code}

However, if I look at how these compare on GitHub, notice that in the Tabs 
example, the TYPE column and the String values in that column don't line up.
https://gist.github.com/deroneriksson/8cbfe35f6fef01f0c9f31e18654880bd

Even though I've formatted all my Java code for the last 18 years with tabs, 
since our SystemML code can be viewed on GitHub, I think standardizing to 
spaces for all files might actually be better.

We could discuss this on the dev list too, which might be a good idea so we can 
hear opinions from others.

cc [~mwdus...@us.ibm.com]



was (Author: deron):
Hi [~mboehm7]. If we standardize, I think it may actually be better to use 
spaces rather than tabs. The reasoning for this is because spaces always render 
the same in all environments whereas tabs can be unpredictable.

As an example, here are two DML comment blocks, one formatted with spaces and 
the other formatted with tabs. The formatting looks identical for me in Eclipse:

Spaces:
{code}
#
# INPUT PARAMETERS:
# 
-
# NAME  TYPEDEFAULT MEANING
# 
-
# X String  --- Location to read feature matrix X
# Y String  --- Location to read label matrix Y
{code}

Tabs:
{code}
#
# INPUT PARAMETERS:
# 
-
# NAME  TYPEDEFAULT MEANING
# 
-
# X String  --- Location to 
read feature matrix X
# Y String  --- Location to 
read label matrix Y
{code}

However, if I look at how these compare on GitHub, notice that in the Tabs 
example, the TYPE column and the String values in that column don't line up.
https://gist.github.com/deroneriksson/8cbfe35f6fef01f0c9f31e18654880bd

Even though I've formatted all my Java code for the last 18 years with tabs, 
since our SystemML code can be viewed on GitHub, I think standardizing to 
spaces for all files might actually be better.

We could discuss this on the dev list too, which might be a good idea so we can 
hear opinions from others.

[~mwdus...@us.ibm.com]


> Fix whitespace issues in main algorithms
> 
>
> Key: SYSTEMML-1406
> URL: https://issues.apache.org/jira/browse/SYSTEMML-1406
> Project: SystemML
>  Issue Type: Improvement
>  Components: Algorithms
>Reporter: Deron Eriksson
>Assignee: Deron Eriksson
>
> 1) The main algorithms in scripts/algorithms use both spaces and tabs, which 
> can lead to readability issues when looking at the scripts in an environment 
> such as GitHub. See 
> https://github.com/apache/incubator-systemml/tree/master/scripts/algorithms. 
> We should convert tabs to spaces and format accordingly to improve script 
> readability.
> 2) Remove trailing whitespace since git does not like it.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)