|
|
Home » Community » Newbie corner » Why do we have to manually add Core sub-packages?
Why do we have to manually add Core sub-packages? [message #36736] |
Fri, 29 June 2012 17:38  |
jonarmani
Messages: 6 Registered: May 2012 Location: Texas
|
Promising Member |
|
|
I have done the SMTP example here: http://www.ultimatepp.org/reference$SMTP$en-us.html
I couldn't compile it at first, then eventually figured out I need to add Core/SMTP to the list of packages in the upper left of TheIDE.
But Core was already listed, and my #include statement was to include Core/SMTP/SMTP.h. Shouldn't TheIDE have known where to look for the SMTP package? Why did I have to manually right-click Core, Add Package, and find Core/SMTP?
Thanks,
Jon
|
|
|
Re: Why do we have to manually add Core sub-packages? [message #36737 is a reply to message #36736] |
Fri, 29 June 2012 18:57   |
|
jonarmani wrote on Fri, 29 June 2012 17:38 | I have done the SMTP example here: http://www.ultimatepp.org/reference$SMTP$en-us.html
I couldn't compile it at first, then eventually figured out I need to add Core/SMTP to the list of packages in the upper left of TheIDE.
But Core was already listed, and my #include statement was to include Core/SMTP/SMTP.h. Shouldn't TheIDE have known where to look for the SMTP package? Why did I have to manually right-click Core, Add Package, and find Core/SMTP?
Thanks,
Jon
|
Hi Jon,
The SMTP package is optional part of Core. Most applications can be compiled without it, so there is no need to introduce the additional files that would only slow down the compilation. So that is why it is not added automatically when you add Core.
Now the more interesting part of your question: Why it is not done automatically... My best guess is that it is because it is not needed that often - just a couple times over the entire application development. But it is an interesting idea and it would be quite easy to implement. It actually makes sense - I always get bored when I have to wait for all the nests being scanned for packages (i have rather slow hdd ) when opening the Add package dialog, even though I new exactly what package I want to add and where it resides. Adding the packages automatically would make TheIDE even more efficient. Similarly, the packages could be automatically removed when the last relevant #include is removed from the code. That would be little trickier to implement, but still probably doable...
There are plans to do some major work on TheIDE in near future, so perhaps this feature might get in as well Thanks for your suggestion!
Best regards,
Honza
|
|
|
|
Re: Why do we have to manually add Core sub-packages? [message #36761 is a reply to message #36737] |
Tue, 03 July 2012 09:41   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
dolik.rce wrote on Fri, 29 June 2012 12:57 |
The SMTP package is optional part of Core. Most applications can be compiled without it, so there is no need to introduce the additional files that would only slow down the compilation. So that is why it is not added automatically when you add Core.
Now the more interesting part of your question: Why it is not done automatically... My best guess is that it is because it is not needed that often - just a couple times over the entire application development. But it is an interesting idea and it would be quite easy to implement. It actually makes sense - I always get bored when I have to wait for all the nests being scanned for packages (i have rather slow hdd ) when opening the Add package dialog, even though I new exactly what package I want to add and where it resides. Adding the packages automatically would make TheIDE even more efficient. Similarly, the packages could be automatically removed when the last relevant #include is removed from the code. That would be little trickier to implement, but still probably doable...
|
Actually, I was thinking about reversed process. All packages would just #include "uses", which would be generated by TheIDE. You would then just add package in TheIDE and you would not need to add the #include...
Anyway, perhaps it is too huge departure from how things are usually done, given how little often you are adding packages...
Mirek
|
|
|
Re: Why do we have to manually add Core sub-packages? [message #36765 is a reply to message #36761] |
Tue, 03 July 2012 10:47   |
|
mirek wrote on Tue, 03 July 2012 09:41 | Actually, I was thinking about reversed process. All packages would just #include "uses", which would be generated by TheIDE. You would then just add package in TheIDE and you would not need to add the #include...
Anyway, perhaps it is too huge departure from how things are usually done, given how little often you are adding packages...
Mirek
|
That would make U++ even more dependent on TheIDE, which is IMHO not good... (It is bad enough as it is now:) ) Also, it would probably lead to including much more headers then necessary - not a problem with BLITZ, but as soon as you turn it off, the compilation time would probably increase a lot. And third problem I see is that it would impose a requirement for some mandatory package structure, so that theide knows which headers should be included in "uses".
Honza
|
|
|
Re: Why do we have to manually add Core sub-packages? [message #36766 is a reply to message #36765] |
Tue, 03 July 2012 11:04   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
dolik.rce wrote on Tue, 03 July 2012 04:47 |
mirek wrote on Tue, 03 July 2012 09:41 | Actually, I was thinking about reversed process. All packages would just #include "uses", which would be generated by TheIDE. You would then just add package in TheIDE and you would not need to add the #include...
Anyway, perhaps it is too huge departure from how things are usually done, given how little often you are adding packages...
Mirek
|
That would make U++ even more dependent on TheIDE, which is IMHO not good... (It is bad enough as it is now:) )
|
Well, not really. "uses" (or "uses.h") would be a normal file in the package. Simply one source fail that is maintained by theide, but could be maintained by hand as easily..
Quote: |
Also, it would probably lead to including much more headers then necessary - not a problem with BLITZ, but as soon as you turn it off, the compilation time would probably increase a lot.
And third problem I see is that it would impose a requirement for some mandatory package structure, so that theide knows which headers should be included in "uses".
|
Well, it would require some naming standard, but we already have one (the name of main package header same as the name of package), so I would put only such existing headers to "uses".
Using "uses" would not be mandatory, and packages no following the standard could still be added by normal include...
Mirek
|
|
|
Re: Why do we have to manually add Core sub-packages? [message #36803 is a reply to message #36736] |
Sat, 07 July 2012 03:53   |
lectus
Messages: 329 Registered: September 2006 Location: Brazil
|
Senior Member |
|
|
How about add a comment to every header file indicating the package name using some kind of standard formating.
For example, first line would be:
in Web/Web.h.
So when you
then on the first build TheIde would add the package automatically by searching for the first line and extracting the package name.
This wouldn't break the possibility of using U++ in another Ide, because it would just be a comment that only the TheIde uses, and a comment is easily ignored by the compiler, so no overhead on compilation required.
Another cool feature would be to automatically add #include files by parsing the source code. Similar to what Netbeans does with Java. For example when finding String or Vector in code it adds #include <Core/Core.h>
But this would be a little be harder to implement.
[Updated on: Sat, 07 July 2012 03:56] Report message to a moderator
|
|
|
|
Re: Why do we have to manually add Core sub-packages? [message #36811 is a reply to message #36736] |
Sat, 07 July 2012 13:58   |
|
Out of fun, I implemented the automatic package addition The attached patch contains proof of concept solution, it might be possible to do it simpler, I'm not sure.
The idea is that if Assist is used to select #include file, it is checked if it comes from a U++ package and if this package is not present yet, it is added to the actual package. Can't be much simpler than that 
Honza
-
Attachment: ide.diff
(Size: 3.00KB, Downloaded 270 times)
|
|
|
|
Re: Why do we have to manually add Core sub-packages? [message #43898 is a reply to message #43896] |
Sat, 15 November 2014 20:42  |
 |
Klugier
Messages: 1099 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello Mirek,
Can we add option "Do not ask again" in prompt in use include recognition feature? Moreover it would be nice if it will also be coresponding menu entry to turn this prompt on/off for instant: "Use prompt in include recognition".
Sincerely,
Klugier
U++ - one framework to rule them all.
[Updated on: Sat, 15 November 2014 23:54] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat Apr 26 08:46:42 CEST 2025
Total time taken to generate the page: 0.01675 seconds
|
|
|