Hi Codeforces. I think most of you give me down vote but please comment something too : ) actually i'm about newbie(probably as an expert rated one here) i have lots of problems in how should i code to be NEAT and BEAUTIFUL i'll be so happy if you help in comments to code so. i don't know what should i say more. so ask in comments if something is missed thank you all : ) good luck.








Thank you all for answering : ) and thanks from down votes : )
There's no trick, really. I like to go reading other's solutions to past problems and pick up the ideas from other's codes. It's important you code them yourself.
Some useful stuff... Indent code, space between operators, create functions for things you repeat, and also for some of the things you don't. Name your variables and funcions well, declare variables the closest possible to the necessary scope, try to be concise when writing conditions and such. I like to use C++ ranged loops when possible, and also lamba functions when they are useful. Using STL objects such as pairs and typedefing some structures is very useful too.
Thank you for being so polite in asking for downvotes. I like you :) Downvote my comment too please.
Greetings! I guess that it depends, for example I like modularity, have my own way to use the blank spaces and dislike global variables, but some programmers can say that the way I write code is not beautiful. When I read another's code I try just to read the ideas, not the way the code has been written, and apply those ideas on my own code.
yes you're right but you know... for example imagine you're writing hundreds of code for a problem... it's really important that how do you make its structure... what's your opinion?
thank you all for answering : ) specially thanks gabrielsimoes i think your answers were really useful. hope to be legendary for all of you : )
The only rules is, "Write code for people, not computer." i.e Readability should be the most important goal.