Page 2 of 2 FirstFirst 12
Results 21 to 22 of 22

Thread: QtCreator automatic member declaration

  1. #21
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QtCreator automatic member declaration

    Quote Originally Posted by akiross View Post
    Well I can't guess the great wysota can do that : ) From what I can see on this forum, you can freely abandon Qt and start doing something else ([EDIT] Gee in a good sense! : D). But can other people do the same? I can't!
    Actually I was thinking about equipping my car with an onboard Qt-driven computer system

    I wouldn't bet on that... 90% will come and complain at the beginning, later on they would probably get how it works and, in future, they will be the ones - like me - that come to a forum asking if a certain feature exists.
    Nnnnnooo... Maybe 10% of those 90% would do that. Just browse the forum and see for yourself. Call me a pessimist but I'd rather call myself a realist.

    Mmmh actually I knew the Back/Forward, but I'm not really loving it. Probably I'm missing something about how it works or I'm just not used to it. Anyway, since you point this out, I'll give it a more deep try.
    It used to work better than what it does now but it's still useful. Especially together with F2.

    True, but afaik this results in bigger files to compile, slowing down the compilation process.
    If you add all the bits, the compilation is much faster. It can save up to ~80% of the compilation time (or maybe even more if your project is complex enough). The downside is you get a really huge file on your disk.

    someone told me that he could cut down the compiling time from hours to minutes just by working on include files.
    Using precompiled headers would have yielded a similar if not better effect.

    So, it's a good suggestion in my particular case, but generally speaking this is the kind of automation that may produce bad results if someone don't know what he's doing.
    I may be misunderstanding what you mean because the final binary code with precompiled headers is exactly the same as without them. This is an area where you can't really hurt yourself. Unless you do something insanely stupid, of course.

    I remember I did the SAME exact error when I started to learn C It's like 10 years now, but it's not only a matter of automation: I used to program with notepad and compile by hand, but the manual I was using just didn't mention what a "library" was.
    That's a different matter.

    I'm saying that, with evolution of C++, new approaches can be used.
    But you still have to support the legacy code.

    If your software crashes with negative wages, it is still correct, because I'm not asking you to handle negative values.
    That's your point of view. I see it that any software that crashes is a badly written software. And I don't agree with the rest of the paragraph you have written but I feel I'm not going to convince you so I won't even try.


    No sorry, I can't absolutely agree with that. If no requirements are set, multiple interpretations are legit.
    And in this moment you can say goodbye to formalism, models and asserting correctness of the code. The most you can do is say your code looks correct or works correctly for the input given. Nothing more. You certainly cannot say your code IS correct.

    Correctness is a function which must depend on requirements and specifications, if you don't provide them, you're not talking about correctness.
    This is why, I think, being a requirement engineer is so hard
    So if you're not talking about correctness please stop saying your code is correct. You can say "my code is." - I can certainly agree with that.

    Actually, in mathematics division is not defined with a denominator = 0, so it's perfectly legal to say "for any integer": talking about "division by 0" is a non-sense. The result simply doesn't exists, so specification is not required.
    A very strange approach to mathematics. You can't say that dividing two integers results in an integer if you can find such pair of integers that result of the operation is undefined. What you can say is that all results of integer divisions are integers. You can't say that diving any two integers results in an integer.

    This doesn't exclude, of course, the fact that you can instruct the computer with a nonsense (i.e. divide by 0) and it will fail.
    It's not a nonsense for a computer. It's perfectly viable to build a computer that will return a result for division by zero. Actually any computer does that, it just signals the special case with an exception.

    Your question is really funny, because you didn't provide me the interpretation of "correct".
    If we continue this path let's start with defining "me", "you", "computer" and the rest of the world. I'm sure you know what I mean by "correct" here.

    But since the alternative to crash is to produce a random value, or to hang forever calculating something that can't be calculated, I think program is correct.
    Crash or produce random value? Hmm... This should work:

    Qt Code:
    1. int main(int argc, char **argv){
    2. if(argc<2) return nan("int"); // or return a predefined value
    3. int b = atoi(argv[1]);
    4. if(b==0) return nan("int"); // or return a predefined value
    5. int a = 7;
    6. int x = a/b;
    7. return x;
    8. }
    To copy to clipboard, switch view to plain text mode 
    If you don't have a specification (explicit, but also implicit of course), you can't talk about "correctness"
    Ah, now we're getting somewhere. I think what you mean is "validation" or "verification" and not "correctness" - http://en.wikipedia.org/wiki/Validat...d_verification
    Correctness would be an absolute state while the other two terms would be determined against some specification.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #22
    Join Date
    Feb 2007
    Location
    Italy
    Posts
    69
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QtCreator automatic member declaration

    Quote Originally Posted by wysota View Post
    Actually I was thinking about equipping my car with an onboard Qt-driven computer system
    Cool! I vote for that

    Quote Originally Posted by wysota View Post
    Nnnnnooo... Maybe 10% of those 90% would do that. Just browse the forum and see for yourself. Call me a pessimist but I'd rather call myself a realist.
    Ok, I just assume that most users would complain if a new feature is added and/or removed. But if you say in this forum they don't, well ok: I'm sure you've better knowledge than me on this subject and related statistics.

    Quote Originally Posted by wysota View Post
    It used to work better than what it does now but it's still useful. Especially together with F2.
    Well I just LOVE F2! I'll try that.

    Quote Originally Posted by wysota View Post
    If you add all the bits, the compilation is much faster. It can save up to ~80% of the compilation time (or maybe even more if your project is complex enough). The downside is you get a really huge file on your disk.

    Using precompiled headers would have yielded a similar if not better effect.

    I may be misunderstanding what you mean because the final binary code with precompiled headers is exactly the same as without them. This is an area where you can't really hurt yourself. Unless you do something insanely stupid, of course.
    Well, honestly I didn't know (or just didn't remember) about pre-compiled headers (this is why, to me, including too much was a bad result and I think that such suggestion can produce bad results in compiling time). Now that I'm thinking of precompilation, I can assume the person I was talking to didn't knew either OR in that case he couldn't apply (OR he did, but I think he said that he had to cut headers and not using precompilation).

    Quote Originally Posted by wysota View Post
    That's a different matter.
    Not necessarily: one can be also not documented about the modular structure of Qt, and this is a totally different cause than IDE automation. When opening the QLocalSocket page I don't notice the fact that it's part of network module, I'm assuming that such class is part of the base Qt library, which I may have already liked not automatically. As example, I can say you that when I started used Qt I was using scons, totally avoiding qmake for building a project and I specified every time the library to include, but I initially had an issue about the library to include when using network classes. That is: ignorance can't be blamed only on automation.

    Quote Originally Posted by wysota View Post
    But you still have to support the legacy code.
    Of course you have, that's why I'm not talking about replacing functions but expanding them. This is natural for C++ in respect to C.

    Quote Originally Posted by wysota View Post
    That's your point of view. I see it that any software that crashes is a badly written software. And I don't agree with the rest of the paragraph you have written but I feel I'm not going to convince you so I won't even try.
    From this, it seems you're the kind of person who think that's right to define the division by 0 as infinity.

    Quote Originally Posted by wysota View Post
    And in this moment you can say goodbye to formalism, models and asserting correctness of the code. The most you can do is say your code looks correct or works correctly for the input given. Nothing more. You certainly cannot say your code IS correct.
    I can say the code do something and does always *that* something, so I can't assume that the code is wrong just because I don't agree with what it does. So it must be correct in a (way too general and often disliked) interpretation.

    Quote Originally Posted by wysota View Post
    So if you're not talking about correctness please stop saying your code is correct. You can say "my code is." - I can certainly agree with that.
    I still think it's correct, because it does exactly what it is meant to do, and because without a specification you can't say that is wrong. But if you don't want to call it correct, I can agree to use your terminology in this context. To me, the code is still valid.

    Quote Originally Posted by wysota View Post
    A very strange approach to mathematics. You can't say that dividing two integers results in an integer if you can find such pair of integers that result of the operation is undefined. What you can say is that all results of integer divisions are integers. You can't say that diving any two integers results in an integer.
    Of course we can define two different versions of "division among integers", but a general accepted definition in mathematic is:
    A divides B if exists Q and R such that B = A*Q+R with A, B, Q and R all integers, A non zero.
    So yes, I can say that a definition two integers results in an integer and it's not strange, given a specification that allows me to do that (and such a specification is even sensed and generally accepted). Btw, I think that's the definition used in C and C++.

    Quote Originally Posted by wysota View Post
    It's not a nonsense for a computer.
    I was talking about humans, as we usually are the governor of meaning. But yes, you're right, and that's why that a division by 0 is correct without specifying that a crash is not an option (at least, "correct" in the old interpretation we didn't agree before this post).

    Quote Originally Posted by wysota View Post
    If we continue this path let's start with defining "me", "you", "computer" and the rest of the world. I'm sure you know what I mean by "correct" here.
    No, I'm sorry, I really thought that correct was meaning a failure. And I'm the kind of person who usually like to define you, me, computer, division and correct, because, as you see, not agreeing on this can lead to misunderstandings.

    Quote Originally Posted by wysota View Post
    Ah, now we're getting somewhere. I think what you mean is "validation" or "verification" and not "correctness" - http://en.wikipedia.org/wiki/Validat...d_verification
    Correctness would be an absolute state while the other two terms would be determined against some specification.
    Sorry, until now I used two interpretations for "correctness": one as "does what specification says" and another as "doesn't disagree with the specifications". To me they are naturally equivalent and clear from the context, but I can understand that it's not an absolute interpretation. I don't think it's wrong to think this way, but of course these meanings can disagree with other interpretations (e.g. yours).
    I don't think that correctness is absolute as you can give an incomplete specification.

    Of course we're speculating here: it's obvious that I can understand what you say and I guess you do on what I say. It's only about conventions. I think that you can't reach "absoluteness" if you compare a program to a specification: if you do, the evaluation of correctness is relative to it's specification. Thus I think that "absolutely correct" means that programs do correctly what they describe with their code. "Absoluteness" is reached when no specification is present, but still the concept of correctness can be conceived.

    Anyway, I don't this that this debate won't bring us much further

Similar Threads

  1. QtCreator 2.0 crashes application working in QtCreator 1.3
    By been_1990 in forum Qt Programming
    Replies: 2
    Last Post: 21st September 2010, 12:58
  2. Replies: 22
    Last Post: 8th October 2008, 13:54
  3. static declaration
    By jhearon in forum Qt Programming
    Replies: 1
    Last Post: 18th February 2008, 21:37
  4. Declaration problems
    By scarvenger in forum Qt Programming
    Replies: 1
    Last Post: 7th May 2007, 02:05
  5. Declaration not working
    By kenny_isles in forum Newbie
    Replies: 1
    Last Post: 1st March 2007, 10:13

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.