# Did Julia community do something to improve its correctness?

**URL:** <https://discourse.julialang.org/t/did-julia-community-do-something-to-improve-its-correctness/102515>\
**Category:** General Usage\
**Created:** [August 5, 2023, 7:16am UTC](https://discourse.julialang.org/t/did-julia-community-do-something-to-improve-its-correctness/102515 "2023-08-05T07:16:42Z")\
**Posts on this page:** 1\
**Showing post:** 141

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [October 23, 2023, 5:23pm UTC](https://discourse.julialang.org/t/did-julia-community-do-something-to-improve-its-correctness/102515/141 "2023-10-23T17:23:44Z")

</div>

> [@adienes](#):
>
> that is not clear to me. after all, I think the “naive” implementation of `sum!` would probably work correctly here

Yes, of course:

```julia-repl
julia> function sum!(a,b)
           for i in eachindex(a,b)
               a[i] = a[i] + b[i]
           end
           return a
       end
sum! (generic function with 1 method)

julia> x = [1,2,3];

julia> sum!(x,x)
3-element Vector{Int64}:
 2
 4
 6

```

At the same time, I also think that the importance of such an issue is overrated. Anyone really uses a mutating function like that without checking the result?

Important libraries like numpy and other are full of gotchas, and while I think that bug should be fixed in a good way (not only by documentation), I find hardly believable that someone writing some complex math and working out performance tuning (to arrive at trying to use this) would have a program with a hidden bug like that.

By the way, can someone explain this?

```python
In [1]: import numpy as np

In [2]: a = np.array([1,2,3])

In [3]: sum(a,a)
Out[3]: array([7, 8, 9])

```

Seems that `sum` is not intended to sum two arrays (one thing is the array being summed, the other I didn’t understand from the documentation. Fair enough, but I think it makes my point: I do not trust my intuition about what a function should do… not here, not with any other language.

---

_[View the full topic](https://discourse.julialang.org/t/did-julia-community-do-something-to-improve-its-correctness/102515)._
