Thread: Newbie Syntax Question (Start of subroutine)

  1. #31
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by phantomotap View Post
    What?

    You can't be serious!?

    There isn't a font-size large enough.

    Are you being deliberately obtuse?

    Did you manage to find code online relevant to the discussion without actually reading it?

    Where did the code in your post even come from if you didn't write it?

    If you wrote it, how did you manage to so poorly understand your own code?

    Can you write code while blindfolded only with the blind covering your brain? Can you code while brainfolded?

    WTF! o_o

    You and you alone brought `QtAutoDeleter' into this discussion.

    The `QtAutoDeleter' does not delete anything. Ever.

    Code:
    QtAutoDeleter<T> s(this);
    This code implying that `QtAutoDeleter' deletes `this' is flawed.

    This code is infinitely worse than being ambiguous, confusing, unusual, or poorly documented; it self-documents as being completely unrelated to its actual purpose.

    How is this a "Good Thing™"?

    Code:
    auto edit = new QTextEdit(auto_deleter(this));
    This code does not create an object that deletes `this'.

    This code updates a list which deletes `edit'.

    How is the names `QtAutoDeleter' and `auto_deleter' causing me to think that `this' is going to be automatically deleted "Good Thing™"?
    No need to scare the cat so much.
    I looked at it from "I don't know what QtAutoDeleter does" perspective, nevermind that I wrote it.
    The reason I say it is good is that the line implies that it will delete this. This is not good and allows me to more easily catch it than without (who knows what the function you pass it is going to do with it?).
    If I were to use QtAutoDeleter, and the pointer wouldn't be deleted later, then that would be a bad thing, too, and being able to catch that would also be a good thing.
    Really, I just threw that name out there. It's not so much an informed decision or some carefully picked name or some such. It's just a casual name I picked so I could decorate the interface and say "we'll take care of deleting this, so you shoukdn't".

    O_o

    Code:
    auto edit = new QTextEdit(auto_deleter(this));
    Let me tell you something: `edit' is an undecorated pointer.

    Again: The changes to the code that you and you alone recommended decorates `this' not `edit'.

    Once more: the changes you suggested leaves the pointer to the object being registered for deletion a normal, simple, raw, dumb, undecorated, as vanilla as you please pointer.

    Seriously, you just skewed your own suggestion to such a perverse shape not even Cthulhu could make it out without its eyes watering.

    The beast that dwells in a non-euclidean space is looking at this thread scratching its head because you've just told us that the code that self-documents as doing something completely unrelated to its actual purpose is superior to the code that you find "insane" only because it isn't self-documenting.
    Is that what you're complaining about? That edit is undecorated?
    OK, so that was bad of me. I just copied that from the OP. In this case, I didn't pay any attention to edit, but instead to this.
    Let me give a better example to eliminate that, then:
    Code:
    auto edit = auto_deleter(new QTextEdit edit(blah));
    this->AddControl(edit);
    Instead of:
    Code:
    auto edit = new QTextEdit edit(blah);
    this->AddControl(edit);
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  2. #32
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    Is that what you're complaining about? That edit is undecorated?
    *gasp*

    And that, ladies and gentleman, puts Elysia in for the win.

    I'd give you a standing ovation for that bit of troll but I'm kind of fat and lazy.

    You'll just have to be satisfied with this 80's movie slow clap:

    *clap* *pause* *clap* *pause* *clap* *pause* *clap* *pause* *clap*

    ...and your examples aren't even valid.

    If I have my say, this is going on both "DailyWTF" and "Art of Trolling".

    Soma

  3. #33
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Then I don't see your point.
    But as you seem unwilling to explain the problem further... *shrug* I'll just let it be, then.
    But I will assure you that it wasn't trolling.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #34
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    Then:
    Quote Originally Posted by Elysia View Post
    I'm not saying it's wrong. I'm saying it's not self-documenting.
    A raw pointer could mean anything:
    Now:
    Quote Originally Posted by Elysia View Post
    Is that what you're complaining about? That edit is undecorated?
    OK, so that was bad of me.

    You originally made the complaint that the undecorated pointer was the problem. Now you say it isn't a problem, so what's your point? I'm left to conclude PEBKAC. I really have no other explanation, considering the information that you were provided in the thread.
    Last edited by whiteflags; 03-25-2013 at 09:05 PM.

  5. #35
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I apparently made the mistake of taking some code that contained two pointers while only decorating one of them (I completely forgot about the other one).
    That's why I made another example where I removed one of the pointers.
    So my point stands that undecorated pointers is bad.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #36
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    Well do you agree that a rationale has been presented for Qt as it is? If so, we're done.

  7. #37
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    But I will assure you that it wasn't trolling.
    O_o

    You are cordially invited to read the thread.

    You are hopefully either trolling with intent or trolling simply by responding while not having bothered to read anything that has been said.

    That you would have honestly said "The reason I say it is good is that the line implies that it will delete this." about a line that serves a completely unrelated purpose makes you a fool.

    I can't even read that quote without making special effort. I've read it dozens of times and I still subconsciously insert "not" between the "say it is" and "good is that". It is so bizarre that a bit of my brain is rebelling against it.

    I honestly, no joke, would rather that you have been trolling with intent.

    If you were trolling with intent, this was an epic waste of time.

    If you were trolling by simply not reading posts before responding, it was still amusing if only because I took you seriously.

    Otherwise, if you haven't been trolling, you just look incompetent and careless.

    [Edit]
    So my point stands that undecorated pointers is bad.
    See what I mean?

    You appear to think you are addressing some point that was argued in this thread by that comment, but you aren't making a point because no such argument exists, and you aren't addressing any argument that has been forwarded.

    Oh, don't get me wrong; I know you are sticking with that nonsense because you are stubborn, troll or no troll.

    I'd still would rather it a troll.
    [/Edit]

    [Edit]
    You know, I think I'm done with this now.

    I'm happy with this being a troll.

    I'm not going to wait around just to find out that it wasn't; I'd be miserable.
    [/Edit]

    Soma
    Last edited by phantomotap; 03-25-2013 at 09:35 PM.

  8. #38
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by whiteflags View Post
    Well do you agree that a rationale has been presented for Qt as it is? If so, we're done.
    Yes.

    Quote Originally Posted by phantomotap View Post
    That you would have honestly said "The reason I say it is good is that the line implies that it will delete this." about a line that serves a completely unrelated purpose makes you a fool.
    Fine.
    Implementations whose name implies something they will not do are bad.
    Implementations that try to delete a this pointer is probably bad code.
    All I said was that it was a good thing that it was easy to detect bad practice, such as code that tries to imply it wants to delete this, or tries to imply it wants to delete this but doesn't do any such thing.

    You appear to think you are addressing some point that was argued in this thread by that comment, but you aren't making a point because no such argument exists, and you aren't addressing any argument that has been forwarded.
    You know, either you back up your claims or you don't. I choose the later, however bad it might seem in your eyes. If I make an opinion public, then I am going to defend that I said it unless I am proven wrong. Then I will change my tone.
    Oh, but then you say you have proved me wrong but I'm stubborn and keep sticking with the same argument. But you know, the internet is a difficult thing. It may seem perfectly clear to you that I am dead wrong and you think that your reply will make me realize this. But I am not you. I cannot and do not always get your point--or others--when they make them. That's just life. Sometimes the point just does not get across. Sorry for not understanding your points all the time. I'm not perfect.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 12-17-2011, 06:15 PM
  2. newbie question: how to start ubuntu?
    By Yarin in forum Tech Board
    Replies: 11
    Last Post: 08-14-2008, 05:59 PM
  3. Compiler Syntax Error (Newbie Question)
    By NewCProgrammer in forum C Programming
    Replies: 8
    Last Post: 04-22-2008, 07:45 AM
  4. Replies: 3
    Last Post: 10-31-2006, 02:15 AM
  5. newbie wonders how to start c++
    By buraks78 in forum C++ Programming
    Replies: 3
    Last Post: 06-18-2003, 09:54 AM

Tags for this Thread