---
title: "Comment by Paddy McCarthy on \"How to write good code?\" | Hashnode"
description: "For example, canScrollHorizontally is so much better and meaningful than ScrollableX. Context is everything. If the variable is defined in a scollability method"
url: "https://hashnode.com/posts/how-to-write-good-code/5e060705010cc49d3c1e81b8/comment/5e19c79e32d5fad159b684fa"
---

[Discussion](https://hashnode.com/posts/how-to-write-good-code/5e060705010cc49d3c1e81b8)

Comment [How to write good code?](https://hashnode.com/posts/how-to-write-good-code/5e060705010cc49d3c1e81b8)

[Paddy McCarthy](https://hashnode.com/@Paddy3118)

[Jan 11, 2020](https://hashnode.com/posts/how-to-write-good-code/5e060705010cc49d3c1e81b8/comment/5e19c79e32d5fad159b684fa)

> For example, canScrollHorizontally is so much better and meaningful than ScrollableX.

Context is everything. If the variable is defined in a scollability method or class, then a better name might be 'allowHorizontal' or allowHoriz or even allowH. You have to balance identifier length, and a good way of accomplishing that is to make use of **context**.

[Tanseer Saji](https://hashnode.com/@tanseersaji)

[Jan 16, 2020](https://hashnode.com/posts/how-to-write-good-code/5e060705010cc49d3c1e81b8/comment/5e19c79e32d5fad159b684fa#reply-5e206ad932d5fad159b6e0ba)

That is a great point sir, thanks for sharing.
