Why is this implementation in code different?

Formula Says:

  1. 𝐽+= 𝐽(𝜃+)
  2. 𝐽−= 𝐽(𝜃−)

but in code its:

  1. J_plus = x*theta_plus
  2. J_minus = x*theta_minus

Not sure which course/week that you are referring, but can see your confusions.

If you look at formula very carefully, it must be;

J^{+} = J(\theta^{+}) \\ J^{-} = J(\theta^{-})

Both plus and minus are super-script, not arithmetic operators.
So, if J() = f(x,\theta) = x*\theta, then, J_plus = x*theta_plus, and J_minus = x*theta_minus.