We've all seen new questions with code that looks something like this:
func someFunction() {
// code here
more here
etc.
}
Obviously they posted:
func someFunction() { // code here more here etc. }
and saw what a mess it is. Then they simply indented the first line and said "good enough".
We are lucky to at least get code formatted that well but it would be great to get it done correctly the rest of the way:
func someFunction() {
// code here
more here
etc.
}
Can the "Ask Question" screen somehow teach the user to select all of the code they pasted and then press Ctrl-k to indent it all?
I don't think enough people know about Ctrl-k or even that code should be indented 4 spaces to be formatted as code.
Maybe a reminder can be shown if certain strings are found at the start of a line such as }
.
I guess this is partially an enhancement request and partially a discussion on good ways to help teach new(er) users how to format their code properly. I spend way too much time cleaning up users' posts.