# Inconsistent printing of old \`immutable\`s and new \`struct\`s

**URL:** <https://discourse.julialang.org/t/inconsistent-printing-of-old-immutable-s-and-new-struct-s/2077>\
**Category:** Internals & Design\
**Tags:** question\
**Created:** [February 13, 2017, 12:36pm UTC](https://discourse.julialang.org/t/inconsistent-printing-of-old-immutable-s-and-new-struct-s/2077 "2017-02-13T12:36:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![HarrisonGrodin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/harrisongrodin/32/5214_2.png) [@HarrisonGrodin](https://discourse.julialang.org/u/HarrisonGrodin)\
**Post date:** [February 13, 2017, 12:36pm UTC](https://discourse.julialang.org/t/inconsistent-printing-of-old-immutable-s-and-new-struct-s/2077/1 "2017-02-13T12:36:58Z")

</div>

In v0.5-, instances of `immutable`s (and regular `types`) print without spaces after commas.

```julia
julia> immutable Point
           x::Int
           y::Int
       end

julia> Point(3,4)
Point(3,4)

```

I noticed, though, that the new `struct`s use a space after the comma.

```julia
julia> struct Point
           x::Int
           y::Int
       end

julia> Point(3,4)
Point(3, 4)

```

It doesn’t seem like _the_ most important issue, by far, but I’m curious - is this intentional? 🙂

(On a slightly broader note, what is the recommended style for Julian commas? To space or not to space?)

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [February 13, 2017, 12:39pm UTC](https://discourse.julialang.org/t/inconsistent-printing-of-old-immutable-s-and-new-struct-s/2077/2 "2017-02-13T12:39:56Z")

</div>

There has been a general tendency towards adding whitespace for readability and clarity, as shown by your post.

---

<div class="post-metadata">

**Author:** ![pint](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pint/32/125_2.png) [@pint](https://discourse.julialang.org/u/pint)\
**Post date:** [February 13, 2017, 1:04pm UTC](https://discourse.julialang.org/t/inconsistent-printing-of-old-immutable-s-and-new-struct-s/2077/3 "2017-02-13T13:04:44Z")

</div>

i personally don’t like such “hard coded” rules. my suggesttion: use whatever is more clear, when in doubt, use space.

---

<div class="post-metadata">

**Author:** ![quinnj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quinnj/32/11_2.png) [@quinnj](https://discourse.julialang.org/u/quinnj)\
**Post date:** [February 13, 2017, 2:09pm UTC](https://discourse.julialang.org/t/inconsistent-printing-of-old-immutable-s-and-new-struct-s/2077/4 "2017-02-13T14:09:35Z")

</div>

I believe this was changed [here](https://github.com/JuliaLang/julia/pull/20288). I think the trend has been towards more spaces.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [February 13, 2017, 3:55pm UTC](https://discourse.julialang.org/t/inconsistent-printing-of-old-immutable-s-and-new-struct-s/2077/5 "2017-02-13T15:55:57Z")

</div>

It matches a spacing convention that’s seen in Base. In that sense, it makes everything look more like the code that generated it, if using that spacing convention.

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [February 13, 2017, 4:20pm UTC](https://discourse.julialang.org/t/inconsistent-printing-of-old-immutable-s-and-new-struct-s/2077/6 "2017-02-13T16:20:04Z")

</div>

I think spaces after commas are better, and would prefer Julia to use them consistently for output. However, perhaps they shouldn’t be required when Julia code is being parsed.

I’ve often wondered whether commas without spaces cause confusion for people in European countries, who use commas instead of decimal point separators. So for me “3,4” is 2 numbers, but only one for them.

---

<div class="post-metadata">

**Author:** ![HarrisonGrodin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/harrisongrodin/32/5214_2.png) [@HarrisonGrodin](https://discourse.julialang.org/u/HarrisonGrodin)\
**Post date:** [February 14, 2017, 4:17am UTC](https://discourse.julialang.org/t/inconsistent-printing-of-old-immutable-s-and-new-struct-s/2077/7 "2017-02-14T04:17:44Z")

</div>

Interesting. Glad to see more consistency here. Thanks, everyone. 🙂
