Live data from Hacker News

Doom 3 Source code review

fabiensanglard.net

11–20 of 64 posts

Re: Doom 3 Source code review

#11
post #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?

Throwing the baby out with the bath water. I'd much rather have good comments.

Re: Doom 3 Source code review

#12
post #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.

The images are not loaded until you scroll them into view, so bandwidth is saved if you don't read the whole article.

Re: Doom 3 Source code review

#13
post #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.

Can you refactor c++ code in visual studio?

Re: Doom 3 Source code review

#14
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…

Bad comments are bad comments. Read the code/comments actually being referenced and it's clearly of high quality.

Re: Doom 3 Source code review

#15
post #11
post #9

Earlier quoted context omitted.

>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?

Throwing the baby out with the bath water. I'd much rather have good comments.

The problem is that comments are often only good the first few times you read them. After heavily hacking on some code for a while, you know the comments. I find the ability to fold comments very valuable.

Re: Doom 3 Source code review

#16
post #13
post #4

Earlier quoted context omitted.

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.

Can you refactor c++ code in visual studio?

Yes. http://www.wholetomato.com/

Re: Doom 3 Source code review

#17
post #10
post #7

Earlier quoted context omitted.

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.

The actual algorithm is rather nice, despite the reader-hostile presentation...

Re: Doom 3 Source code review

#18
post #12
post #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.

The images are not loaded until you scroll them into view, so bandwidth is saved if you don't read the whole article.

That's bullshit. What if my connection is slow and I want to leave the page loading whilst I do some other things.

Re: Doom 3 Source code review

#19
post #12
post #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.

The images are not loaded until you scroll them into view, so bandwidth is saved if you don't read the whole article.

In that case the noscript fallback should be loading all immediately.

Re: Doom 3 Source code review

#20
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…

I was taught to write programs in "pseudo code" before actually coding. Pseudo code being "English". What your example looks like to me is psudo code turned in to comments as the real code is written in underneath.

Not sure how that helps or hinders, its just an observation.

Post reply on HN