Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it considered a good style to use whitespace to align the code? [closed]

For example, what piece of code is considered better styled? If I show my code to a professional developer and ask if my code is good or not, will using the second style be probably considered as a (minor, but...) minus or a plus to my code quality?

I myself tend to like the second style but would prefer to comply to the most common opinion in this case.

1

val foo : Int = -1
val bar : Int = 1
val yohoho : Double = NaN

2

val foo    : Int    = -1
val bar    : Int    =  1
val yohoho : Double =  NaN
like image 637
Ivan Avatar asked Oct 22 '10 22:10

Ivan


1 Answers

Whatever suits you, you're the coder. The first one just looks funny to me really.

like image 196
Byron Whitlock Avatar answered Oct 15 '22 14:10

Byron Whitlock