Stack in raytracing

Started by
11 comments, last by Cypher19 15 years, 10 months ago
Thanks guys!

I must admit that his raytracing tutorial is quite nice, but the final Fine-tuning portion of it is( "I bet this looks extremely obscure." - Jacco Bikker) too ugly.

You can find the final chapter of his tutorial here
http://www.devmaster.net/articles/raytracing_series/part7.php

JJ


Advertisement
Quote:Original post by Cypher19...If you include a line of code that would take an experienced C++ coder several minutes to decipher and understand, if ever...


The code is bad, but it shouldn't take anyone more than maybe 10 seconds to realise what it does. Yes a better method would be appropriate, even a comment for explanation would help but it's not nearly as obfuscated as everyone seems to be making out.
Yeah, I guess several minutes is a bit of an overstatement, but certainly I had to re-read a few times to understand exactly what was going on, and the first guy to reply wasn't even certain what was going on. Given that this is intended for a tutorial though, it is absolutely right out. Hell, even if this was for a job, I'd probably slap the guy on the wrist for code like this in general. Obviously there are cases where code like this would be more sensible, but it should still be more readable and absolutely would require a comment to explain it; as far as I'm concerned, if a single line of code requires being read more than twice in order to understand, you've got a problem (again, in the general case).

This topic is closed to new replies.

Advertisement