Live data from Hacker News

Why was Pinball removed from Windows Vista?

blogs.msdn.com

41–50 of 149 posts

Re: Why was Pinball removed from Windows Vista?

#41
post #39

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?

[deleted]

Re: Why was Pinball removed from Windows Vista?

#42
post #24
post #8

Earlier 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…

I agree that comments should not be the "go-to approach for explaining the entire codebase." I hope you didn't think I was insinuating that in my comment. I was only trying to illustrate that in the absence of clear code, which many developers are guilty of sometimes, comments can be very helpful.

Re: Why was Pinball removed from Windows Vista?

#43

Earlier 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.

I'm surprised they didn't. Why would MS trust 3rd party code enough to include it in their OS? Seems like quite an unnecessary risk.

Re: Why was Pinball removed from Windows Vista?

#44

Earlier 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.

In 1995? Things were VERY different back then. Open source was Microsoft's mortal enemy.

Re: Why was Pinball removed from Windows Vista?

#45

This 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…

I read that comment and immediately thought of this HN post and why i disagreed with everything in that article.

http://news.ycombinator.com/item?id=4934417

Re: Why was Pinball removed from Windows Vista?

#46
The best part of this article is in the comments. An original programmer on the game explains the reason that the bug was occurring and also why the code was unreadable (hint: they did it in assembly)

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

#47

Earlier 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.

Open source wasn't exactly a huge priority for Microsoft in 1995 when the application came into existence. In fact I think it's a testament to their backwards compatibility that pinball survived for as long as it did with little or no maintenance.

Re: Why was Pinball removed from Windows Vista?

#48

Earlier 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…

A programmer from the original game commented on the article and said much of it was done in asm then later ported to C by msft, so it probably was really that messy.

Re: Why was Pinball removed from Windows Vista?

#49
post #38

To 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…

MS implemented NT, which only worked in Unicode. They had to add a compatibility layer to run Ansi apps.

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).

Post reply on HN