+ 2
What counts as an elegant code and can i get an example?
2 Antworten
+ 3
https://google.github.io/styleguide/cppguide.html
https://blog.risingstack.com/javascript-clean-coding-best-practices-node-js-at-scale/
Just a couple examples. Basically, learn the current standard in proper code formatting/styling/etiquette. It's to make the code more readable by yourself and by anyone else that deals with it. Imagine if you made all your variables letters instead of properly naming them to their purpose and then you showed back up later trying to understand what you were doing; or imagine someone else trying to understand it at all. It would be quite difficult to read. Same holds true if you just jumble it up instead of properly formatting it as one would expect from the code.
Plenty of resources online that'll teach you to do it properly by the current standards.
+ 2
Elegant code, huh? It's when you hand it to another person, and he understands it just like you do. It's looking good, it's formatted nicely, and is short and concise. Also, it works fast and has nice UI.
If you look at code, you just know when it's elegant.