# 1.0 annoyances and Matlab comparison

**URL:** <https://discourse.julialang.org/t/1-0-annoyances-and-matlab-comparison/9433>\
**Category:** Internals & Design\
**Created:** [March 1, 2018, 9:49pm UTC](https://discourse.julialang.org/t/1-0-annoyances-and-matlab-comparison/9433 "2018-03-01T21:49:56Z")\
**Posts on this page:** 1\
**Showing post:** 88

<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:** [March 4, 2018, 8:08pm UTC](https://discourse.julialang.org/t/1-0-annoyances-and-matlab-comparison/9433/88 "2018-03-04T20:08:25Z")

</div>

Did anyone read the explanation that was given by @mbauman and linked to multiple times?

> [@Array{T}(initialization,...) syntax](https://discourse.julialang.org/t/array-t-initialization-syntax/9298/2):
>
> We’ve long supported constructing an Array with a set of known contents like Array(1:3) or Array(sprand(4,4,.4)). We want to generalize this to all iterables and all Abstract Array types, but the specifying-dimension-sizes-for-an-uninitialized-array is ambiguous: Is Array(2) constructing [2] or [#undef, #undef] (since numbers are iterable collections themselves)? Using an explicit initialization object allows us to disambiguate this case… and also support Array(3I, 5, 5) and maybe other clever…

Despite what people keep insisting here, the motivation was not to punish people who want to allocate uninitialized arrays by forcing them to type a long word. The motivation was this:

- Collections are generally constructed in Julia by passing an iterable argument which is used to populate the collection as described [here](https://julialang.org/blog/2016/10/julia-0.5-highlights#initializing-collections).

- Arrays constructors predate this convention and are now an awkward exception to this general pattern. By this convention, `Array((2,3))` should construct the vector `[2,3]` instead of an uninitialized 2×3 matrix. Similarly, `Array(3)` should construct `[3]` instead of an uninitialized 3-element vector.

- `Array(dims...)` is a dangerously simple syntax for a fundamentally dangerous operation. Allocating uninitialized memory can introduce non-determinism and bugs into programs if not used correctly. `Array(2,3)` looks like a very innocuous operation. So not only is this syntax now at odds with how collections generally work, but it’s a dangerous operation.

---

_[View the full topic](https://discourse.julialang.org/t/1-0-annoyances-and-matlab-comparison/9433)._
