Programming Books

The place to hang out and talk about totally anything general.
elDiablo
level5
level5
Posts: 3111
Joined: Thu Mar 14, 2002 12:23 pm
Location: London, UK

Postby elDiablo » Fri Dec 08, 2006 7:48 pm

Javadoc is AWESOME! Pure and simple. If used correctly :P Just look at the Java API to see what type of comments you should use. It's schmexy!

And alphager: i++ does what now?! :shock: :o

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".
We dont stop playing cos we get old... We get old cos we stop playing.
User avatar
wwarnick
level5
level5
Posts: 1863
Joined: Mon Oct 02, 2006 8:44 pm
Location: Rexburg, ID

Postby wwarnick » Sat Dec 09, 2006 4:35 pm

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
Montyphy
level5
level5
Posts: 6747
Joined: Tue Apr 19, 2005 2:28 pm
Location: Bristol, England

Postby Montyphy » Sat Dec 09, 2006 7:17 pm

Recently, I was amused to find the following comment in a friend's assembly code:

Code: Select all

inc a          # inc a
Uplink help: Check out the Guide or FAQ.
Latest Uplink patch is v1.55.
TheRaven
level3
level3
Posts: 416
Joined: Thu Nov 14, 2002 10:01 pm
Contact:

Postby TheRaven » Sat Dec 09, 2006 10:52 pm

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
User avatar
NeoThermic
Introversion Staff
Introversion Staff
Posts: 6256
Joined: Sat Mar 02, 2002 10:55 am
Location: ::1
Contact:

Postby NeoThermic » Sat Dec 09, 2006 11:04 pm

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
Stewsburntmonkey
level5
level5
Posts: 11553
Joined: Wed Jul 10, 2002 7:44 pm
Location: Nashville, TN
Contact:

Postby Stewsburntmonkey » Sat Dec 09, 2006 11:14 pm

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. :)
User avatar
tabasco boy
level5
level5
Posts: 1180
Joined: Sun Mar 10, 2002 4:25 pm
Location: Lovely Planet Earth
Contact:

Postby tabasco boy » Mon Dec 11, 2006 10:49 pm

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. :shock:
Eating without Tabasco® Sauce is like a computer without a OS.
User avatar
prophile
level5
level5
Posts: 1541
Joined: Fri Feb 18, 2005 4:17 pm
Location: Southampton, UK
Contact:

Postby prophile » Tue Dec 12, 2006 6:00 pm

PHP - I learned PHP from PHP and MySQL Web Development (Luke Welling/Laura Thompson)
C++ - I learned C++ from looking at open-source projects and being taught by Miah Helpmann
C - The C Programming Language (K/R)
C# - avoid
User avatar
wwarnick
level5
level5
Posts: 1863
Joined: Mon Oct 02, 2006 8:44 pm
Location: Rexburg, ID

Postby wwarnick » Tue Dec 12, 2006 7:59 pm

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

Return to “Introversion Lounge”

Who is online

Users browsing this forum: No registered users and 25 guests