# \`'\` or \`transpose\` failing on strings is not beginner-friendly

**URL:** https://discourse.julialang.org/t/or-transpose-failing-on-strings-is-not-beginner-friendly/44926
**Category:** Internals & Design
**Created:** [August 14, 2020, 10:32am UTC](https://discourse.julialang.org/t/or-transpose-failing-on-strings-is-not-beginner-friendly/44926 "2020-08-14T10:32:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)
#### Post date: [August 14, 2020, 10:32am UTC](https://discourse.julialang.org/t/or-transpose-failing-on-strings-is-not-beginner-friendly/44926/1 "2020-08-14T10:32:49Z")

</div>

While I understand that [`transpose` is recursive](https://github.com/JuliaLang/julia/issues/18320#issuecomment-244218927), the fact that it fails on strings (together with the beautiful `'` notation) _is_ a problem for beginners.  
I would vote for a less pure solution that stops the recursion for `AbstractString` and just work (or maybe better make the recursion of `transpose` optional in Julia 2.0) rather than the current arcane error message it gives.

My two cents as the idiot user :-/

EDIT: I now also understand the difference between [“linear algebra” and “container-like” operations](https://discourse.julialang.org/t/transpose-of-an-array-of-strings/40431/12)… still I think that this is an example of stuff that make the Julia language learning curve steeper than what should be…

---

<div class="post-metadata">

### Author: ![simeonschaub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simeonschaub/32/216566_2.png) [@simeonschaub](https://discourse.julialang.org/u/simeonschaub)
#### Post date: [August 14, 2020, 11:09am UTC](https://discourse.julialang.org/t/or-transpose-failing-on-strings-is-not-beginner-friendly/44926/2 "2020-08-14T11:09:53Z")

</div>

I don’t think we should change the current behavior, but I think we could do a better job at giving a more helpful error message that points the user to `permutedims` and `PermutedDimsArray`.

---

<div class="post-metadata">

### Author: ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)
#### Post date: [August 14, 2020, 11:52am UTC](https://discourse.julialang.org/t/or-transpose-failing-on-strings-is-not-beginner-friendly/44926/3 "2020-08-14T11:52:51Z")

</div>

I think, maybe, the best solution is just to raise people awareness of `permutedims` (always use it when possible in examples) and give a better error message as @simeonschaub pointed out.

[The documentation of `transpose` already recognizes this is a common mistake and points to `permutedims`.](https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/#Base.transpose)
