Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding #define shorthands #69

Open
steven-mathew opened this issue Jan 28, 2019 · 3 comments
Open

Adding #define shorthands #69

steven-mathew opened this issue Jan 28, 2019 · 3 comments

Comments

@steven-mathew
Copy link

I think you should add useful c++ shorthands.

@lnishan
Copy link
Owner

lnishan commented Mar 7, 2019

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

@steven-mathew
Copy link
Author

steven-mathew commented Mar 7, 2019

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.

@lnishan
Copy link
Owner

lnishan commented Jul 26, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants