Your code doesn't even compile.

On Thursday, October 31, 2019 at 1:13:50 PM UTC-4, kevma...@gmail.com wrote:
>
> I apologize for submitting yet another go format "issue". I'm more so 
> gauging the community on this idea. Furthermore, I ask that you understand 
> I'm not sure if this type of code format has a proper name to it, I'm just 
> calling it "newline-operator-chain" (in contrast to 
> "operator-newline-chain").
>
> ...For the record the first time I saw this type of formatting was when I 
> was using SQL Server Management Studio 2012. It had formatted its `select` 
> statements in a similar way. Though I normally hate Microsoft's ways of 
> doing things newline-operator chains look much cleaner. Enough talking, 
> it's best I just show what I mean:
>
>
> operator-newline chain
> if Variable1 == true && 
>     Variable2 == 5 &&
>     MakeSureICan() {
> // ...
> }
>
>
>
>
> LotsOfArgs(myArg,
>     anotherArg,
>     bonusArg,
>     thisArgToo())
>
>
> newline-operator chain
> Much cleaner in my opinion.
> if Variable1 == true 
>     && Variable2 == 5
>     && MakeSureICan() {
> // ...
> }
>
>
>
>
> LotsOfArgs(myArg
>     , anotherArg
>     , bonusArg
>     , thisArgToo())
>
>
> Why Go format needs this
>
> *Looks cleaner, looks simpler*
> I believe that the newline-operator chain formatting looks niced due to 
> the lining-up of the operators. This is nice to Go programmers like myself 
> who are obsessed with readability. For instance, one could much understand 
> the purpose of each argument in a faster manner when scanning through 
> newline-operator chains as the operation is specified before the argument. 
> Compared to operator-newline chains where the reader must look at 2 
> separate lines to fully understand the role an argument plays in the chain.
>
> *Makes more mathematical sense*
> And I think is more suitable for the underlining "mathematical" nature of 
> operators in the first place. A good chunk of *any* programming is math, 
> thus any language should share as many aspects with math as possible. 
> Forcing operator-newline chain formatting disobeys this property.
>
> We'd see this in math:
>    2
>  + 4
>  + 9
>  - 1
> ----
>   14
>
>
> not:
>    2 +
>    4 +
>    9 -
>    1
> ----
>   14
>
>
> The latter (operator-newline) looks confusing and harder to follow, the 
> readability is lacking. Which is why I think we need to allow the former 
> (newline-operator) in Gofmt. 
>
>
> In my opinion, I think Gofmt needs to *disallow* operator-newline to 
> achieve the highest grade of readability.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/fc340ab3-a493-4017-95e1-7bb89e2518a7%40googlegroups.com.

Reply via email to