Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to next message
jonarmani is currently offline  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 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

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 Smile ) 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 Smile Thanks for your suggestion!

Best regards,
Honza
Re: Why do we have to manually add Core sub-packages? [message #36738 is a reply to message #36737] Fri, 29 June 2012 20:18 Go to previous messageGo to next message
jonarmani is currently offline  jonarmani
Messages: 6
Registered: May 2012
Location: Texas
Promising Member
I see, that makes sense. It is a matter of efficiency.

As far as seeing what you mentioned as a feature of TheIDE, I'm all for it. The purpose of computers/technology is to handle the manual labor for us humans, right? Smile

Thanks so much for your reply.
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 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
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 Smile ) 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 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

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 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
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 Go to previous messageGo to next message
lectus is currently offline  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:
// ** Package: Web **

in Web/Web.h.

So when you
#include <Web/Web.h>

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 #36804 is a reply to message #36803] Sat, 07 July 2012 08:50 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
lectus wrote on Fri, 06 July 2012 21:53

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:
// ** Package: Web **

in Web/Web.h.



Why? I guess it is enough if you find Web.h in Web package (with .upp file there).

Mirek
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 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Out of fun, I implemented the automatic package addition Smile 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 Smile

Honza
  • Attachment: ide.diff
    (Size: 3.00KB, Downloaded 224 times)
Re: Why do we have to manually add Core sub-packages? [message #43896 is a reply to message #36811] Sat, 15 November 2014 18:25 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
dolik.rce wrote on Sat, 07 July 2012 13:58
Out of fun, I implemented the automatic package addition Smile 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 Smile

Honza


Not sure how or why I have missed this one, but it is now accepted into the trunk - I have only simplified it a bit and also added Prompt confirmation.

Mirek
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 Go to previous message
Klugier is currently offline  Klugier
Messages: 1075
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

Previous Topic: Minimum required to debug
Next Topic: add library
Goto Forum:
  


Current Time: Thu Mar 28 16:23:48 CET 2024

Total time taken to generate the page: 0.01480 seconds