lnishan / awesome-competitive-programming

:gem: A curated list of awesome Competitive Programming, Algorithm and Data Structure resources

Home Page:http://codeforces.com/blog/entry/23054

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding #define shorthands

steven-mathew opened this issue · comments

I think you should add useful c++ shorthands.

Do you mean code snippets such as how to break down a space-separated input with strtok?
Or quick tutorials for C++ STLs?

I was thinking of C++ macros. For example, a macro for a for loop in the range [l,r]:
#define fore(i, l, r) for (int i = (int)(l); i <= (int)(r); i++). These would be useful to add to a competitive programming repo.

I'm not sure - this is 100% my personal opinion, that those macro defines should be discouraged. These tend to lead to bad coding practices later on. IMO, if we were to mention these techniques, we would need to add a strong caution against using them in regular programming.