Print Page | Close Window

possible Improvement

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=369
Printed Date: 23 December 2024 at 7:57am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: possible Improvement
Posted By: redRyder
Subject: possible Improvement
Date Posted: 20 January 2004 at 5:11am

I dont know if anyone has noted that, but I find that in almost all the source code parameter passing can be improved a little bit, and the same goes for return types. For example, I find that almost all paramters of type CString or CRect are passed by value. Wouldn't it be nice to pass params as const references whereever applicable and possible, likewise const CString& return types can help improve code efficiency a bit.

Just my thought .. Has anyone ever noted that ? 

 




Replies:
Posted By: Cezariusz
Date Posted: 20 January 2004 at 5:31am

I didn't take note of this, but I agree with you. I'm always using const references if possible, especially for CString, because "const CString&" accepts LPCTSTR as well.

I would be however much more careful with returning const CString&, because it's safe only for class members.



-------------
mailto:cezariusz.marek@comarch.pl - Cezariusz Marek
http://www.comarch.com/ - http://www.comarch.com/



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net