New semester

Published January 25, 2006
Advertisement
I'm in the second week of the spring semester. I am taking an Embedded control class right now. We are using C cmpiled for the C8051 microprocessor. Our lab manuals examples of code are absoultely attrocious. It has a chapter introducing C. This is the first program:

#include  /* include file header*//* begin program here */main(){ /* begin code block here */    printf("Hello World!\n");        /*Output text to console */}       /* end code block


I realize the assumed "void" on main is legal in C, but isn't it still considered bad practice? Every comment in the code uses the multiline comment no matter how many lines. The manual specifically says not to use // comments because they can cause strange errors... I would think /**/ comments are worse, since many students will be tempted to nest them and such.

Anyway, the class still looks fun. We are writing code for a "smart car" to follow a white line, as well as a self-controlled blimp.

I haven't done much with the Scene graph engine lately. I keep thinking of new ways to implement it. I think I will just go for a nice easy, unoptimized approach and just try to finish it for now. If I have time, I can always clean it up and rewrite portions.

I did manage to fix the memory leak. It was aparently due to a bad copy/paste job on my part. I was actaullty making two copies of each texture thsat I loaded,but only deleting one of the pointers. It was an easy fix, just delete the offending line...
Previous Entry I hate pointers
0 likes 4 comments

Comments

noaktree
I agree. That code hurts my eyes!
January 25, 2006 03:13 PM
Nomad010
Your avatar shows that you are still recovering from the effects of New Year's.
January 25, 2006 03:44 PM
Jesse Chounard
If I recall my standards properly, single line comments (// comments) weren't legal in C until C99, which is why /**/ comments are the norm for C code.
January 25, 2006 03:53 PM
Sr_Guapo
Quote:
Your avatar shows that you are still recovering from the effects of New Year's.


Unfortunately I went home for the break and was stuck with my parents, so no new years fun for me...

Quote:If I recall my standards properly, single line comments (// comments) weren't legal in C until C99, which is why /**/ comments are the norm for C code.


Hm... I've never heard that before. I know that the single line comments work fine in the compiler we are using. The instructor has definately been doing this for a while though.
January 26, 2006 12:04 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

Work work work...

993 views

It lives...

913 views

Random thought

963 views

New semester

979 views

I hate pointers

1062 views

Back to work

901 views

Monday-like days

865 views
Advertisement