Skip to content

update: Add section about constructor parameters and properties in classes #4872

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

Merged
merged 2 commits into from
Jul 3, 2025

Conversation

choonkending
Copy link
Contributor

@choonkending choonkending commented Jun 1, 2025

High Level Overview

KT-77990

When I was going through the documentation, I had a bit of confusion around "When would we include val or var vs when we shouldn't?" I could not really find it anywhere in the docs, hence I am proposing to include a section explaining the difference between parameters and properties in the constructor.

While it may seem obvious, I hope this clarification can help!

I debated between making this it's own tiny section - but figured it flowed naturally from the current description of properties.

First time contributing to these docs, so happy for any feedback/correction/discussion.

@choonkending choonkending requested a review from a team as a code owner June 1, 2025 01:08
@choonkending choonkending changed the title Add section about constructor parameters and properties for docs Add section about constructor parameters and properties in classes Jun 1, 2025
@choonkending choonkending changed the title Add section about constructor parameters and properties in classes update: Add section about constructor parameters and properties in classes Jun 1, 2025
@choonkending
Copy link
Contributor Author

Bumping this PR - it's not high priority but something valuable imo. Let me know if you reckon it should be reworded/clarified further.

Copy link
Collaborator

@sarahhaggarty sarahhaggarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your suggestion @choonkending ! Sorry it took so long to get to your PR. Your text is correct but could do with some expansion so I made a suggestion. Let me know if you have any questions!

choonkending and others added 2 commits July 2, 2025 09:23
Include a brief explanation between the difference between constructor parameters and properties in the constructor.
@choonkending
Copy link
Contributor Author

@sarahhaggarty Thank you very much for the suggestion. I've updated the commits to include your suggestion and followed the convention the other commits seem to be having. Let me know what else is required 🙏

@sarahhaggarty sarahhaggarty merged commit 9a7633d into JetBrains:master Jul 3, 2025
4 checks passed
@sarahhaggarty
Copy link
Collaborator

Great! Thanks for your contribution @choonkending !

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

Successfully merging this pull request may close these issues.

2 participants