can any one tell me how to write code well any language? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

can any one tell me how to write code well any language?

how to be proficient

19th May 2023, 6:40 AM
THARUN GAJJELA
THARUN GAJJELA - avatar
2 Answers
+ 2
The efficience of your code delends on the language. Generally, these are some tips: -Avoid nested loops -Avoid so much ifs -Avoid creating so much variables when it is not necessary and you can store them in arrays
19th May 2023, 7:49 AM
Ugulberto Sánchez
Ugulberto Sánchez - avatar
+ 1
Rules may differ between languages, but in general, you should: - use proper and meaningful names for your variables and functions; - keep your functions as simple as possible in order to simplify debugging and testing them; - always make sure that whenever your program opens a file to read it, then it gets closed; - always make sure that loops will eventually stop; - always make sure that your program returns meaningful errors.
21st May 2023, 11:08 AM
Gabriele Gatti
Gabriele Gatti - avatar