Results 1 to 20 of 22

Thread: QtCreator automatic member declaration

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #16
    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
    No, I can't agree. The fact that there are no conflicts at an arbitrary point in time doesn't mean there won't be a moment later and this invalidates this technique.
    (cut)so your compilation fails and you spend lots of time looking in wrong places because you were lazy enough not to include a.h yourself in the first place.
    Wait, what are we talking about? The fact that automation may speed up my coding process OR the fact that an lazy/unaware user will fail in using the automation?
    The problem is not that automatic tools are bad, the problem is that choice is good. I (me, myself) would like to have an auto-include feature in QtCreator. You think that lazy/unexperienced users may fail in using it? Well, so just do as auto-declaration/definition: not making it "auto" but having a tool to do it with a right click

    Quote Originally Posted by wysota View Post
    Another simple example
    Thanks, there's no need for examples: as you, I can think a lot of cases in where automation will NOT aid unaware users. But this is the fact: unawareness is the problem, not automation.
    Automation is a double-edged weapon: it can be really useful if you know what you're doing.

    Being accustomed to Eclipse - which has such a feature - I would accept it gladly also in QtCreator. It's something that now I can use and appreciate like code completion: of course I could avoid using it, but it's faster, and I like to be fast in writing code.


    Quote Originally Posted by wysota View Post
    To me the algorithm that fits more to this situation is "if we can substitute knowledge with a button then let's get the button and don't learn at all (and fire the software developer)".
    Ahah nice But I don't think that it's the case. You know, Whitehead said "Civilization advances by extending the number of important operations which we can perform without thinking of them". This is why studying is more and more important in our society: because if the button exists is ok, but we must be sure to understand why the button is there and why we have to learn anyway.

    Quote Originally Posted by wysota View Post
    I think my IDE shouldn't try to be smarter than me. It should help me but not do my work for me without me even knowing. For me it is enough to have a keyboard shortcut that when pressed will insert an include statement according to some predefined pattern. I want to be concious about what my IDE is doing.
    Sorry, I don't think I've ever said "without even knowing". Au contraire, I said "asking the user". I don't see why asking a question and avoiding to write some words would be "too smart" or "too risky". On the other hand if you write an class twice in two includes, you may also fail without knowing. So, there are also cases in which an automatic control may help to include the right thing.

    Quote Originally Posted by wysota View Post
    You see the point is people forget about it even if they don't have this magic tool.
    I don't. This is what I call "automatic and tedious work" and I program the machines to do it for me. Everytime I include an header file - writing by hand - for a class that is not ambiguous, I think "in the time I'm wasting writing these headers I could solve bugs or add new features".

    Quote Originally Posted by wysota View Post
    The tool has to augment and not replace skills.
    This is a nice phrase, but did you thought it through? Do you have the skills (not knowledge) to do everything that an automatic tool is doing for you? Why do you use compilers? Why do you use C++ and not programming directly in hex in your computer? Maybe you do. But the fact is that for some jobs skills are simply not required anymore. That may be sad, but it's true. I bet you would be dead as me if civilization will fail tomorrow and we would go back to the stone age.

    Quote Originally Posted by wysota View Post
    According to the laws of logic if there is at least one case when a hypothesis fails then the whole hypothesis is invalid.
    Oh please, before talking about logic PLEASE read carefully what I said. I didn't said "your premises were false" or "the hypothesis didn't hold". I said "Knowing new things"... Feel free to use set theory to prove that I'm right (or wrong, if you can).

    Quote Originally Posted by wysota View Post
    And who defines that a piece of code is correct?
    Math is usually a valid reference for correctness of a problem. See lambda calculus.
    That code you wrote is right for b not equal to 0 and for non-overflowing integers. There is no problem with the code. The problem is assuming superficially that the code is correct for every value of a and b.
    It's like the fraction a/b, real numbers: it's perfectly legal and always defined on its domain. The error - often done - is thinking that a fraction is defined with denominator equal to zero.

    Quote Originally Posted by wysota View Post
    I would rephrase what you said as "if you write a piece of code you think is correct, it will work until you reach a situation for which your assumed correctness is no longer valid".
    Actually, when writing that, I wasn't thinking to Dijkstra, but to Hoare and Church.

    Quote Originally Posted by wysota View Post
    (someone might add a situation when b IS assigned 0 and your original "correct" code fails)
    Ehehe that's a nice case You couldn't say that MY code is not correct after someone else edited it.

    Anyway, the starting topic was: I would like QtCreator to have a feature to auto-include headers. I don't know how we come to this point, but my request is still valid, because I don't think that is such a feature that compromises the learning career of the next generation of programmers. I hate to write headers and Eclipse has been the only IDE that I really appreciated about this - but I understand that Java is a radically different environment so such a feature may be missing in QtCreator forever


    Added after 11 minutes:


    @SixDegrees, already done. Did you forget partial correctness?

    EDIT: Anyway, I think your reference to the Halting problem and Goedel was a bit too general. There is no need to talk about total and partial correctness when the reality is that we are mostly interested in trivial properties on the natural numbers. Of course, Rice's theorem says that non-trivial properties are not decidable, but we all know that even if they are very numerous, we are interested in a small subset of properties - and even those give us issues.
    Anyway, I think the validity of the Halting problem is mostly to be considered in the general case: you can prove the correctness of (for instance) a simple bubble sort. As I said (to wysota), formal methods for testing correctness do exists, for example lambda calculus or Hoare logic (which are the only one I know and used).
    Last edited by akiross; 12th April 2011 at 00:04.

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
  •  
Qt is a trademark of The Qt Company.