# What are common mistakes in julia that beginners should aware of?

**URL:** <https://discourse.julialang.org/t/what-are-common-mistakes-in-julia-that-beginners-should-aware-of/51874>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [December 15, 2020, 2:21pm UTC](https://discourse.julialang.org/t/what-are-common-mistakes-in-julia-that-beginners-should-aware-of/51874 "2020-12-15T14:21:57Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [December 15, 2020, 6:33pm UTC](https://discourse.julialang.org/t/what-are-common-mistakes-in-julia-that-beginners-should-aware-of/51874/9 "2020-12-15T18:33:25Z")

</div>

One very common beginner error is being surprised when `fill()` creates an array in which every element is _the same value_. This can cause unexpected behavior when that value is some mutable object (like an `Array`), since modifying that value once modifies every entry in the `fill` result. For example: [Initialization of array of arrays with `fill(ones(1),2,2)`: only one vector is created](https://discourse.julialang.org/t/initialization-of-array-of-arrays-with-fill-ones-1-2-2-only-one-vector-is-created/48048) or [fill(anArray,2) behaviour](https://discourse.julialang.org/t/fill-anarray-2-behaviour/22429)

At its heart, this is just about the fact that Julia does not implicitly copy things like C++ or Matlab would.

---

_[View the full topic](https://discourse.julialang.org/t/what-are-common-mistakes-in-julia-that-beginners-should-aware-of/51874)._
