Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

6
[ELI5] When and why would you "mock", "stub", "dupe" or "shard" in OOP (crosspost from /r/coding)
Post Body

Intermediate Rubyist here who's been mostly making simple postgres/mongo-backed Rails apps for the past 2-3 years. I started at the very front end of web dev and have been learning my way down the stack.

Here's my question. In 3 years of web development, I have never had mock, dupe(dup),** shard, or **stub anything. I have read through the documentation and have a basic understanding of what each of these terms means, what I don't know is why or when you would do them?

For example how does making dupe of an object help you? When and why would you shard a db (and what does this really mean, that the db table gets broken into smaller, easier-to-search chunks?). Why would I make a stub or a mock?

I guess this more of a best practices and methadologies in OOP question, but I want to make sure that I'm using all the tools available.

tl;dr: Why & where would you mock or dupe an object, shard a db, or stub a method?

Author
Account Strength
90%
Account Age
13 years
Verified Email
Yes
Verified Flair
No
Total Karma
1,050
Link Karma
195
Comment Karma
855
Profile updated: 3 days ago
Posts updated: 7 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
12 years ago