Skip to content

Instantly share code, notes, and snippets.

@glorphindale
Last active January 2, 2016 19:09
Show Gist options
  • Save glorphindale/8348423 to your computer and use it in GitHub Desktop.
Save glorphindale/8348423 to your computer and use it in GitHub Desktop.
Значащие отступы
// Python
def func(arg1, arg2):
count = size(arg1) + size(arg2)
print count
print arg1
// C
int func(string arg1, string arg2) {
int count = arg1.size() + arg2.size();
printf("%d", count);
printf("%s", arg1);
}
// Никто не пишет на С++ вот так
int func(string arg1, string arg2) {
int count = arg1.size() + arg2.size();
printf("%d", count);
printf("%s", arg1);
}
// Или так
func(string arg1, string arg2) {
int count = arg1.size() + arg2.size();
// Важная строка, выделим отступом
printf("%d", count);
printf("%s", arg1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment