# Shorthand for \[\[1,2\],\[3,4\]\] .+ 1

**URL:** <https://discourse.julialang.org/t/shorthand-for-1-2-3-4-1/12526>\
**Category:** General Usage\
**Tags:** question\
**Created:** [July 20, 2018, 8:29am UTC](https://discourse.julialang.org/t/shorthand-for-1-2-3-4-1/12526 "2018-07-20T08:29:23Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [July 21, 2018, 8:17pm UTC](https://discourse.julialang.org/t/shorthand-for-1-2-3-4-1/12526/11 "2018-07-21T20:17:13Z")

</div>

It may surprise you (based on your apparently dim view of our decision making process), that the deprecation of `A + 1` was not done just to annoy people and be pedantic, but with careful deliberation for mathematical reasons. Mathematicians tend to like `+` to be associative, which was no longer the case when `A + 1` with Matlab-like behavior was allowed in combination with uniform scaling objects (`I`)—a uniquely Julian and very powerful feature. (It is left as an exercise for the reader to figure out how this causes associativity to fail or to find the issue where this decision was made.) In the showdown between `A + 1` and `A + I` the former loses out because broadcasting behavior for scalars is not really mathematically sound: in generic code `A + 1` should really behave the same as `A + I` instead of like `A + ones(n,n)` because `I` Is the multiplicative identity for arrays, not `ones(n,n)`. The broadcasting behavior of `+` really only makes sense in the old Matlab (et al.) mindset where vectorization is necessary for performance, a view point that is neither mandatory nor even beneficial in Julia.

---

_[View the full topic](https://discourse.julialang.org/t/shorthand-for-1-2-3-4-1/12526)._
