Click here to Skip to main content
15,886,963 members

James R. Twine - Professional Profile



Summary

    Blog RSS
17,356
Author
6,365
Authority
4,463
Debator
5
Editor
26
Enquirer
135
Organiser
2,265
Participant
Programming since the age of 10, started professionally at the age of 17. Currently involved in both Client and Server side development on Win32 platforms for MC/HA/FT financial applications. Development experience with Win32, Win16, Linux and other flavors of Unix.

Extensive multithreaded development experience on Windows platforms using the Win32 SDK, and MFC.

Experience with HA/FT n-tiered Client/Server systems as well as GUI apps of varying complexity. Some experience with Game developement.

Having learned that the stuff you can barely get away with doing Client-side apps just does not cut it in the real "Server World", I am amazed how many 'professionals' cannot tell the difference between "works" and "correct" or try to (mis)use VB and/or MFC on server-side development projects, never considering that just because it RUNS, does not mean it runs WELL.

Lastly, I am also a collector of arcade games, and can perform repairs, conversions, etc. Search for my name, you will find me on lots of arcade-related documents and sites.

Sites of interest(?):
http://www.jrtwine.com
http://www.jrtwine.com/jtwine
http://www.signingtime.com
http://www.deletefxpfiles.com
http://www.checkfavorites.com
http://www.coinop.org
31 Dec 2007 CodeProject MVP 2008

Groups

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

United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.
This is a Collaborative Group
This member has Member status in this group

41 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.


 
GeneralIncorrect Beliefs/Thoughts/Opinions Regarding Optimization Pin
James R. Twine22-Oct-07 4:48
James R. Twine22-Oct-07 4:48 
GeneralOptimization is not your enemy [modified] Pin
James R. Twine21-Sep-06 3:37
James R. Twine21-Sep-06 3:37 
AnswerPointless Code Examples Pin
James R. Twine21-Mar-06 6:12
James R. Twine21-Mar-06 6:12 
   This post will keep a collection of code snippets derived from actual code that do things for no good reason... Unless, of course, the developer was intentionally trying to create a performance hit.

<code>// #1</code>
LPCTSTR cpMessage = _T( "This is the message." );
LPCTSTR cpCap = _T( "This is the caption" );
CString sMessage( cpMessage );
CString sCap( cpCap );
 
::MessageBox( sMessage, sCap, ( MB_ICONINFORMATION | MB_OK ) );
   So, what is wrong with this code?  This code demonstrates a classic abuse of dynamically allocated memory by way of CString misuse.  CStrings are handy objects, but the only reason you should ever create (or require, see #2 below) a wrapper object, especially one that dynamically allocates resources, is if you take advantage of the functionality of the object.

   In this case, there is nothing CString-specific that is being done here, so the CString object is being wasted.  Additionally, since it takes more time to manage dynamically allocated memory required for the CString, it causes a waste of time for no reason.  Lastly, if this is used in an multi-threaded application, depending on where code like this is being used, it can cause contention between multiple threads that need to access the shared heap.  (Which once caused an obvious performance problem in an application I had to correct that was using multiple CStrings in more than 80 ON_COMMAND_UPDATE_UI functions!)
<code>// #2</code>
void CSomeClass::SetStatusText( CString sStatus )
{
    m_scTheStatusCtrl.SetWindowText( sStatus );  // This Is Caling CWnd::SetWindowText(...)
    return;
}
   So, what is wrong with this code?  Basically the same thing as above.  This code is especially nasty because you have now taken a bad code decision, and moved it to the design level.  Not only are you using a CString for no good reason, but now you are requiring the caller of your code to satisfy the requirements of your poorly-designed function (changing to a reference does not help here at all).

   A good rule of thumb: always use the "simplest" type required.  If you can use a HWND, do not require a CWnd; if you can use LPCTSTR, do not require a const CString&.

   If you really do need a higher-level (wrapper) object, you can always manage one inside of the function's code.  You could also create two versions of the functions, one that takes a simpler type and one that takes the higher-level one.  This is often better than just creating one version of the function that requires the higher-level type because you may be able to optimize the otherwise temporary higher-level object (static variable, member variable of containing class, etc.)

   Got a real, valid reason why nothing is wrong with any of the above examples, I would love to hear about it!  N.B. the "Java argument" about how the performance difference is negligible on modern hardware is not a valid argument - it is inappropriate to make assumptions about the hardware being used.  Besides, that argument acknowledges the difference in performance, which is what this is all about, anyway.

   Peace!

-=- James
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
DeleteFXPFiles & CheckFavorites
Please rate this post appropriately!
QuestionC-Hash, C-Pound, C-WHAT? Pin
James R. Twine9-May-05 0:53
James R. Twine9-May-05 0:53 
GeneralRe: C-Hash, C-Pound, C-WHAT? Pin
Duncan Edwards Jones27-Oct-05 2:42
professionalDuncan Edwards Jones27-Oct-05 2:42 
GeneralRe: C-Hash, C-Pound, C-WHAT? Pin
James R. Twine31-Oct-05 14:32
James R. Twine31-Oct-05 14:32 
GeneralRe: C-Hash, C-Pound, C-WHAT? Pin
Jeremy Falcon20-Mar-06 8:01
professionalJeremy Falcon20-Mar-06 8:01 
JokeRe: C-Hash, C-Pound, C-WHAT? Pin
James R. Twine20-Mar-06 14:11
James R. Twine20-Mar-06 14:11 
AnswerNUL is not NULL...! [modified] Pin
James R. Twine24-Jan-05 4:24
James R. Twine24-Jan-05 4:24 
QuestionRe: NUL is not NULL...! Pin
Rajesh R Subramanian30-Jan-08 7:32
professionalRajesh R Subramanian30-Jan-08 7:32 
GeneralWhadda Think...? [modified] Pin
James R. Twine8-Mar-04 10:23
James R. Twine8-Mar-04 10:23 
GeneralRe: Whadda Think...? Pin
Eytukan28-Feb-07 6:20
Eytukan28-Feb-07 6:20 
GeneralRe: Whadda Think...? Pin
James R. Twine28-Feb-07 17:12
James R. Twine28-Feb-07 17:12 
GeneralRe: Whadda Think...? Pin
Eytukan1-Mar-07 4:15
Eytukan1-Mar-07 4:15 
GeneralRe: Whadda Think...? Pin
James R. Twine2-Mar-07 2:30
James R. Twine2-Mar-07 2:30 
GeneralRe: Whadda Think...? Pin
Eytukan4-Mar-07 15:50
Eytukan4-Mar-07 15:50 
GeneralRe: Whadda Think...? Pin
Rajesh R Subramanian30-Jan-08 7:28
professionalRajesh R Subramanian30-Jan-08 7:28 

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.