# Name styles of variables, parameters, sets, etc...

**URL:** <https://discourse.julialang.org/t/name-styles-of-variables-parameters-sets-etc/21089>\
**Category:** Optimization (Mathematical)\
**Created:** [February 22, 2019, 6:01pm UTC](https://discourse.julialang.org/t/name-styles-of-variables-parameters-sets-etc/21089 "2019-02-22T18:01:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![haokuny](https://avatars.discourse-cdn.com/v4/letter/h/4da419/32.png) [@haokuny](https://discourse.julialang.org/u/haokuny)\
**Post date:** [February 22, 2019, 6:01pm UTC](https://discourse.julialang.org/t/name-styles-of-variables-parameters-sets-etc/21089/1 "2019-02-22T18:01:48Z")

</div>

When building a JuMP model, one thing I feel very important is to distinguish between variables and parameters in each equation. It’s important because, for example, the term “var. \* par.” is linear but the term “var. \* var.” is nonlinear, so linear solvers like CPLEX won’t return anything if you have a nonlinear equation like that.

So a good name style could not only give the model a good look but also helps to debug. I think it might be a good idea to have all the variables in lower cases and parameters in upper case, e.g., ’ @variable(m, x) ’ and ` X = 1` so you can tell immediately the different between `@constraint(m, x * X <= 3)` and `@constraint(m, x * x <= 3)`

How about the name of sets, models, equations?

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [February 24, 2019, 12:30am UTC](https://discourse.julialang.org/t/name-styles-of-variables-parameters-sets-etc/21089/2 "2019-02-24T00:30:55Z")

</div>

The JuMP style guide has some things to say on this:  
[http://www.juliaopt.org/JuMP.jl/latest/style/#JuMP-macro-syntax-1](http://www.juliaopt.org/JuMP.jl/latest/style/#JuMP-macro-syntax-1)  
[http://www.juliaopt.org/JuMP.jl/latest/style/#Naming-1](http://www.juliaopt.org/JuMP.jl/latest/style/#Naming-1)

We would probably recommend something like

```julia
model = Model()
@variable(model, var_x)
par_x = 1
@constraint(model, con_1, par_x * var_x <= 3)

```
