Live data from Hacker News

Doom 3 Source code review

fabiensanglard.net

1–10 of 64 posts

Re: Doom 3 Source code review

#4

> the variables highlights and the "Command-Click" to reach a definition make the experience superior to Visual Studio. Seriously ? There may be reasons to think Visual Studio is an inferior product, these are not among them.

He mentioned just for code browsing so don't panic. Nobody in their right mind would think XCode compares to Visual Studio. I mean it's 2012 and there is still no refactoring support.

Re: Doom 3 Source code review

#5
>In some part of the code (see dmap page) there are actually more comments than statements.

>Dmap source code is very well commented, just look at the amount of green: There is more comments than code !

You know, in my experience that's not a good thing. I work on similar, heavily-commented code and find it extremely painful. At some point it becomes a burden to see the code behind the comments. (And just so no one misinterprets me: I am not against comments /per se/.)

It's like when you read code written by someone who simply loved whitespace and who appended a useless "banner comment" after each real comment[1]:

// If x is less than 3, do stuff 50 times.

// -----------------------------

if ( x {

// While i goes from 0 to 50.

// --------------------------

for ( int i = 0; i {

// Do stuff.

// ---------------

doStuff ( ) ;

}

}

So what would've fitted in one screen of text, if written in a sensible fashion, now requires one and a half screen and lots of scrolling.

[1] The comments in the example are actually both crappy and pointless. Sadly, the program I work on is riddled with them. Please don't write out what the programming language constructs do in English.

Re: Doom 3 Source code review

#6
Attention readers: For some reason i cannot comprehend the pages use javascript to load some images. There are no noscript elements notifying you about this. So enable javascript to read through this.

Re: Doom 3 Source code review

#7
post #5

>In some part of the code (see dmap page) there are actually more comments than statements. >Dmap source code is very well commented, just look at the amount of green: There is more comments than code ! You know, in my experience that's not a good thing. I work on similar, heavily-commented code and find it extremely painful. At some point it becomes a burden to see the code behind the comments. (And just so no one m…

At least in that case you can attribute it to well-intentioned stupidity. Here's my favourite short example you must instead attribute to malice: [1] a closed-form implementation of fibs(n). Follow along with the comments!

1. https://gist.github.com/eb02e9546102594e8bf7

Re: Doom 3 Source code review

#8

> the variables highlights and the "Command-Click" to reach a definition make the experience superior to Visual Studio. Seriously ? There may be reasons to think Visual Studio is an inferior product, these are not among them.

Visual Studio has an extension engine, you can download many extensions for free. Go to Tools > Extension Manager and browse away. There's one called Productivity Power Tools that we just install by default.

Also, XCode has a nice feature where you can switch between .h and .c files with CMD+Up. This is missing from VS, but you can add a macro and map it to a key, for me it's ALT+O. See here:

http://www.codeproject.com/Articles/2223/Switch-between-Head...

Re: Doom 3 Source code review

#9
post #5

>In some part of the code (see dmap page) there are actually more comments than statements. >Dmap source code is very well commented, just look at the amount of green: There is more comments than code ! You know, in my experience that's not a good thing. I work on similar, heavily-commented code and find it extremely painful. At some point it becomes a burden to see the code behind the comments. (And just so no one m…

>At some point it becomes a burden to see the code behind the comments. (And just so no one misinterprets me: I am not against comments /per se/.)

Then use an editor/IDE that can automatically hide or fold the comments?

Re: Doom 3 Source code review

#10
post #7
post #5

>In some part of the code (see dmap page) there are actually more comments than statements. >Dmap source code is very well commented, just look at the amount of green: There is more comments than code ! You know, in my experience that's not a good thing. I work on similar, heavily-commented code and find it extremely painful. At some point it becomes a burden to see the code behind the comments. (And just so no one m…

At least in that case you can attribute it to well-intentioned stupidity. Here's my favourite short example you must instead attribute to malice: [1] a closed-form implementation of fibs(n). Follow along with the comments! 1. https://gist.github.com/eb02e9546102594e8bf7

That's really a fun example. It took me a while to even find the definition of f after having been distracted by all the comment clutter. Point taken.
Post reply on HN