0x0ff's blog

By 0x0ff, history, 3 years ago, In English

I usually got this trivial doubt that , which should I use ? As a newbie , I want to ask that Is relying on macros or snippets develop wrong habits in your way of writing code in long term. Is writing whole code for a while , then switching to snippets/macros will going to avoid the problem.

  • Vote: I like it
  • +4
  • Vote: I do not like it

»
3 years ago, # |
  Vote: I like it +7 Vote: I do not like it

After you have understood an algorithm and can write it on your own, then you can use snippets. But, as a newbie you would only use DFS, BFS, Binary search. So there is no use of snippets for beginners.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +11 Vote: I do not like it

    Got your point along with how bad question I have asked. Thankyou for answering.

»
3 years ago, # |
  Vote: I like it +14 Vote: I do not like it

I think from my experience writing code with/or without macros makes little or no difference in speed, hence I write without any macros but I do use snippets (for things like Modint and Segment Tree) which I found very useful.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +11 Vote: I do not like it

    Yes, I think that if you have reasonably decent typing speed then it doesn't make much difference. It might make some difference later but it's not something a newbie should worry about. Thank you for answering.

»
3 years ago, # |
  Vote: I like it +8 Vote: I do not like it

I use snippets only for things which are difficult to write and debug fast. Like segment tree, sparse table, lichao tree etc.

But i feel that if i use snippets i forget how to write things by my own. So i try not to use them if i can. Starting from an empty program is a good practice also.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +11 Vote: I do not like it

    Currently ,I am not using snippets. I feel , I am on right track from your comment. Thank you for answering.