Click here to Skip to main content
15,908,445 members
Home / Discussions / Article Writing
   

Article Writing

 
GeneralRe: jpeg to bmp conversion and vice versa Pin
Chris Losinger29-Dec-00 6:03
professionalChris Losinger29-Dec-00 6:03 
Generalparam edit Pin
24-Dec-00 2:15
suss24-Dec-00 2:15 
Generalweb spider script wanted Pin
21-Dec-00 6:26
suss21-Dec-00 6:26 
QuestionHow does a good coder... code? Pin
20-Dec-00 12:08
suss20-Dec-00 12:08 
AnswerRe: How does a good coder... code? Pin
Igor Proskuriakov21-Dec-00 3:09
Igor Proskuriakov21-Dec-00 3:09 
AnswerRe: How does a good coder... code? Pin
Jim Howard21-Dec-00 4:05
Jim Howard21-Dec-00 4:05 
AnswerRe: How does a good coder... code? Pin
Erik Funkenbusch26-Dec-00 9:23
Erik Funkenbusch26-Dec-00 9:23 
AnswerRe: How does a good coder... code? Pin
17-Jan-01 10:08
suss17-Jan-01 10:08 
> Hungarian notation is almost universally hated by people with lots of experience

Make sure we do not confuse *experience* with *age*. Lots of the "older" crowd that I know, that were coding before the advent of (reverse) hungarian notation, or other common naming conventions, tend to not like it. The same goes for most of the Unix-heads that I know and have worked with. The ones that were "raised" on it, however, tend to like it.

Personally, I can speak from (bad) experience that nothing is worse than having to go through someone else's code who thinks that all variables should start with an "_", and then just have no naming convention whatsoever. Can you tell me anything about the following variables (besides their names)?

_Id
_RetValue
_StatusValue
_BookObject

What types are they? Pointers? Objects? Basic Types? Member Variables?

How about these?

m_iId
_dwRetValue
m_bStatusValue
_pBookObject

Even without knowing exactly what convention is in use, you know more about these identifiers than you did with the ones above. When dealing with smaller projects, it is not such a big deal. When dealing with megabytes of production-server-quality code, that little bit of knowledge can save LOTS of time (and money).

But I agree with the fact that using a naming convention does not make one a great coder. There are still people out there that may know all of the naming conventions, use them all the time, but still do stupid stuff like writing functions that take complex, or memory-intensive objects by value instead of by reference, or taking a _bstr_t as a parameter when a BSTR would do fine (and not require the allocation and deallocation of memory).

You have to learn the right thing to do, and then do it. Practice does not make perfect. Practice makes habit (age reference). *Perfect* practice makes perfect.

Good coders are concerned about both stability/robustness and speed. Good code is fast. Good code is robust. A few things (most) good coders do (by no means a complete list):

o Comment their code *well*
o *Always* initialize
o *Always* check any pointers before use
o *Always* check any return codes/values
o Never confuse NULL with NUL
o Know when to use a temporary (and when NOT to)
o Never use "catch( ... ) { /* Do Nothing */ }"
o Know how to read a crash-dump (or at least how to read the registers to know if you dereferenced a NULL, or had garbage data, etc.)
o If accepting a pointer to a buffer, accept the length of that buffer, too
o Do not use ::printf(...) when ::puts(...) will do (and similar)
o Do not take wrapper objects (or string objects) as parameters when the actual type (or a char/TCHAR pointer) will do (e.g., do not accept a _bstr_t when a BSTR will work)
o Do not use a dynamically-allocated string class when a stack-allocated buffer will do
o Always use the "length-specified" versions of string manipulation functions (like ::snprintf, ::strncat, etc.)
o Be aware of platform-specific (like the processor you are targeting) concerns/optimizations, alignment issues, etc., and code accordingly
o Know the "cost" of anything that you use (like STL container classes, COM, DCOM, etc.) and know how they do and do not work
o Use dynamic memory allocation only when necessary (esp. when doing multithreaded development and targeting a multiple-CPU system)

That is a good start...

-=- James.

GeneralWindow DLL to detect wm_message of an active window Pin
16-Dec-00 22:34
suss16-Dec-00 22:34 
GeneralResizing a dialog Pin
TSI15-Dec-00 19:02
TSI15-Dec-00 19:02 
GeneralRe: Resizing a dialog Pin
Michael Dunn15-Dec-00 19:08
sitebuilderMichael Dunn15-Dec-00 19:08 
GeneralRe: Resizing a dialog Pin
TSI16-Dec-00 8:14
TSI16-Dec-00 8:14 
GeneralGetting file info runtime Pin
14-Dec-00 2:30
suss14-Dec-00 2:30 
GeneralCustom font app Pin
Amit Dey12-Dec-00 10:32
Amit Dey12-Dec-00 10:32 
GeneralWeb folder view in WinExplorer Pin
8-Dec-00 3:37
suss8-Dec-00 3:37 
QuestionHow to change a console window's font? Pin
8-Dec-00 3:04
suss8-Dec-00 3:04 
Generalnews: protocol Pin
Sasa Kajic7-Dec-00 0:48
Sasa Kajic7-Dec-00 0:48 
GeneralRe: news: protocol Pin
Bjornar Henden7-Dec-00 1:32
Bjornar Henden7-Dec-00 1:32 
GeneralRe: news: protocol Pin
SAWilde7-Dec-00 22:46
SAWilde7-Dec-00 22:46 
GeneralRe: news: protocol Pin
Sasa Kajic8-Dec-00 2:59
Sasa Kajic8-Dec-00 2:59 
Generalnews: protocol Pin
Sasa Kajic7-Dec-00 0:47
Sasa Kajic7-Dec-00 0:47 
GeneralSending msg to Pager thru ASP Pin
6-Dec-00 4:26
suss6-Dec-00 4:26 
GeneralRe: Sending msg to Pager thru ASP Pin
SAWilde7-Dec-00 22:53
SAWilde7-Dec-00 22:53 
GeneralClipping Region of Child Window Controls Pin
Brian Rosenthal29-Nov-00 9:48
Brian Rosenthal29-Nov-00 9:48 
GeneralRe: Clipping Region of Child Window Controls Pin
Brian Rosenthal2-Dec-00 18:09
Brian Rosenthal2-Dec-00 18:09 

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.