Quote Originally Posted by akiross View Post
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
If using the tool requires a concious decision in each and every case then I have nothing against it and implementing it for simple cases is a trivial thing to do.


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.
I couldn't agree more. Unfortunately here we're dealing mostly with people who'd like to use Qt (and tools that go with it) to its full potential with a minimum effort on their side (the most common phrase on this forum is "I'm a newbie in Qt and C++") so I may be biased. On the other hand there are experienced people who suggest inexperienced people to use solutions they do not understand so I'm forseeing questions about code not compiling because of missing includes (of course without understanding that missing includes are the problem) and an answer such as "right click and choose 'insert missing include' from the menu". That's a straight road to encountering a situation when such an automatic include fails for some reason and the newbie ending up here or elsewhere saying "my program doesn't work" (and no details).

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:
Unfortunately what we observe in practise is quite the opposite - people on average are becomming dumber and dumber because they can't do simple things without help from a machine that does it for them. Of course there is an elite who can do all that and they drive the civilization forwards but we're rarely dealing with "elite" in everyday life.

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.
First one has to learn that if the button exists and all one does is push the button then one is obsolete as we can automate button-pushing as well. Still many people fail to see that yet they call themselves "professionals" ("I'm a pro button-pusher? Hmm.... naaa.... I'm a pro software developer!").


Sorry, I don't think I've ever said "without even knowing". Au contraire, I said "asking the user".
Point taken. As I already said, asking the user is ok.

I don't. This is what I call "automatic and tedious work" and I program the machines to do it for me.
That's fine with me but there are more people than just you. If you provide a general mechanism you have to be aware that the general population will be using it and most of it will not be part of the "elite" I mentioned earlier. Sometimes it is best to learn by your own mistakes. If you have a tool that corrects mistakes for you all the time then you will never understand what you are doing wrong. If you do understand then such automation is fine. This is an educational aspect vs engineering aspect. Once you are a qualified engineer, automation helps. But earlier it prevents you from becoming a qualified engineer.

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".
Then you are either a very lousy typer or an excellent bug chaser.

This is a nice phrase, but did you thought it through?
Yes, I did.
Do you have the skills (not knowledge) to do everything that an automatic tool is doing for you?
When it comes to programming? Probably yes.
Why do you use compilers?
I see where you're going but that's a blind path I'm using a compiler because I'm using a language that requires compiling. It doesn't mean I wouldn't be able to repeat what the compiler does if I had to, provided I had time to do it. I understand how computers work, how programs are executed, why they fail and how to fix it. I'm using Qt Designer not because I lack the skills to implement a class manually but because the time required to do it is much shorter (and you can't compare it to bug chasing and adding an include statement). When placing a widget on a form I'm aware of exact C++ statements my actions cause. Unfortunately many people simply can't do something in code and they rely on Designer (Creator, button, whatever) to do it for them. That's what I mean by augmentation vs replacement.

Why do you use C++ and not programming directly in hex in your computer?
Yeah, that's a blind path. I use C++ but I understand that it is then translated to binary and how it is executed.

But the fact is that for some jobs skills are simply not required anymore. That may be sad, but it's true.
I don't agree. You may not posses the manual skills but you should know the skills are there. If you have a car, you should know that it has an engine and how (more or less) it works. If your car stops in the middle of nowhere you will either be able to check basic things (such as if there is gas in the tank) or be stranded until help arrives. Sure you can consider this knowledge obsolete and just wait for assistance but then I won't consider you a person that "knows much about cars".

I bet you would be dead as me if civilization will fail tomorrow and we would go back to the stone age.
I would be terribly bored but probably not so much dead, at least not that quickly. I may fail to implement my knowledge but then my knowledge may help me find someone who can.

Math is usually a valid reference for correctness of a problem.
But you need a formal math model of the problem which is not a trivial thing to obtain. I doubt you make formal models of each piece of code you write.


That code you wrote is right for b not equal to 0 and for non-overflowing integers. There is no problem with the code.
Sure there is a problem with the code. You have some constraints you do not check. You are implicitly assuming (hoping?) they will hold. The fact that code "works" doesn't mean it is "correct". The fact that the code is correct in some conditions doesn't mean it is correct in general so if you do not enforce the conditions you can't say the code is correct. If your program fails to check the conditions prior to doing some operation then it is buggy, incorrect.

Ehehe that's a nice case You couldn't say that MY code is not correct after someone else edited it.
The fact that you cannot prove incorrectness of a theory doesn't validate the theory (and your code uses "b" and does not "create" it so no change of your code is required to make it fail). It works the other way round. You can't say your drug is effective if you only give it to healthy people and see they don't show symptoms of the disease. And your drug doesn't become ineffective when you give it to someone ill and it doesn't work (or kills the poor guy). It has always been ineffective, there was just no proof of that.

Anyway, the starting topic was: I would like QtCreator to have a feature to auto-include headers.
When you're done implementing it, let us know where we can download the plugin from, I'm sure many people will benefit from it.