# Why are there all these strange stumbling blocks in Julia?

**URL:** <https://discourse.julialang.org/t/why-are-there-all-these-strange-stumbling-blocks-in-julia/92644>\
**Category:** New to Julia\
**Tags:** syntax, python\
**Created:** [January 7, 2023, 6:19pm UTC](https://discourse.julialang.org/t/why-are-there-all-these-strange-stumbling-blocks-in-julia/92644 "2023-01-07T18:19:30Z")\
**Posts on this page:** 11\
**Page:** 5

<div class="post-metadata">

**Author:** ![braamvandyk](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/braamvandyk/32/5086_2.png) [@braamvandyk](https://discourse.julialang.org/u/braamvandyk)\
**Post date:** [January 13, 2023, 11:38am UTC](https://discourse.julialang.org/t/why-are-there-all-these-strange-stumbling-blocks-in-julia/92644/82 "2023-01-13T11:38:50Z")

</div>

The great / horrible thing about popular usage is that once enough people are wrong, they are right.

---

<div class="post-metadata">

**Author:** ![ParadaCarleton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paradacarleton/32/20005_2.png) [@ParadaCarleton](https://discourse.julialang.org/u/ParadaCarleton)\
**Post date:** [January 13, 2023, 4:29pm UTC](https://discourse.julialang.org/t/why-are-there-all-these-strange-stumbling-blocks-in-julia/92644/83 "2023-01-13T16:29:20Z")

</div>

> [@DNF](#):
>
> This is a big discussion, but string concatenation is more like multiplication than like addition, therefore `*` does in fact make more sense, but it is more unfamiliar to new users.

I think we should just start skipping over the whole discussion about commutativity and all that other jazz and point out it’s actually quite intuitive that `x * y = xy`, since we represent multiplication (not addition) as concatenation.

---

<div class="post-metadata">

**Author:** ![StevenWhitaker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevenwhitaker/32/9749_2.png) [@StevenWhitaker](https://discourse.julialang.org/u/StevenWhitaker)\
**Post date:** [January 13, 2023, 4:30pm UTC](https://discourse.julialang.org/t/why-are-there-all-these-strange-stumbling-blocks-in-julia/92644/84 "2023-01-13T16:30:11Z")

</div>

> [@mbauman](#):
>
> We’re also just as adept at “0-based” sorts of numberings when it comes to things like birthdays and other durations or lengths.

Though time is a continuous-valued quantity, so I hesitate to compare this to discrete-valued indexing. A discrete example is numbering the floors of a building: while I use 1-based indexing (the ground floor is floor 1), other people use 0-based indexing (the ground floor is floor 0).

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [January 13, 2023, 4:59pm UTC](https://discourse.julialang.org/t/why-are-there-all-these-strange-stumbling-blocks-in-julia/92644/85 "2023-01-13T16:59:16Z")

</div>

That’s just as tribally divisive, though, and folks equally think that there’s _one true way™_ without realizing that it’s just difference in perspective. At its root it is the same thing: you’re either counting the difference (number of floors you have to climb) or you’re actually counting the levels.

Sometimes one is more convenient than the other.

---

<div class="post-metadata">

**Author:** ![StevenWhitaker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevenwhitaker/32/9749_2.png) [@StevenWhitaker](https://discourse.julialang.org/u/StevenWhitaker)\
**Post date:** [January 13, 2023, 5:11pm UTC](https://discourse.julialang.org/t/why-are-there-all-these-strange-stumbling-blocks-in-julia/92644/86 "2023-01-13T17:11:13Z")

</div>

Right, I was just trying to think of a real-world example where normal people use 0-based indexing for a discrete-valued quantity. So hopefully my example will help illustrate the point to people in the “floor 0” tribe who are also in the “1-based indexing” tribe. And hopefully that set isn’t the empty set 😉

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [January 13, 2023, 5:25pm UTC](https://discourse.julialang.org/t/why-are-there-all-these-strange-stumbling-blocks-in-julia/92644/87 "2023-01-13T17:25:03Z")

</div>

> [@ParadaCarleton](#):
>
> all that other jazz and point out it’s actually quite intuitive that `x * y = xy`, since we represent multiplication (not addition) as concatenation.

When you write a message and forget to say something and latter correct it, do you say:

_let me **add** to my previous message that …_  
or  
_let me **multiply** to my previous message that …_

---

<div class="post-metadata">

**Author:** ![ParadaCarleton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paradacarleton/32/20005_2.png) [@ParadaCarleton](https://discourse.julialang.org/u/ParadaCarleton)\
**Post date:** [January 13, 2023, 6:26pm UTC](https://discourse.julialang.org/t/why-are-there-all-these-strange-stumbling-blocks-in-julia/92644/89 "2023-01-13T18:26:25Z")

</div>

I’m not saying it’s the _only_ intuitive choice. I’m saying that `x*y=xy` is a reasonable mnemonic. The informal use of “Add” to mean “Append” is a reasonable mnemonic for `x+y=xy`. They’re both sensible choices.

---

<div class="post-metadata">

**Author:** ![Jake](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jake/32/46007_2.png) [@Jake](https://discourse.julialang.org/u/Jake)\
**Post date:** [January 13, 2023, 6:34pm UTC](https://discourse.julialang.org/t/why-are-there-all-these-strange-stumbling-blocks-in-julia/92644/90 "2023-01-13T18:34:56Z")

</div>

> [@StevenWhitaker](#):
>
> Though time is a continuous-valued quantity

A [friend](https://universityofcolombo.academia.edu/DineshBulathsinghala) did a PhD which concluded that time comes in quantum packet’s, thus is also discrete valued. I can’t say that I understood it, but from his starting assumptions he could show that some equations could only be solved at discrete intervals of time, and not for other times. From this he concluded that time must not be continuous!

---

<div class="post-metadata">

**Author:** ![dgagnon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dgagnon/32/45466_2.png) [@dgagnon](https://discourse.julialang.org/u/dgagnon)\
**Post date:** [January 13, 2023, 7:53pm UTC](https://discourse.julialang.org/t/why-are-there-all-these-strange-stumbling-blocks-in-julia/92644/91 "2023-01-13T19:53:06Z")

</div>

In French the first floor is the English second floor.  
It goes: rez-de-chaussée (RC = at street level), étage 1, 2, etc. So RC = 0.  
In the province of Québec you’ll see hybrids sometimes: RC, 2, 3, etc. But that is technically incorrect and cause confusion when Quebecers go to France or vise versa.

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [February 13, 2023, 6:35am UTC](https://discourse.julialang.org/t/why-are-there-all-these-strange-stumbling-blocks-in-julia/92644/92 "2023-02-13T06:35:47Z")

</div>

> [@mbauman](#):
>
> That’s just as tribally divisive, though, and folks equally think that there’s _one true way™_ without realizing that it’s just difference in perspective. At its root it is the same thing: you’re either counting the difference (number of floors you have to climb) or you’re actually counting the levels.
> 
> Sometimes one is more convenient than the other.

I may argue that the “ground floor is fixed” is better than “lowest floor is fixed”, which is just a mess : depending on the number of underground floors, you get out on the street at different levels. You may have to jump from 2 to 4 when you change buildings.

---

<div class="post-metadata">

**Author:** ![abraunst](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abraunst/32/6880_2.png) [@abraunst](https://discourse.julialang.org/u/abraunst)\
**Post date:** [November 21, 2024, 12:41pm UTC](https://discourse.julialang.org/t/why-are-there-all-these-strange-stumbling-blocks-in-julia/92644/93 "2024-11-21T12:41:32Z")

</div>

Not to be cheeky but with

```julia
using IterTools
measure(x) = length(subsets(x))

```

Then

```julia
measure(s * t) == measure(s) * measure(t)

```

🙈

[Previous page](https://discourse.julialang.org/t/why-are-there-all-these-strange-stumbling-blocks-in-julia/92644.md?page=4)
