---
title: "Discussion on \"Proposal for making private method work on constants too\" | Hashnode"
description: "Discussion on \"Proposal for making private method work on constants too\". Changing Ruby's private method to Include Constants: A Proposal for Improved Code Organization and Readability"
url: "https://hashnode.com/posts/proposal-for-making-private-keyword-work-on-constants-too/66bdac4658ecf7720017c076"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Proposal for making private method work on constants too](https://codeandgit.hashnode.dev/proposal-for-making-private-keyword-work-on-constants-too?utm_source=hashnode&utm_medium=feed)

Changing Ruby's private method to Include Constants: A Proposal for Improved Code Organization and Readability

Aug 15, 2024 · 6 min read · codeandgit.hashnode.dev  
Read the article

-   [#ruby](https://hashnode.com/tag/ruby)
-   [#ruby-on-rails](https://hashnode.com/tag/ruby-on-rails)
-   [#code](https://hashnode.com/tag/code)
-   [#programming-blogs](https://hashnode.com/tag/programming-blogs)

## Written by

[Lucian Ghinda](https://hashnode.com/@lucianghinda)

@lucianghinda · Europe

  
[View profile](https://hashnode.com/@lucianghinda)

Senior Product Engineer

Senior Product Engineer, working in Ruby and Rails. Passionate about idea generation, creativity, and programming. I curate the Short Ruby Newsletter.

## Responses 1

Markdown supported · ⌘↵ to post

[Mitch Kuppinger](https://hashnode.com/@DocPneumo)

[Aug 22, 2024](https://hashnode.com/posts/proposal-for-making-private-keyword-work-on-constants-too/66bdac4658ecf7720017c076/comment/66c77ea9de7a66c6dcb43414)

For a long time I believed placing a constant below the private method actually made it private. Then I set a 'private' constant in a class where was no reason to use that constant outside of the class... But naming is hard and memory is not perfect so I used the same constant name elsewhere. I forgot it existed as a **not** 'private' constant in another class. Bang!

The principle of least surprise should apply whenever possible.

Thank you for re-raising this.

[Lucian Ghinda](https://hashnode.com/@lucianghinda)

[Aug 31, 2024](https://hashnode.com/posts/proposal-for-making-private-keyword-work-on-constants-too/66bdac4658ecf7720017c076/comment/66c77ea9de7a66c6dcb43414#reply-66d29b0620a97f91261f498b)

Yes, this is a great example of why I think private should work with constants.

Thank you for sharing your example here.
