Javadoc is AWESOME! Pure and simple. If used correctly Just look at the Java API to see what type of comments you should use. It's schmexy!
And alphager: i++ does what now?!
Just kidding, and fair point. I shall make a trade. LOTS of USEFUL comments! No need to comment every line of code (though we've been taught to write at least 1 line of comments for every line of code - yeah right...), but 3-4 lines of comments (even in one block) for every 10ish lines of code is usually a good rule... Especially if it's complex stuff. 20 lines of array manipulation can easily be commented with "Manipulating the array to do BLAH".
Programming Books
For C#, I'd recommend Beginning Visual C# 2005 by Wrox or Professional C# 2005 by Wrox depending on your programming proficiency.
I'd have to agree with elDiablo about comments. I think javadoc definitely has its purposes. However, C#'s autodoc (not sure if VB uses it) is even more useful because it incorporates your comments into Intellisense. I also think too many comments can clutter your code and be distracting. Comments should be concise and useful. I think saying that "i++" increments in a comment is stating the obvious and it draws attention to an unimportant piece of code. However, I won't go so far as to say my preference is universal.
wwarnick
I'd have to agree with elDiablo about comments. I think javadoc definitely has its purposes. However, C#'s autodoc (not sure if VB uses it) is even more useful because it incorporates your comments into Intellisense. I also think too many comments can clutter your code and be distracting. Comments should be concise and useful. I think saying that "i++" increments in a comment is stating the obvious and it draws attention to an unimportant piece of code. However, I won't go so far as to say my preference is universal.
wwarnick
Recently, I was amused to find the following comment in a friend's assembly code:
Code: Select all
inc a # inc a
elDiablo is right about the Java API being a good basis of how you should document code, although it's a massive headache I find to do it. Also it doesn't tell you what individual bits of code are doing. At the moment a lot of my comments consist of '//fix this when I hate the world less' or comments telling my course tutor not to bitch because I know something's inefficient or just plain stupid. But yeah commenting so you understand what the hell it does is useful. Also thanks guys for all the books I'll make sure to check some of em out.
All I want is a warm bed and a kind word and unlimited power. - Ashleigh Brilliant
- NeoThermic
- Introversion Staff
- Posts: 6256
- Joined: Sat Mar 02, 2002 10:55 am
- Location: ::1
- Contact:
Montyphy wrote:Recently, I was amused to find the following comment in a friend's assembly code:Code: Select all
inc a # inc a
If it was difficult to write, it should be difficult to read!
NeoThermic
-
- level5
- Posts: 11553
- Joined: Wed Jul 10, 2002 7:44 pm
- Location: Nashville, TN
- Contact:
Montyphy wrote:Recently, I was amused to find the following comment in a friend's assembly code:Code: Select all
inc a # inc a
Assembly code is the only place I think line by line comments are proper. When I used to write assembly stuff I would comment every line and when I went back I would ignore the code and just read the comments, so a comment like the above often appeared in my code just to keep the comments complete.
- tabasco boy
- level5
- Posts: 1180
- Joined: Sun Mar 10, 2002 4:25 pm
- Location: Lovely Planet Earth
- Contact:
NeoThermic wrote:I would wager there isn't a single person who touched the DevDisk who doesn't get nightmares about the code....
Then again, I do look back at some of my A-level stuff and cringe.
Regardless of what language you decide to fly with, always learn and stick to a decent set of coding standards, and use them exclusively. Not only will it make your code far more maintainable by yourself (you won't wake up to code and go "who the hell coded this?!" only to realise a few seconds later it was you), but others will be able to pick your code up without much problem.
NeoThermic
i'm still so traumatised about the DevDisk i had to stay in our naval ship and scrub the decks, paint and do some watches (guard) just to keep my mind away from it....
ohhh damn there here again don't let them make me wear that straight jacket PLEEEEESE.
Eating without Tabasco® Sauce is like a computer without a OS.
prophile wrote:C# - avoid
Wrong answer. .NET is different. It's a new idea and most programmers are wary about it. That's understandable. But it's not worse or better. It's different.
If you want to be a game developer, avoid it because it has a slight performance decrease. Otherwise, I'd recommend it. With most applications, you won't even notice the decrease.
wwarnick
Who is online
Users browsing this forum: No registered users and 25 guests