C++ Advantages Topic is solved
-
- Experienced Solver
- Posts: 72
- Joined: Fri Feb 20, 2009 7:13 pm
- Location: $(#wx)\src
C++ Advantages
Why doesn't wxWidgets use the wx namespace? Or give the ability to use C++ exceptions?
-
- Super wx Problem Solver
- Posts: 401
- Joined: Wed Sep 21, 2005 8:17 am
- Location: Rostov-on-Don, Southern Russia
Re: C++ Advantages
I suppose cause all wxWidgets classes already have prefix "wx" before them names...computerquip wrote:Why doesn't wxWidgets use the wx namespace? Or give the ability to use C++ exceptions?
Win XP HE SP3, Vista
Xubuntu 12.04 LTS
wxWidgets-2.9.5
wxWidgets-3.0.0
Xubuntu 12.04 LTS
wxWidgets-2.9.5
wxWidgets-3.0.0
-
- Experienced Solver
- Posts: 72
- Joined: Fri Feb 20, 2009 7:13 pm
- Location: $(#wx)\src
-
- Experienced Solver
- Posts: 72
- Joined: Fri Feb 20, 2009 7:13 pm
- Location: $(#wx)\src
No! Why would I suggest something that did nothing but complicate. Namespaces aren't terribly complicated in concept anyways, plus they give a few minor advantages. One mainly being a distinct scope which gives the user a little bit more flexibility. For instance, he could use or Although, please remember this isn't the only subject that I brought up. Another topic was C++ exceptions. There are also a few advantageous abilities that exceptions provide, one mainly being clean-like error handling, and shortened, organized code. Just a few suggestions and asking about the obvious, not making a revolution here or anything...
On a side note: Exceptions take a toll in C++ whether you use them or not. There's really no definite reason why not to use them other than preference.
Another side note: These are simply small things that add miniscule differences. I can picture why small things like namespaces can be a huge leap though since any new versions of wxWidgets would have to be remade to relate to the new major change.
Code: Select all
wx::Frame bob;
Code: Select all
using wx::Frame; Frame bob;
On a side note: Exceptions take a toll in C++ whether you use them or not. There's really no definite reason why not to use them other than preference.
Another side note: These are simply small things that add miniscule differences. I can picture why small things like namespaces can be a huge leap though since any new versions of wxWidgets would have to be remade to relate to the new major change.
The main problem in 2.8 was that many of the support compilers did not support name-spaces and C++ exceptions. The wx Team dropped a few old compilers/versions. If all the supported compilers can do name spaces the wx team might support/use the patch to do name spaces; the patch would require a lot of work for very little short term gain, the long term might be a major gain.
Note: The patch would be needed against widgets trunk and would likely take a lot of effort to keep updating because it could be a few years before if might be applied to the trunk.
I would see if the wx develop team would want the patch before doing much work.
http://www.wxwidgets.org/support/maillst2.htm
wxWidget links; I an mainly a C programmer; so, I am not certain these links are useful.
http://wiki.wxwidgets.org/Namespaces
Tim S.
Note: The patch would be needed against widgets trunk and would likely take a lot of effort to keep updating because it could be a few years before if might be applied to the trunk.
I would see if the wx develop team would want the patch before doing much work.
http://www.wxwidgets.org/support/maillst2.htm
wxWidget links; I an mainly a C programmer; so, I am not certain these links are useful.
http://wiki.wxwidgets.org/Namespaces
Tim S.
Last edited by stahta01 on Sat Jul 10, 2010 11:38 pm, edited 1 time in total.