Блог пользователя 0x0ff

Автор 0x0ff, история, 2 года назад, По-английски

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.

  • Проголосовать: нравится
  • +4
  • Проголосовать: не нравится

»
2 года назад, # |
  Проголосовать: нравится +7 Проголосовать: не нравится

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.

  • »
    »
    2 года назад, # ^ |
      Проголосовать: нравится +11 Проголосовать: не нравится

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

»
2 года назад, # |
  Проголосовать: нравится +14 Проголосовать: не нравится

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.

  • »
    »
    2 года назад, # ^ |
      Проголосовать: нравится +11 Проголосовать: не нравится

    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.

»
2 года назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

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.

  • »
    »
    2 года назад, # ^ |
      Проголосовать: нравится +11 Проголосовать: не нравится

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