Earlier quoted context omitted.
I don't think comments are any kind of substitute for clear, well-structured code. In your example, "Detect collision" still doesn't give me any kind of epiphany about the code. At best, it gives me a slight hint about where to go to get more information. Chances are I'm trying to fix a bug or change the behavior, so I still need to figure what $a, $b, $ab, $c, and d are and what their purpose is. In other words, I h…
Definitely. I wasn't trying to say that they were a substitute. I specifically said both could have worked. In the example they cited, they couldn't even find where to begin. A small comment could have done something about it. When you can't have both clear code and commenting, you could at least try to do one every once in a while. How can that be a bad thing?
Why was Pinball removed from Windows Vista?
41–50 of 149 posts
Re: Why was Pinball removed from Windows Vista?
#42Earlier quoted context omitted.
It's an argument for clear code that's readily understandable by other people. It's not an argument for any particular technique for achieving that goal. I've never seen any programmer seriously suggest that code should be deliberately made difficult to understand.
I can't agree with you emphatically enough about this. Cargo cult commenting is one of the easiest ways to damage the readability of a codebase. Comments should be an edge-case solution for explaining unusual quirks, not the go-to approach for explaining the entire codebase. Using comments to explain what the code is up to is like using exceptions for flow of control. A large proportion of the comments I see should a…
Re: Why was Pinball removed from Windows Vista?
#43Earlier quoted context omitted.
Someone asked that in the comments, and he responded that it was licensed from a 3rd party company.
Take the argument a step further: Microsoft "should" have required the 3rd party to provide the code under an open-source license.
Re: Why was Pinball removed from Windows Vista?
#44Earlier quoted context omitted.
Someone asked that in the comments, and he responded that it was licensed from a 3rd party company.
Take the argument a step further: Microsoft "should" have required the 3rd party to provide the code under an open-source license.
Re: Why was Pinball removed from Windows Vista?
#45This is an excellent example of why comments in code are so very useful, helpful and in my opinion, necessary. ... nobody at Microsoft ever understood how the code worked (much less still understood it), and that most of the code was completely uncommented, we simply couldn't figure out why the collision detector was not working. Heck, we couldn't even find the collision detector! To all those folks out there who kee…
Re: Why was Pinball removed from Windows Vista?
#46Ah, the quantum tunneling pinball!
We ran into this while writing the original code at Cinematronics in 1994. Since the ball motion, physics, and coordinates were all in floating point, and the ball is constantly being pushed "down" the sloped table by the gravity vector in every frame, we found that floating point error would gradually accumulate until the ball's position was suddenly on the other side of the barrier!
(To simplify collision detection, the ball was reduced to a single point/vector and all barriers were inflated by the ball radius. So, if the mathematical point got too "close" to the mathematical line barrier, a tiny amount of floating point rounding or truncation error could push the point to the other side of the line)
To mitigate that, we added a tiny amount of extra bounce to push the ball away from the barrier when it was nearly at rest, to keep the floating point error accumulation at bay. This became known as the Brownian Motion solution.
Since much of the original code was written in x86 asm to hand tailor Pentium U/V pipelines and interleave FPU instructions, but wiki says Microsoft ported the code to C for non-Intel platforms, I'm sure the code had passed through many hands by the time it got to you. The Brownian Motion solution may have been refactored into oblivion.
http://blogs.msdn.com/b/oldnewthing/archive/2012/12/18/10378...
Re: Why was Pinball removed from Windows Vista?
#47Earlier quoted context omitted.
Someone asked that in the comments, and he responded that it was licensed from a 3rd party company.
Take the argument a step further: Microsoft "should" have required the 3rd party to provide the code under an open-source license.
Re: Why was Pinball removed from Windows Vista?
#48Earlier quoted context omitted.
There are some readability problems that stem from a lack of comments, and there are other readability problems that stem from exceedingly poorly-written code. Heck, we couldn't even find the collision detector! This sentence tells me that the big problem here comes from the latter, much worse, source of of readability problems. The fact that they couldn't find the collision detector implies that the code had no clas…
To me that fragment says that the story is a bit more colourful than what really happened. This quote comes from Raymond Chen. The guy who includes ISA bus, interrupts and starting up a debugger in one post ( http://blogs.msdn.com/b/oldnewthing/archive/2007/01/30/15574... ); or analysing chip issues and software workarounds for them ( http://blogs.msdn.com/b/oldnewthing/archive/2011/01/12/10114... ). Maybe the code w…
Re: Why was Pinball removed from Windows Vista?
#49To me, the lesson is: Do not duplicate code! and keep it simple stupid When implementing Unicode, MS said "hey let's copy all of our API functions to new names". Now they have two problems. When implementing 64-bit, MS said "hey let's have a completely different OS for 64-bit." Now they have four problems. Compare this to Unix/Linux/MacOS where Unicode is just implemented as a standard way (UTF-8) of encoding charact…
Which is MS's separate OS for 64-bit?
OS APIs are distinct from kernel APIs. You're comparing a kernel (Linux) with a distribution (Windows).
Re: Why was Pinball removed from Windows Vista?
#50Just played a round of pinball. Despite having used Windows since 2.0, I didn't even know Pinball existed before.