Search code examples
web-applicationsvoting

Optimal voting solution


I have a simple blog webapp where users may vote.

What would be the advantages of having a single integer that goes up or down(should negative numbers be allowed?), or having a likes and dislikes counts that only go up.

Which is more flexible, which is more optimal?


Solution

  • Tracking both the number of likes and dislikes allows viewers to see how many people liked/disliked the post, rather than just the difference of the two numbers. That gives you the ability to illustrate how many people have seen the post and bothered to vote.

    If that is important to you, it may be worth it to keep track of the extra number.