With things like SO, Digg, Reddit, etc.
Should I track downvotes in the database regardless of upvotes? Or do they just have a “votes” field that decreases or increases based on what the user does without saving it?
How should voices be handled?
SO, +10, -2. . , . , .
. ( ), .
, , . , , , .
, SO CW non CW. , CW , recalc, / rep .
, .
, , . . , , .
SO . , , / , . , , , , - , , , - .
, , , downvote. , , .
- ( ), , . . .
, ( ?), .
, , int , .
int
, , SO +10 upvote -2 downvote, , .
10 upvotes 5 downvotes, 90 , 50, .
, . downvoting, , .
. - , (, - ). , .
since people can usually vote once, and (for example, in SO) can cancel their votes, you need to know who voted, what time, what vote and which element.
I am sure that downvotes and upvotes are stored separately, although there may be a cumulative field that stores the account. SO allows you to change your voice later (do downvote upvote), and so I believe that voices are registered for each user, too.
Source: https://habr.com/ru/post/1706165/More articles:MySQL stored procedure: cannot be executed with PHP code - phpAlgorithm of similarity (themes) of news - nearest-neighborSound mixing in Java? - javaHow to do unit test this method? - unit-testingПоддержка нескольких баз данных в Symfony - symfony1How to import network assembly - c #JQuery - a POST request is a GET request .. how did it happen? - jqueryHow can I show external links in the Django admin interface? - djangoAccess to tuple list - pythonUsing remote events in wcf - eventsAll Articles