MikeMitterer / dart-material-design-lite

Material Design Lite Components, Directives + SPA with HTML, CSS + Dart
http://www.material-design-lite.pub/
Other
228 stars 26 forks source link

Format code with dartfmt tool #5

Closed andresaraujo closed 9 years ago

andresaraujo commented 9 years ago

To be easier to add contributions, the project should make use of the dartfmt

MikeMitterer commented 9 years ago

Sorry - but no. I don't agree with quite a few of their definitions.

kasperpeulen commented 9 years ago

I kind of agree with @andresaraujo, to be honest, would make it easier and more inviting to continue. What is your problem with dart fmt? I think for an open source dart project, dart fmt makes the most sense...

MikeMitterer commented 9 years ago

Just to show two of my main concerns + this is more a "Google-Format-Thing" (their internal styleguide) They indent 2 chars and they have a line-break on col 80.

I have two screens one with 2560x and the other one with 1920x res and Google wants me to set a max width of 80chars - sorry no! This made sense 10 years ago but not today.

screenshot-1830

kasperpeulen commented 9 years ago

@MikeMitterer

Many studies have shown that for reading text, a line length of 50-80 chars is the most readable. Compare reading this: image

With reading this: image

Most people will say the latter is much more readable. Here is an article about this: http://baymard.com/blog/line-length-readability

I'm not really sure if those studies would translate to also the readability of code. But I guess this is one of the reason dart fmt chooses 80 chars by default.

However, if you really can't stand the amount of space you waste, you can change this setting. For example do

dartfmt -l 120

You can also change the internnal dartfmt formatter of webstorm: