# \`Base.rand\` but \`Random.rand!\`?

**URL:** <https://discourse.julialang.org/t/base-rand-but-random-rand/14174>\
**Category:** General Usage\
**Created:** [August 28, 2018, 6:57am UTC](https://discourse.julialang.org/t/base-rand-but-random-rand/14174 "2018-08-28T06:57:07Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![Seif\_Shebl](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Post date:** [August 29, 2018, 7:16pm UTC](https://discourse.julialang.org/t/base-rand-but-random-rand/14174/21 "2018-08-29T19:16:31Z")

</div>

Yes, fair enough, I’ll try to focus on the bright side of it. Seems like MATLAB philosophy has some how infected us.

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [August 29, 2018, 7:35pm UTC](https://discourse.julialang.org/t/base-rand-but-random-rand/14174/22 "2018-08-29T19:35:57Z")

</div>

> [@ExpandingMan](#):
>
> So yeah, `using LinearAlgebra, Statistics, Random` sucks,

I use linear algebra, random and statistics stuff all the time. And I’m used to Matlab. But I really don’t get the problem with this.

For interactive use you put `using...` in startup.jl. For library code, using-statements are completely natural.

And it’s not like in python where everyday functionality is hidden three levels deep in 40 different packages. You just need to import a few broad packages, and your set.

---

<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:** [August 29, 2018, 7:38pm UTC](https://discourse.julialang.org/t/base-rand-but-random-rand/14174/23 "2018-08-29T19:38:06Z")

</div>

Keep in mind that you can put `using Random` in your `~/.julia/config/startup.jl` file and then never need to think about this again. Of course, in code that creates modules that want to use `Random` you still need this, but that seems like a place where it’s a good thing to be explicit about which parts of the stdlib you do and don’t depend on.

---

<div class="post-metadata">

**Author:** ![Seif\_Shebl](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Post date:** [August 29, 2018, 7:39pm UTC](https://discourse.julialang.org/t/base-rand-but-random-rand/14174/24 "2018-08-29T19:39:52Z")

</div>

Yes, I do it all the time. My `startup.jl` includes:

```
using LinearAlgebra, Statistics, Random

```

Only today did I have a problem installing one package and was forced to disable silent `Statistics` just during the install and added it explicitly.

---

<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:** [August 29, 2018, 7:45pm UTC](https://discourse.julialang.org/t/base-rand-but-random-rand/14174/25 "2018-08-29T19:45:54Z")

</div>

> [@Seif\_Shebl](#):
>
> Yes, I do it all the time.

So what’s the problem?

> Only today did I have a problem installing one package and was forced to disable silent `Statistics` just during the install and added it explicitly.

I think we recently changed package building to ignore `startup.jl` which it should have done in the first place, but now that this is fixed it shouldn’t be an issue anymore.

---

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [August 29, 2018, 7:55pm UTC](https://discourse.julialang.org/t/base-rand-but-random-rand/14174/26 "2018-08-29T19:55:40Z")

</div>

> [@DNF](#):
>
> And I’m used to Matlab. But I really don’t get the problem with this.

I’ll admit that it’s mostly psychological. One of the beautiful things about Julia is that it takes things like linear algebra seriously. I remember how unamused I was when I first started learning to program and I realized `A*B` wasn’t matrix multiplication. Then people told me about Python and numpy I thought “Oh, a high level programming language! So happy that multiplication will finally be multiplication and that there are objects in the base language that behave like some reasonable approximation of vectors and matrices, if not higher rank tensors!” 😒 (and of course all that stuff is there, it’s just not bound to the operators like it should be)

The idea that there is some wise-guy out there who thinks that linear algebra is a “niche discipline” just seems offensive, especially if you think that he is developing the programming language that you are going to be using. (I’m pleased to say that I’m quite convinced that the Julia devs take linear algebra deadly seriously.)

So yeah, I’ll fully admit it, it’s mostly psychological.

[Previous page](https://discourse.julialang.org/t/base-rand-but-random-rand/14174.md?page=1)
