Home » Developing U++ » UppHub » SurfaceCtrl, 3D viewer of Multiple file format and Surface class (Visualise in 3D many 3D file format object and even all Surface object !)
Re: SurfaceCtrl, 3D viewer of Multiple file format and Surface class [message #54887 is a reply to message #54835] |
Thu, 24 September 2020 23:09 |
|
Klugier
Messages: 1083 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello Xemuth,
Quote:
I have read in a book about advanced C++ that compiler will remove all stuff about exception when compiling a function if it is marked as noexcept, so it optimize the code to run faster. May the result is not high enought to obstruct readability ?
This is the micro optimization and it influences the overall code readability. In this case I would suggest to remove all "noexcept". I do not imagine situation when programmers marks almost all of functions/methods with noexpect only for better performance. Please noticed that it was introduced in c++11 and I see massive noexcept for the first time
Let's read this article for more info.
"The standard's policy on noexcept is to only mark functions that cannot or must not fail, but not those that simply are specified not to throw exceptions. In other words, all functions that have a limited domain (pass the wrong arguments and you get undefined behavior) are not noexcept, even when they are not specified to throw.".
Quote:
What about header only file ? should I create A cpp file even if in my header only class there is somethings like 3 function which take more than one line ?
Yes this is good practice in cpp world to do not implement in header file. Even if you have one method that requires 3 lines of code it should be placed in .cpp file. For your code the cost of this change is small - all you need to do is just create corresponding .cpp file and include .h add implementation. That's all This practice is used in uppsrc. Only methods that maximally execute two commands are placed in header.
Please notice that if you modify header all files that includes that header needs to be recompile. If you change .cpp file compilers needs to recompile only that file. Let's imagine we have several methods implemented in Core.h then one change there will require recompilation of all application.
Quote:
I guess you are right but atm my code is full of comments so, to remove them I must need documentation but it take time. I will try to remove them in futurs update
You can make your code self documented - not need for documentation. However refactoring is required From my experience whenever you need to add new comment you could create method with the comment content. Simply, but powerful. If you are interested in this topic you could read Clean Code by Robert C. Martin.
Klugier
U++ - one framework to rule them all.
[Updated on: Thu, 24 September 2020 23:10] Report message to a moderator
|
|
|
|
|
SurfaceCtrl, 3D viewer of Multiple file format and Surface class
By: Xemuth on Tue, 15 September 2020 15:46
|
|
|
Re: SurfaceCtrl, 3D viewer of Multiple file format and Surface class
By: koldo on Tue, 15 September 2020 17:07
|
|
|
Re: SurfaceCtrl, 3D viewer of Multiple file format and Surface class
By: Xemuth on Fri, 18 September 2020 23:15
|
|
|
Re: SurfaceCtrl, 3D viewer of Multiple file format and Surface class
By: Didier on Fri, 18 September 2020 09:55
|
|
|
Re: SurfaceCtrl, 3D viewer of Multiple file format and Surface class
By: koldo on Fri, 18 September 2020 18:52
|
|
|
Re: SurfaceCtrl, 3D viewer of Multiple file format and Surface class
By: Didier on Sat, 19 September 2020 12:46
|
|
|
Re: SurfaceCtrl, 3D viewer of Multiple file format and Surface class
By: Xemuth on Fri, 18 September 2020 23:10
|
|
|
Re: SurfaceCtrl, 3D viewer of Multiple file format and Surface class
By: koldo on Fri, 18 September 2020 19:12
|
|
|
Re: SurfaceCtrl, 3D viewer of Multiple file format and Surface class
By: Xemuth on Fri, 18 September 2020 22:57
|
|
|
Re: SurfaceCtrl, 3D viewer of Multiple file format and Surface class
By: Klugier on Fri, 18 September 2020 23:17
|
|
|
Re: SurfaceCtrl, 3D viewer of Multiple file format and Surface class
By: Xemuth on Sat, 19 September 2020 03:37
|
|
|
Re: SurfaceCtrl, 3D viewer of Multiple file format and Surface class
By: Klugier on Sun, 20 September 2020 00:11
|
|
|
Re: SurfaceCtrl, 3D viewer of Multiple file format and Surface class
By: Xemuth on Sun, 20 September 2020 16:45
|
|
|
Re: SurfaceCtrl, 3D viewer of Multiple file format and Surface class
By: Klugier on Thu, 24 September 2020 23:09
|
|
|
Re: SurfaceCtrl, 3D viewer of Multiple file format and Surface class
By: mirek on Wed, 17 February 2021 17:57
|
Goto Forum:
Current Time: Sun Nov 03 17:44:28 CET 2024
Total time taken to generate the page: 0.02459 seconds
|