Click here to Skip to main content
15,867,686 members

Shao Voon Wong - Professional Profile



Summary

Follow on Twitter LinkedIn      Blog RSS
137,721
Author
5,369
Authority
5,386
Debator
1,804
Editor
147
Enquirer
1,916
Organiser
16,201
Participant
Shao Voon is from Singapore. His interest lies primarily in computer graphics, software optimization, concurrency, security, and Agile methodologies.

In recent years, he shifted focus to software safety research. His hobby is writing a free C++ DirectX photo slideshow application which can be viewed here.

  

Groups

Below is the list of groups in which the member is participating

The CodeProject Authors are a group of talented technical writers who create articles and whitepapers for some of the biggest companies in the industry. Under our ContentLab.io unit we reach out to those who need content written but lack the time, expertise or resources to complete the work.

Looking to earn a little extra and get connected to, and be featured on, the websites of the companies whose technologies you know and love? If you can write well and are efficient with time then send us an email at info@contentlab.io.
This is a Collaborative Group
This member has Member status in this group

90 members

Reputation

Weekly Data. Recent events may not appear immediately. For information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege. The member types column lists member types who gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilver
Bypass spam checks when posting contentsilversilversilversilversilversilvergoldSubEditor, Mentor, Protector, Editor
Store personal files in your account areaplatinumplatinumSubEditor, Editor
Have live hyperlinks in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Have the ability to include a biography in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Edit a Question in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Edit an Answer in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Delete a Question in Q&AYesSubEditor, Protector, Editor
Delete an Answer in Q&AYesSubEditor, Protector, Editor
Report an ArticlesilversilversilversilverSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubEditor, Mentor, Protector, Editor
Edit other members' articlesSubEditor, Protector, Editor
Create an article without requiring moderationplatinumSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending QuestionProtector
Approve/Disapprove a pending AnswerProtector
Report a forum messagesilversilverbronzeProtector, Editor
Approve/Disapprove a pending Forum MessageProtector
Have the ability to send direct emails to members in the forumsProtector
Create a new tagsilversilversilversilver
Modify a tagsilversilversilversilver

Actions with a green tick can be performed by this member.


 
General[coderant] Zero warnings : An ideal? Pin
Shao Voon Wong16-Mar-08 23:15
mvaShao Voon Wong16-Mar-08 23:15 
Some coding books advocate zero warnings at the highest warnings level setting. Is this possible? I think not. I have seen some people resolved “conversion from 'double' to 'float'” warning by doing a float cast. They could have solved this problem by using all floats or all doubles, however we do use libraries and we do not have control over these libraries, especially third party libraries. For example,

C++
float m_f;
m_f = (float *)a_double;


The problem is by doing a cast, you are silencing the compiler by saying, “yes I know it is wrong but I am very sure a_double's value will not exceed a float max value.” On closer examination of the class , it only has 2 float member variables and all the casting from double are to be assigned to these 2 member variables. So the more correct way to solve this problem is make these 2 variables to be double type. Anyway, converting 2 floats(32 bits type) into 2 doubles(64 bits type), you only increase the memory requirement by 8 bytes. It is also much simpler than adding all the castings which need to be there.

So the correct way of solving the “conversion from double to float”, “conversion from int to short” and “< : signed/unsigned mismatch” is to change the type of variable to match the other type. For example,

C++
// Wrong way
for( int i=0; i<(int)vec.size(); ++i ) {
....
}

// Correct way: size_t is the same unsigned type as vec.size() returns
for( size_t i=0; i<vec.size(); ++i ) {
....
}


If you use casting to resolve these type mismatch warning, you might as well use pragmas to silence the warnings, that is what pragmas are used for! When something has gone wrong and you cannot figure it out why, you can remove the pragmas and re-enable the warnings back. With casting, you can't!

Zero warnings to me, is an “hard to achieve” ideal because things are not always clear cut. I will always try my best to reduce warnings to the minimum, but I would rather leave some unresolvable warnings there, so that I know where to look if something goes wrong.

modified 3-May-17 2:10am.

GeneralRe: [coderant] Zero warnings : An ideal? Pin
Vasudevan Deepak Kumar17-Mar-08 0:36
Vasudevan Deepak Kumar17-Mar-08 0:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.