//////////////////////////////////////////////////////////////////////////////////
//
// This class defines the processing and registration for the console DATE command
//
//////////////////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------------------
// Needed for Interface
//--------------------------------------------------------------------------------
#include "Common.h"
#include "Messageid.h"
#include "PluggableFactory.h"
//--------------------------------------------------------------------------------
// Interface
//--------------------------------------------------------------------------------
#include "Date.h"
//--------------------------------------------------------------------------------
// Needed for Implementation
//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
// Static Declarations
//--------------------------------------------------------------------------------
const LocalMakerType LocalMakerType:<img src="tongue.gif" width=15 height=15 align=middle>reMainStart;
//////////////////////////////////////////////////////////////////////////////////
// Module Scope Variables
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
// Internal Functions
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
// Class Member Functions
//////////////////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------------------
// This function is called when the DATE command is recognised.
//--------------------------------------------------------------------------------
void DATE_Handler:<img src="tongue.gif" width=15 height=15 align=middle>rocessData(ByteArray *Message)
{
//Output Date to console
delete(Message);
}
Well written code
I''ve been trying to develop a nice neat coding style. I''m reading code complete which does go most of the way towards things like indentation, whitespace commenting etc. What I''m looking for is maybe some nice example of real world code that has been well written. Right now I''m looking for well structured code within files more than clear and concise actual code. Things I still haven''t locked down are :
-Some nice structure for sectioning a file.
-Detail to which introduction block code normally goes to.
etc
Here is an example of a small class I''m developing to perfect layout (It will be real code eventially but currently has no guts
Chris Brodie
My opinion is that as long as everything is commented and clear and easy to follow read, it is good coding.
Get a couple of fellow programmers to read through some of your code, and if they have no troubles doing so... well there you go.
Some work environments have coding policies and such, but for your own work, clear concise and well commented.
Dont be like me and put off commenting hehe, its a bitch to do later >:}
Cel
Get a couple of fellow programmers to read through some of your code, and if they have no troubles doing so... well there you go.
Some work environments have coding policies and such, but for your own work, clear concise and well commented.
Dont be like me and put off commenting hehe, its a bitch to do later >:}
Cel
Cel aka Razehttp://chopper2k.qgl.org
btw AUSSIE, AUSSIE, AUSSIE, OY, OY, OY!
Cel
Cel
Cel aka Razehttp://chopper2k.qgl.org
It''s nicer then my commenting style.
Very easy to follow.
Very easy to follow.
------------------------------------------------------------I wrote the best video game ever, then I woke up...
just an interesting side note
I learned asm for graphics calculators before I ever learned C++ (or any other language on a PC for that matter) and the really weird thing about it was, I find assembly language easier to read than most C++!!!! I don''t know why, maybe it''s all the nicely aligned rows, but it really is easier for me to read(though I don''t know x86 asm, so it might not apply there at all)
It''s really somewhat odd. Also, I found that assembly code was generally much more elegantly written than C code. I should mention that most of my experience with reading code is from TOTWGPG, and the black art of 3d game programming, so maybe it''s just lamothe''s style, I dunno, whatever
personally, I find all those // marks very distracting
I prefer lines of code that are very short, so I can get the gist
just moving down the lines of code, w/o going from side to side
incidentally, I just ordered code complete, it should be here tomorrow, hurray
-arsenius
'after three days without programming, life becomes meaningless' -The Tao of Programming
I learned asm for graphics calculators before I ever learned C++ (or any other language on a PC for that matter) and the really weird thing about it was, I find assembly language easier to read than most C++!!!! I don''t know why, maybe it''s all the nicely aligned rows, but it really is easier for me to read(though I don''t know x86 asm, so it might not apply there at all)
It''s really somewhat odd. Also, I found that assembly code was generally much more elegantly written than C code. I should mention that most of my experience with reading code is from TOTWGPG, and the black art of 3d game programming, so maybe it''s just lamothe''s style, I dunno, whatever
personally, I find all those // marks very distracting
I prefer lines of code that are very short, so I can get the gist
just moving down the lines of code, w/o going from side to side
incidentally, I just ordered code complete, it should be here tomorrow, hurray
-arsenius
'after three days without programming, life becomes meaningless' -The Tao of Programming
I agree that all those //////////////''s take your eyes off of the code. Comments should supplement, not distract from, the actual code.
Also, I''m seeing some HTML in there, maybe you could edit the message to correct that?
"If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music he hears, however measured or far away" --Henry David Thoreau
Also, I''m seeing some HTML in there, maybe you could edit the message to correct that?
"If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music he hears, however measured or far away" --Henry David Thoreau
"If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music he hears, however measured or far away"--Henry David Thoreau
Lose the bottom row of //////
and maybe the --- too
I never use underscores
I indent my braces to they line up with the code they go with
and I thought you coded in C++?
and maybe the --- too
I never use underscores
I indent my braces to they line up with the code they go with
and I thought you coded in C++?
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
September 26, 2000 08:42 PM
READ "CODE COMPLETE" It''s great, and will help you in understanding how messy YOUR style really is.
September 27, 2000 04:43 AM
Hi,
I have made the experience that people who comment
nearly every line aren''t very good programmers.
They work three days to get a completely commented
Qicksort function, but when it comes to complicated
code, they don''t know how to do it.
Comments are important, but comments should be where
the code is hard to understand, and not in every line.
Who needs comments like "This function is called when
the date command is recognised" ? The function is called
date_Handler, that''s enough.
Well, that''s just my opinion.
bye,
Jochen
I have made the experience that people who comment
nearly every line aren''t very good programmers.
They work three days to get a completely commented
Qicksort function, but when it comes to complicated
code, they don''t know how to do it.
Comments are important, but comments should be where
the code is hard to understand, and not in every line.
Who needs comments like "This function is called when
the date command is recognised" ? The function is called
date_Handler, that''s enough.
Well, that''s just my opinion.
bye,
Jochen
I''m having problems right now with the Code Complete book, the pages are falling apart! - I really hate it! I still have the receipt and it''s not 30 days past yet, but I don''t know if they still going to allow to exchange because of the condition. I want to ask if you guys also have that kind of problem and how did you fix the problem. I don''t have any problems with the book''s contents, in fact, it kicks ass. A must read book.
About the comments thing, eliminate the //////////s around your comments.
-Thanks
About the comments thing, eliminate the //////////s around your comments.
-Thanks
Forget about that buggy code, let's start all-over - from scratch. Let's go!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement