# Poll for a Crystal keyword I never use it

**URL:** <https://forum.crystal-lang.org/t/poll-for-a-crystal-keyword-i-never-use-it/8071>\
**Category:** Community\
**Created:** [May 17, 2025, 4:48am UTC](https://forum.crystal-lang.org/t/poll-for-a-crystal-keyword-i-never-use-it/8071 "2025-05-17T04:48:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zw963](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/zw963/32/1623_2.png) [@zw963](https://forum.crystal-lang.org/u/zw963)\
**Post date:** [May 17, 2025, 4:48am UTC](https://forum.crystal-lang.org/t/poll-for-a-crystal-keyword-i-never-use-it/8071/1 "2025-05-17T04:48:00Z")

</div>

_Poll ([view on site](https://forum.crystal-lang.org/t/poll-for-a-crystal-keyword-i-never-use-it/8071/1))_

* * *

_Poll ([view on site](https://forum.crystal-lang.org/t/poll-for-a-crystal-keyword-i-never-use-it/8071/1))_

* * *

_Poll ([view on site](https://forum.crystal-lang.org/t/poll-for-a-crystal-keyword-i-never-use-it/8071/1))_

Let’s see if this is a failed design?

---

<div class="post-metadata">

**Author:** ![kojix2](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/kojix2/32/1583_2.png) [@kojix2](https://forum.crystal-lang.org/u/kojix2)\
**Post date:** [May 17, 2025, 5:38am UTC](https://forum.crystal-lang.org/t/poll-for-a-crystal-keyword-i-never-use-it/8071/2 "2025-05-17T05:38:12Z")

</div>

I use “then.”  
I like that “when” is only one line.

```cr
case c
when 65u8, 97u8 then 0u8 # A
when 67u8, 99u8 then 1u8 # C
when 71u8, 103u8 then 2u8 # G
when 84u8, 116u8 then 3u8 # T
when 78u8, 110u8 then 4u8 # N
else
  STDERR.puts "[sdust] '#{c.chr}' is replaced with 'N'"
  4u8
end

```

---

<div class="post-metadata">

**Author:** ![straight-shoota](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/straight-shoota/32/36_2.png) [@straight-shoota](https://forum.crystal-lang.org/u/straight-shoota)\
**Post date:** [May 17, 2025, 7:53am UTC](https://forum.crystal-lang.org/t/poll-for-a-crystal-keyword-i-never-use-it/8071/3 "2025-05-17T07:53:03Z")

</div>

Yes, the use case for `then` is one-liner `when` branches.

Of course, a statement separator works as well, so you could replace `then` with `;` for even more concise syntax.  
So it’s not strictly necessary, but still reads a bit nicer IMO.

```cr
case c
when 65u8, 97u8 ; 0u8 # A
when 67u8, 99u8 ; 1u8 # C
when 71u8, 103u8 ; 2u8 # G
when 84u8, 116u8 ; 3u8 # T
when 78u8, 110u8 ; 4u8 # N
else
  STDERR.puts "[sdust] '#{c.chr}' is replaced with 'N'"
  4u8
end

```

---

<div class="post-metadata">

**Author:** ![MistressRemilia](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/mistressremilia/32/2585_2.png) [@MistressRemilia](https://forum.crystal-lang.org/u/MistressRemilia)\
**Post date:** [May 17, 2025, 10:53pm UTC](https://forum.crystal-lang.org/t/poll-for-a-crystal-keyword-i-never-use-it/8071/4 "2025-05-17T22:53:21Z")

</div>

I use it all the time to make more concise-looking `case` statements. I drop it when I need to use multiple lines in any of my cases, or if the lines get too unreadable.

---

<div class="post-metadata">

**Author:** ![Carlos](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@Carlos](https://forum.crystal-lang.org/u/Carlos)\
**Post date:** [May 19, 2025, 4:47am UTC](https://forum.crystal-lang.org/t/poll-for-a-crystal-keyword-i-never-use-it/8071/5 "2025-05-19T04:47:42Z")

</div>

Not only I use it, I wish it was available for `if` as well. I’d rather use `then` instead of a semicolon in one-line `if` statements or expressions.
