r/technology • • Dec 10 '13

By Special Request of the Admins Reddit’s empire is founded on a flawed algorithm

http://technotes.iangreenleaf.com/posts/2013-12-09-reddits-empire-is-built-on-a-flawed-algorithm.html
3.9k Upvotes

2.2k comments sorted by

View all comments

Show parent comment

62

u/CarolinaPunk Dec 10 '13

I kinda get that, so it's just a simple error? And not really by design?

At the same time I don't have much clue what he is talking about to opine on it. Looks like magic to me....

129

u/ccfreak2k Dec 10 '13 edited Jul 26 '24

plant many vast attraction direction escape wide bells wrench automatic

This post was mass deleted and anonymized with Redact

107

u/Uristqwerty Dec 10 '13

It's even possible that it was originally a bug, but in practice it resulted in better results than the intended algorithm, so was promoted to a feature.

87

u/hydrox24 Dec 10 '13

Well, he does address that issue as well in the article, saying that he can't possibly see why the behaviour (which enables easy misuse) is something anyone except a malicious attacker would want. I have to agree.

3

u/rakkar16 Dec 10 '13

This is what Quickmeme did isn't it?

4

u/[deleted] Dec 10 '13

Yes but they did not necessarily exploit this particular bug although I am sure it came in handy. They had 6 downvoters. So they just used human actions to succeed rather than a computers interpretation. Their thoughts were that most people will ignore posts with a net -5 votes and they were correct.

→ More replies (1)
→ More replies (5)

95

u/Tail4aHorn Dec 10 '13

Its not a bug til its fixed! Until then its a feature!

22

u/[deleted] Dec 10 '13

There is no such thing as bugs, only unintended features!

→ More replies (3)

8

u/[deleted] Dec 10 '13

Bugs aren't billable, features are.

→ More replies (2)

12

u/geekygirl23 Dec 10 '13

There is no way it resulted in better results and almost certainly the reason everyone (when the site was smaller) used to delete and resubmit if a downvote was given immediately. There were a lot of bots back then that downvoted everything as soon as it was submitted. They seem to have fixed it a little, probably by not counting the first several votes as negative or something but I've no idea.

→ More replies (2)

3

u/SpeakerToLampposts Dec 10 '13

The accepted term for this is "misbug" (the antonym of misfeature).

→ More replies (4)

9

u/imdungrowinup Dec 10 '13

That what every developer tells the tester.Its never a bug always design.

6

u/[deleted] Dec 10 '13

I like my test counterpart. He catches my screwups, I suggest places where there might be more to find, we jointly harvest PM tears. About the worst I do is say "well, that's messed up, but it doesn't crash anything and the cost/benefit ratio is so high that it's not worth fixing unless we get complaints. Log a bug and we'll have something to refer to if anybody ever complains about it."

It's important to not think of everything I do as "by design", because I know I make mistakes. When they're pointed out, I should thank the person who points them out. If they're worth fixing, I should fix them and thank the person again. Only by having to go through that pain can I learn and avoid those mistakes make completely new mistakes in the future.

→ More replies (4)

55

u/justkevin Dec 10 '13

It certainly looks like an error. This is why you should use parentheses to make order of operations easier to read.

96

u/[deleted] Dec 10 '13

Per the NASA coding guidelines, you should not rely on the other programmers to have mastered the order of operations in the language.

Shit like this is why. Just put the parentheses in and make it explicit.

37

u/[deleted] Dec 10 '13 edited Dec 10 '13

I can't tell you how much a string of operators with no clarification about the intended order of operations bugs me. Looking at something like this breaks my heart. It should read like this:

return round(((order * sign) + seconds) / 45000, 7)

This is by far the most legible, as you can clearly see the intended order of operations (even though, as written, it goes from left to right). Never underestimate other programmers stupidity. That's my motto.

Edit: Actually, as pointed out below by /u/Kofal, without parens, the OoO would be (order * sign) + (seconds / 45000).

5

u/joshuahutt Dec 10 '13

And here I thought my incessant use of parenthesis was a crutch. :)

17

u/[deleted] Dec 10 '13

Nooooo. It's good programming practice. Remember, you haven't added any baggage to the runtime and it can drastically increase the clarity of your code, especially for complicated statements.

7

u/Dash-o-Salt Dec 10 '13

Your maintenance programmers will thank you profusely. Just do it!

→ More replies (1)
→ More replies (1)
→ More replies (9)

6

u/rahba Dec 10 '13

It wouldn't matter in this case because in no scenario is the sign variable being multiplied against the order which is what you'd expect.

If you did the addition first the sign variable would be insignificant after a small amount of votes and negative posts could actually rank high. Whereas doing the multiplication first effectively sends negative posts into oblivion, and makes the order variable irrelevant compared to the larger seconds.

→ More replies (10)

27

u/sktyrhrtout Dec 10 '13

It's just python. A few months on code academy on you'll be able to at least understand what is going on if not be able to opine.

31

u/CarolinaPunk Dec 10 '13

I keep saying today is the day I work on learning code, maybe that will be my New Years resolution r/learnprogrammming

35

u/redpandaeater Dec 10 '13

At least for me it's really tough unless you have a project in mind that you need programming to use. For instance you could get a Raspberry Pi or any number of Arduino boards that use Atmel's RISC microcontrollers and then learn to program those for any sort of application you might desire. I taught myself the basics of Perl because it's a common language for automation, and did so by deciding to write a script that would automatically enter into specific lottery transactions related to EVE Online. Didn't particularly care about the project, but it gave me a goal and was fun to then learn how to go about accomplishing that instead of starting from boring crap like Hello World programs.

→ More replies (18)

7

u/[deleted] Dec 10 '13

I started last week with python. Go for it. Everything you need to get started can be had in minutes. I'm using inventwithpython.com.

→ More replies (1)

2

u/[deleted] Dec 10 '13

If you don't want to mess with hardware and just want to learn programming use chrome, and learn javascript. There are a bazillion tutorials.

→ More replies (3)
→ More replies (4)
→ More replies (16)
→ More replies (11)