How to name variables

前端 未结 24 1263
抹茶落季
抹茶落季 2020-12-01 00:37
  • What rules do you use to name your variables?
  • Where are single letter vars allowed?
  • How much info do you put in the name?
  • How about for exam
24条回答
  •  南方客
    南方客 (楼主)
    2020-12-01 01:19

    I work in MathCAD and I'm happy because MathCAD gives me increadable possibilities in naming and I use them a lot. And I can`t understand how to programm without this. To differ one var from another I have to include a lot of information in the name,for example:

    1.On the first place - that is it -N for quantity,F for force and so on

    2.On the second - additional indices - for direction of force for example

    3.On the third - indexation inside vector or matrix var,for convinience I put var name in {} or [] brackets to show its dimensions.

    So,as conclusion my var name is like N.dirs / Fx i.row / {F}.w.(i,j.k) / {F}.w.(k,i.j). Sometimes I have to add name of coordinate system for vector values {F}.{GCS}.w.(i,j.k) / {F}.{LCS}.w.(i,j.k)

    And as final step I add name of the external module in BOLD at the end of external function or var like Row.MTX.f([M]) because MathCAD doesn't have help string for function.

提交回复
热议问题