vscode-rust icon indicating copy to clipboard operation
vscode-rust copied to clipboard

Improve the code style

Open ishitatsuyuki opened this issue 8 years ago • 6 comments

I have no idea why the code is flooded with newlines. It simply fits less in the screen and makes it hard to read.

For example, imports should be organized in one block, or split as internal imports vs external ones. You break each import with two newlines.

Changing this would require a huge commit. I would like to have a place for discussion before the change.

ishitatsuyuki avatar Apr 23 '17 01:04 ishitatsuyuki

It allows to easily read code without any distraction from other elements. I find it easily to read.

KalitaAlexey avatar Apr 23 '17 07:04 KalitaAlexey

@ishitatsuyuki, Each function is small enough to fit within a screen.

KalitaAlexey avatar Apr 23 '17 07:04 KalitaAlexey

What about the imports flooding over twice of my editor height?

If you're coding on a big monitor, consider increasing the text size.

ishitatsuyuki avatar Apr 23 '17 07:04 ishitatsuyuki

How do you suggest to write imports in order to make it easier to add/remove imports for VCS?

KalitaAlexey avatar Apr 23 '17 08:04 KalitaAlexey

Do not flood with redundant blank lines. This applies to imports and class fields.

Blank lines between blocks (for {}, if {}) is acceptable depending on your preferred code style.

ishitatsuyuki avatar Apr 23 '17 08:04 ishitatsuyuki

I will re-work my code and write code guidelines. This will be after I have done what I am planning for this release.

KalitaAlexey avatar Apr 23 '17 08:04 KalitaAlexey