---
title: "Comment by Ahmet Özel on \"LeetCode #345 in Go: reverse vowels of a string, and how strings, bytes, and runes work in Go\n\" | Hashnode"
description: "The constraint-first choice between []byte and []rune is exactly the right lesson. One additional boundary is that a rune is a Unicode code point, not necessari"
url: "https://hashnode.com/posts/leetcode-345-in-go-reverse-vowels-of-a-string-and-how-strings-bytes-and-runes-work-in-go/6a733384cef049374277f7fb/comment/6a7372cc738d16399dd03dfa"
---

[Discussion](https://hashnode.com/posts/leetcode-345-in-go-reverse-vowels-of-a-string-and-how-strings-bytes-and-runes-work-in-go/6a733384cef049374277f7fb)

Comment [LeetCode #345 in Go: reverse vowels of a string, and how strings, bytes, and runes work in Go](https://hashnode.com/posts/leetcode-345-in-go-reverse-vowels-of-a-string-and-how-strings-bytes-and-runes-work-in-go/6a733384cef049374277f7fb)

[Ahmet Özel](https://hashnode.com/@ahmetozel)

[Aug 5](https://hashnode.com/posts/leetcode-345-in-go-reverse-vowels-of-a-string-and-how-strings-bytes-and-runes-work-in-go/6a733384cef049374277f7fb/comment/6a7372cc738d16399dd03dfa)

The constraint-first choice between \[\]byte and \[\]rune is exactly the right lesson. One additional boundary is that a rune is a Unicode code point, not necessarily a user-perceived character: combining marks and emoji sequences can still span multiple runes. For this ASCII problem \[\]byte is both simpler and faster; for production text, the requirement should say whether it operates on bytes, code points, or grapheme clusters. That specification matters more than choosing the most Unicode-looking type.

[Fer](https://hashnode.com/@ferztyle)

[Aug 5](https://hashnode.com/posts/leetcode-345-in-go-reverse-vowels-of-a-string-and-how-strings-bytes-and-runes-work-in-go/6a733384cef049374277f7fb/comment/6a7372cc738d16399dd03dfa#reply-6a7396e969cacd27978e1ec8)

Yes! Correct! Specification always comes first.

[Ahmet Özel](https://hashnode.com/@ahmetozel)

[Aug 6](https://hashnode.com/posts/leetcode-345-in-go-reverse-vowels-of-a-string-and-how-strings-bytes-and-runes-work-in-go/6a733384cef049374277f7fb/comment/6a7372cc738d16399dd03dfa#reply-6a7428a641355cea3ad05e5f)

Exactly. I like using this as a small API-design exercise: name the text unit in the function contract first, then choose the representation and tests. A few cases with combining accents and family emoji make the ambiguity obvious immediately.
