|
|
About
The things about which I feel the need to write...
The web-based journal of M. Forde, computer nerd and endurance athlete
contact
Sections
main
musings
running
DeLorean
code
unix
album
Archives
2011
2010
2009
2008
2007
Links
olix0r.net
netmeister.org
Giraffes
Been There, Run That
Eat. Run. Sleep.
|
|
|
It's not magic, it's C.
I love reading comments like
/* These defined magically in the linker script. */
I found that in the GNU Standard C Library implementation when GCC told me the
the variables to which the comment referred were undefined. I guess that linker
script isn't magic after all...
[/code]
[comment]
[permanent link]
C#, XNA, and 8 Queens
I spent some time this weekend learning some C# and getting working a
bit with the XNA framework. I implemented a solution for the 8 Queens
problem in C++, then ported that class to C#. After getting that working
in Windows, I started moving it to the Xbox.
It works there with little issue, but, as expected, writing to
system.console doesn't produce useful output. My next step is to get
some sort of graphical representation of the chessboard displayed with
the solution set.
[/code]
[comment]
[permanent link]
Self Documenting Code
Despite what you think about your code, it is not self documenting. When
writing code add comments, describe what a function does, explain why
you're using that convoluted pointer arithmetic and bit shifting. I'm
sure it makes sense now, but someday you'll have to go back and look at
it and figure out what the hell you were doing. Or worse, I'll
have to go back and look at it and figure out what the hell you were
doing.
Sometimes it is important to have some sort of separate documentation
for the code; maybe some UML or ER diagrams, maybe some English text.
Use what ever it takes to explain what you were doing. Do not paste
snippets of your code into the text and call it documentation.That
is not documentation, that is code.
[/code]
[comment]
[permanent link]
|
|