Hey /prog/,
If you were to program a BBS similiar to this and wanted to make it object-oriented how would you call the classes? I guess "Reply" would do for any post after the first post. Since you often call the first poster OP (Original Poster) would you call the first post "OriginalPost"? Some suggestions would be great since I'm really bad at making decisions.
The Meme "SICP" is so fucking outdated, give me an answer already or all of you just too stupid? For real, troll on /b/ or somewhere else, but why on /prog/? Really, I thought this was a dececnt please compared to the other boards, seems like I was wrong - stupid shitfucks.
Name:
Anonymous2009-04-10 10:52
>>1
Why you would need a different class for the first post and for replies? Why not just have one Post class? What behaviour would change?
Name:
Anonymous2009-04-10 10:56
>>7
Well, oke, take a look at the /x/ board source code for example. If you wanted to write a scraper for it you would have to do that in two classes because the HTML code for the first post is different than the replies.
Name:
Anonymous2009-04-10 10:57
>>1,6
Have you looked at the source code for the other BBS scripts? Shiichan (that powers dis.4chan.org), Kareha, ect. as examples?
Name:
Anonymous2009-04-10 11:11
class Post(object):
def __init__(self):
pass
class Reply(object):
def __init__(self):
pass
class Thread(object):
def __init__(self):
pass
class Board(object):
def __init__(self):
pass
This or class OrignalPost(object):
def __init__(self):
pass
I think it's obvious which class would be sub-classes of other ones, and this is assuming you are working with a language that allows inheritance (obvious OriginalPoster and Replier are derivations of Poster). It's not everything, but will give you a start.
>>8
But that would be part of the scraper logic, not the structure of the objects themselves. Please discard the mentality that it is necessary to have different classes to have differing behaviour; it is unscientific and ultimately destructive.
Maybe parseThread calls parseOP and parseReplyn, but what it returns should simply be a list of Posts, and maybe some thread metadata like title and thread ID.
Name:
Anonymous2009-04-10 11:52
>>16
So something like this would be better:? class Post(object):
def __init__(self, soup):
pass
>>20
Huh? What did you say? There was so much stupidity in your last sentence that I couldn't understand it. Please have a seat over there and explain it to me in detail.