I am impressed by this forum

Pages: 12
I just signed on, but noticed a question posted to the Beginners forum. It was a very, very "beginner" question, and was answered very quickly and clearly with no snark. This is a sign of a good community, and very encouraging to me as I find things to ask about.
It's when people post beginner questions in the General or Lounge forums that you start getting snark.
We have a snark that lives under our porch. We tried calling an exterminator but he just gave us more snark.
It's a dirty job, but someone has do to it.

If you're interested I can also give you my paypal mail so you can "freely" donate your monthly incomings to me :'D

j/k

Thanks at least for posting this in the right section ^^
L B what happens if you get bitten by a snark?
When someone asks me to outrightly complete a homework assignment I turn into a snark. I'm a Weresnark, you see.
I've actually been snarking out since I was seven. I hold the record at 13,424 successful snarkouts.
I would like to see a library of snarky replies, we could learn to understand what makes the snark snark.
1
2
3
4
5
6
7
8
class Snark
{
public:
    Snark(std::string s):snark(s){};
    void SnarkyReply(){std::cout<<snark;}
private:
    std::string snark;
};

There you go devon, just compile that into a lib.
Did...did you seriously just write "class [...] { public:" ? DID YOU SERIOUSLY?
closed account (S6k9GNh0)
... It's very common.
... It's very annoying.
Stop being so snarky L B.
Why? What's wrong with that?
closed account (o1vk4iN6)
Did...did you seriously just write "class [...] { public:" ? DID YOU SERIOUSLY?


Could say the same thing about:

1
2
3
class [...] : public ..., public ..., public ...
{
};


That doesn't mean you should use struct or change the order you write your code in simply to avoid a redundant 7 keystrokes / a line of code.

I only ever use struct for POD or anonymous structures. It makes more sense to have the public members first, it doesn't matter to the implementer but to someone reading the code as a user generally they won't be looking at the private section.
closed account (S6k9GNh0)
This was one thing I did enjoy about D. While not actually having a very well-endowed standard, they removed the need for redundant keywords. Struct and class mean two different things in D and are treated differently (outside of just semantics and permissions).
closed account (o1vk4iN6)
Yah it is too bad C++ didn't make that distinction I almost never implement virtual functions (and other features) in a struct and it's obviously impossible to do so in C.
Last edited on
It's not impossible, just not easy.
I always use the struct keyword for classes in C++, just because I like proving that it's valid. The only time I use the class keyword is when I am making an example for e.g. a beginner who probably thinks that a struct is for POD and a class is for OOP. Plus struct definitions look prettier and less redundant on average, though that's just my personal opinion.

I would actually like to know, however, why some people put multiple consecutive access specifiers, like why people will put "public:", then some functions, then another "public:", and some more functions. Does this actually do anything? Is it some convention? I'd like to know because it seems odd.
Last edited on
I used to do it because I wanted to split up code and data. I'd put private data at the top, private methods next, then public data and then public methods last.
Pages: 12