Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add explanation in book that indentation is significant #2266

Open
A-Roso opened this issue Dec 6, 2021 · 8 comments
Open

add explanation in book that indentation is significant #2266

A-Roso opened this issue Dec 6, 2021 · 8 comments
Assignees

Comments

@A-Roso
Copy link
Contributor

A-Roso commented Dec 6, 2021

There is no explanation in the book that indentation is significant and needed for the compiler. When searching for 'Indentation' it is only referenced in the Style Guide, Migration Guide and Language Reference.
I think for new learners that start learning Scala with Scala3 and the Scala3 book, it would be very helpful to add a few lines of explanation e.g. in A Taste of Scala - Control Structures or even a chapter of its own, that indentation is significant and must be adhered to.

@SethTisue
Copy link
Member

@alvinj

@alvinj
Copy link
Contributor

alvinj commented Dec 9, 2021

Hi @SethTisue. Unfortunately I have to focus on paid work at the moment, but yes, if we didn’t mention that, it should be added. I’ll be glad to do this as part of some volunteer work again next year, but honestly, it won’t be until somewhere around March-June.

@SethTisue
Copy link
Member

maybe someone else would like to pick this up.

@Shorla
Copy link
Contributor

Shorla commented Mar 30, 2022

Hi @SethTisue, I am new here but would love to contribute to scala docs. can I be assigned to this issue?

@SethTisue
Copy link
Member

sure, go for it!

@Shorla
Copy link
Contributor

Shorla commented Mar 31, 2022

should i move the explanation here:https://docs.scala-lang.org/style/indentation.html to scala book?

@bishabosha
Copy link
Member

bishabosha commented Mar 31, 2022

should i move the explanation here:https://docs.scala-lang.org/style/indentation.html to scala book?

this explanation is for Scala 2, where indentation is only a style preference. You could adapt from the official reference for Scala 3's indentation (but it is not very beginner friendly)

@alvinj
Copy link
Contributor

alvinj commented Apr 8, 2022

This is actually a pretty fundamental thing that I missed in the book. I agree with the initial comment that it could go in the Control Structures section, since that’s where it’s first shown, or just prior to that section.

FWIW, I also see on that Control Structures page that I left the Scala 2 example indented with four spaces, which is not consistent with the rest of the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants