Linked by Thom Holwerda on Tue 18th Dec 2012 23:12 UTC
Windows "Windows XP was the last client version of Windows to include the Pinball game that had been part of Windows since Windows 95. There is apparently speculation that this was done for legal reasons. No, that's not why." I love these stories.
Order by: Score:
"the code was completely uncommented"
by dc.ricardo on Tue 18th Dec 2012 23:58 UTC
dc.ricardo
Member since:
2009-06-02

Ha! A good developer knows how to read code. But a good and well placed comment is better than a 1000 page manual.

And it can bring good games to your new OS too!!!

Reply Score: 0

Laurence Member since:
2007-03-26

Ha! A good developer knows how to read code.

I good developer knows how to write readable code (and still keep it efficient).

Sadly not all developers can be bothered to do so and if they've used nondescript variable / functions names as well as weird developer logic, then the code might as well have been deliberately obfuscated.

I've worked on plenty of projects where debugging other peoples code worked out just as time consuming than if I had rewritten the code from scratch. Albeit we're talking smallish projects in those instances.

But a good and well placed comment is better than a 1000 page manual.

I love finding humour comments in other peoples code (comments I'd forgotten about in my own code).

I remember once stumbling across the following within one of Oracle's own APIs for Java / Oracle RMDBS Forms: "This is a terrible kludge". It pretty much summed up the entire product in one line hehe

Edited 2012-12-19 00:24 UTC

Reply Score: 5

HappyGod Member since:
2005-10-19

I once had to maintain an old VB6 app, which had features such as a Sub that traversed 12 pages! If that wasn't enough the original dev used the same handful of (badly named) variables all the way through this epic subroutine for different purposes!

But back to the comment thing; this same dev would insist on adding a comment every third or fourth line, for no reason at all that I could fathom. Highlights included things like:

' Check this out Mike!!

' Processing ...


and my personal favourite:

' Say hello to my little friend!


He would also always (and I mean always) end every Function and Sub with:

'And done.


When I find him, there will be blood.

Reply Score: 5

kwan_e Member since:
2007-02-18

this same dev would insist on adding a comment every third or fourth line, for no reason at all that I could fathom.


My theory is that any "developer" who has unexplainable coding ticks must have suffered some kind of traumatic learning experience. These are people who develop rituals to ward off evil, not people who write code to solve problems.

Reply Score: 3

moondevil Member since:
2005-07-08

Don't get me started in the quality of off-shore code.

One of my daily tasks in many projects is to improve said code to the quality expected by our customers.

So when the off-shore development time + mine adds up, it actually more expensive than having people doing on site to start with.

Reply Score: 4

JLF65 Member since:
2005-07-06

It's like no one here knows what a REAL programmer is like... REAL programmers don't comment. If it was hard to write, it should be harder to read, and impossible to change. ;)

Just remember, script kiddies, REAL programmers don't eat quiche!

Reply Score: 2

kwan_e Member since:
2007-02-18

It's like no one here knows what a REAL programmer is like... REAL programmers don't comment. If it was hard to write, it should be harder to read, and impossible to change. ;)

Just remember, script kiddies, REAL programmers don't eat quiche!


Good thing I'm learning emacs. I expect to master C-x M-c M-buttefly soon.

Reply Score: 2

moondevil Member since:
2005-07-08

Nothing beats copy con

Reply Score: 2

Neolander Member since:
2010-03-08

I good developer knows how to write readable code (and still keep it efficient).

Sadly not all developers can be bothered to do so and if they've used nondescript variable / functions names as well as weird developer logic, then the code might as well have been deliberately obfuscated.

I've worked on plenty of projects where debugging other peoples code worked out just as time consuming than if I had rewritten the code from scratch. Albeit we're talking smallish projects in those instances.

From personal experience, even good devs who have a pretty good idea of what good code looks like can write pretty unreadable code if they are...

1/Coding under strong time constraints, a burst of inspiration, or something else that puts their minds' focus elsewhere.
2/Not able to notice the mess left around until they try to read through it again after a few months without touching it.

The human brain's content indexing abilities are truly a thing of magic, but they become a hindrance when you try to distinguish what's clean from what isn't.

I love finding humour comments in other peoples code (comments I'd forgotten about in my own code).

I remember once stumbling across the following within one of Oracle's own APIs for Java / Oracle RMDBS Forms: "This is a terrible kludge". It pretty much summed up the entire product in one line hehe

These clever snippets become much less funny when you try to figure out what the code actually does, though ;)

Edited 2012-12-19 08:09 UTC

Reply Score: 5

henderson101 Member since:
2006-05-30



1/Coding under strong time constraints, a burst of inspiration, or something else that puts their minds' focus elsewhere.
2/Not able to notice the mess left around until they try to read through it again after a few months without touching it.


3/Trying to manually obfuscate their own code so as to ensure continued requirement for their expensive services.

The human brain's content indexing abilities are truly a thing of magic, but they become a hindrance when you try to distinguish what's clean from what isn't.


Or to put it another way - if you understand how it works and you need to maintain it, that is all that matters to many coders. It's only when new eyes hit the code that cracks will appear. As someone who has worked on a large body of awful code for the last 5 years (inherited from offshore contract programmers) I can attest to this.


These clever snippets become much less funny when you try to figure out what the code actually does, though ;)


The guys I inherited the code from loved to attest inane changes to themselves. I know them all like dear "friends" and when I see specific names I gently weep and comment out the method and start again from scratch.

Reply Score: 5

Laurence Member since:
2007-03-26

From personal experience, even good devs who have a pretty good idea of what good code looks like can write pretty unreadable code if they are...

1/Coding under strong time constraints, a burst of inspiration, or something else that puts their minds' focus elsewhere.
2/Not able to notice the mess left around until they try to read through it again after a few months without touching it.

The human brain's content indexing abilities are truly a thing of magic, but they become a hindrance when you try to distinguish what's clean from what isn't.

Some good points but I don't entirely agree with point 2 on a personal level.

I tend to rewrite code as I code it (usually because I'm mentally debugging it as I'm programming so find cleaner / more optimal designs as I'm writing it). So the mess generally does get noticed (baring when I'm under time constraints, as you mentioned in point 1.

That's purely my method of programming though. I'm by no means saying it's better or worse, nor that you were right or wrong with your view ;)

These clever snippets become much less funny when you try to figure out what the code actually does, though ;)

Thankfully that example did go on to explain the routine and the reason the for kludge. I just cropped that out of my post as it didn't wouldn't mean much to anyone who wasn't involved in that project.

Reply Score: 4

kwan_e Member since:
2007-02-18

1/Coding under strong time constraints, a burst of inspiration, or something else that puts their minds' focus elsewhere.


I tend to be opposite in these cases. If I'm under time constraints, I'll write cleaner code, or rather, code with a standard design that translates into idiomatic code. If I get time, I experiment with different designs and end up with clever code.

Reply Score: 2

load_mic Member since:
2005-12-13

Well I know I have written stuff that I was ashamed of just to meet a dead line.

Reply Score: 1

henderson101 Member since:
2006-05-30

I don't have to look at this link - Raymond Chen. You realise who he is? I think that if he couldn't work it out, it was pretty convoluted and badly written code. Personally, I'd rate his opinion over yours about 1000 fold.

Reply Score: 5

f0dder Member since:
2009-08-05

An from reading the article comments, the code was originally written in Pentium-optimized assembly (oh, the days of U/V pipe dreams), and later backported to C (probably with any comments removed?) Good luck trying to maintain that ;)

Reply Score: 2

More importantly ...
by WorknMan on Wed 19th Dec 2012 00:10 UTC
WorknMan
Member since:
2005-11-13

I also wanna know why they removed the Vista Calendar and startup manager from Windows 7 ;)

Reply Score: 3

OldNewThing
by Nelson on Wed 19th Dec 2012 00:25 UTC
Nelson
Member since:
2005-11-29

is one of my favorite blogs. Its literally filled with little gems like this.

Reply Score: 3

v If only Microsoft...
by FreeGamer on Wed 19th Dec 2012 00:55 UTC
RE: If only Microsoft...
by Wafflez on Wed 19th Dec 2012 01:02 UTC in reply to "If only Microsoft..."
Wafflez Member since:
2011-06-26

Read the article - Microsoft doesn't own Pinball and cannot release the source code. So begin with "If only Microsoft... would own the code".

Less Linux zealotry, more facts.

Reply Score: 5

RE[2]: If only Microsoft...
by kwan_e on Wed 19th Dec 2012 03:27 UTC in reply to "RE: If only Microsoft..."
kwan_e Member since:
2007-02-18

Less Linux zealotry, more facts.


Where was Linux mentioned in the comment?

Reply Score: 6

RE[3]: If only Microsoft...
by Wafflez on Wed 19th Dec 2012 05:17 UTC in reply to "RE[2]: If only Microsoft..."
Wafflez Member since:
2011-06-26

Let's be real - open source fans that bash Microsoft are 99% of Linux free soul open minders, not WordPress.

Just read Ubuntu forums. "omg so glads i no longer suport war in iraq by buing M $ crappy rotten softwar". Never found those statements on other open source project forums.

Edited 2012-12-19 05:22 UTC

Reply Score: 0

RE[4]: If only Microsoft...
by kwan_e on Wed 19th Dec 2012 07:22 UTC in reply to "RE[3]: If only Microsoft..."
kwan_e Member since:
2007-02-18

Let's be real - open source fans that bash Microsoft are 99% of Linux free soul open minders, not WordPress.

Just read Ubuntu forums. "omg so glads i no longer suport war in iraq by buing M $ crappy rotten softwar". Never found those statements on other open source project forums.


Let's be real, so you make things up?

99%?

"Linux free soul open minders, not Wordpress"? What does that even mean?

Let's say all Ubuntu users are crazy. I'm pretty sure Ubuntu does not count for 99% of Linux users.

That quote also sounds made up.

Reply Score: 5

RE[4]: If only Microsoft...
by Gone fishing on Wed 19th Dec 2012 11:44 UTC in reply to "RE[3]: If only Microsoft..."
Gone fishing Member since:
2006-02-22

Let's be real - open source fans that bash Microsoft are 99% of Linux free soul open minders, not WordPress.

Just read Ubuntu forums. "omg so glads i no longer suport war in iraq by buing M $ crappy rotten softwar". Never found those statements on other open source project forums.


Well you obviously have never been to Ubuntu forums KiwiNZ would certainly not let a thread or even a comment like that pass. In fact one of my issues with Ubuntu forums is that it is too often gushingly pro proprietary software.

Reply Score: 4

RE[2]: If only Microsoft...
by phreck on Wed 19th Dec 2012 11:52 UTC in reply to "RE: If only Microsoft..."
phreck Member since:
2009-08-13

I have the feeling that there's more Open-Source/Free-Software-Phobia from some Windows users than there is Free-Software-Zealotry; in other words, I see more free-software-bashing than vice versa.

And interestingly (my own real life experience), those participating in free-software-hate are also often those ignoring and being ignorant on open-source licenses and their terms, but still grabbing such code ("got that from google"), no matter what.

Reply Score: 4

RE[3]: If only Microsoft...
by lucas_maximus on Wed 19th Dec 2012 18:26 UTC in reply to "RE[2]: If only Microsoft..."
lucas_maximus Member since:
2009-08-18

Why does every article that mentions Microsoft or Windows has some guy droning on about how Microsoft is evil then?

Reply Score: 4

RE[4]: If only Microsoft...
by Morgan on Wed 19th Dec 2012 21:53 UTC in reply to "RE[3]: If only Microsoft..."
Morgan Member since:
2005-06-29

It's the nature of the beast. We're all conditioned to take sides, and it takes effort combined with experience to fight that conditioning.

There was a time, when I was in high school and Windows didn't have a Start button, that I openly derided anything not from Microsoft because that was the culture I was brought up in. Our school had a couple of ancient Apple IIs in the special education lab, and one lonely Mac Classic that belonged to a teacher, but the majority of the school computers were DOS/Windows machines. We were force-fed DOS and Windows as the only solution.

After high school, I wasn't able to enroll in college right away due to health issues so I took some correspondence courses instead, and that was the first time I'd heard of the new kid on the block, Linux. Fast forward to today and I feel that all major OSes, and quite a few minor ones, have merit and a place on my hardware. Of course, BeOS and Haiku are at the top of my list, but I happily use Windows, OS X and GNU/Linux daily as well.

Of course, no two people have the same experience, so opinions differ and people do tend to become entrenched in a particular platform. I feel the regulars here are much more open minded than at other website communities and forums, but you'll always have a few zealots.

Reply Score: 4

RE[3]: If only Microsoft...
by tylerdurden on Thu 20th Dec 2012 01:39 UTC in reply to "RE[2]: If only Microsoft..."
tylerdurden Member since:
2009-03-17

"feelings" have this nasty tendency of being wrong, which is why we came up with science...

Edited 2012-12-20 01:40 UTC

Reply Score: 3

RE[4]: If only Microsoft...
by phreck on Fri 21st Dec 2012 16:25 UTC in reply to "RE[3]: If only Microsoft..."
phreck Member since:
2009-08-13

Oh, but

Let's be real - open source fans that bash Microsoft are 99% of Linux free soul open minders, not WordPress.

Just read Ubuntu forums.


is just feelings, too; the difference is I admit that those are just feelings (instead of imposing logic where there is none), and strictly speaking, I have the feeling that near to no post in any forum is scienceful and precise.


But generally, I agree.

Edited 2012-12-21 16:26 UTC

Reply Score: 0

RE: If only Microsoft...
by Nelson on Wed 19th Dec 2012 01:17 UTC in reply to "If only Microsoft..."
Nelson Member since:
2005-11-29

The above comment is everything that's wrong with Open Source zealotry. Holy fuck.

I think you made me invent a new way to scratch my head in disbelief.

Reply Score: 2

RE[2]: If only Microsoft...
by UltraZelda64 on Wed 19th Dec 2012 02:18 UTC in reply to "RE: If only Microsoft..."
UltraZelda64 Member since:
2006-12-05

Hurry up, you better go patent that.

Reply Score: 5

RE[3]: If only Microsoft...
by Nelson on Wed 19th Dec 2012 04:48 UTC in reply to "RE[2]: If only Microsoft..."
Nelson Member since:
2005-11-29

First time one of your comments makes me laugh because its funny and not sad ;)

Reply Score: 2

Why wasn't it built in 32-bit mode?
by kriston on Wed 19th Dec 2012 04:35 UTC
kriston
Member since:
2007-04-11

I still wonder why it just wasn't built in 32-bit mode? We play 32-bit mode games all the time. Why not this one?

At least there's still Visual Pinball and VPinMAME which are far better and more fun.

Reply Score: 3

Neolander Member since:
2010-03-08

I still wonder why it just wasn't built in 32-bit mode? We play 32-bit mode games all the time. Why not this one?

At least there's still Visual Pinball and VPinMAME which are far better and more fun.

64-bit Windows is not compatible with every application that runs fine on the 32-bit version, as an example every soft that relies on legacy 16-bit processor modes is out of luck since AMD did some cruft slashing when they designed the AMD64 standard.

Considering that the Windows pinball used to date back from the Win9x era where hacking into the underlying DOS system was the norm in complex software like games, making it run on 64-bit windows was likely more complex than just switching the processor in 32-bit mode and hooking it into 64-bit libraries through wrapper and segmentation magic.

Edited 2012-12-19 06:08 UTC

Reply Score: 6

f0dder Member since:
2009-08-05

I've just extracted PINBALL from a XP32-SP2 and ran it on my Win7-X64, and it seems to work just fine (reading from the OldNewThing comments you're not probably not allowed to do that, but whatever).

Reply Score: 3

f0dder Member since:
2009-08-05

That would have been even more work, because there was at the time no infrastructure in Setup for having 32-bit-only components. (And then automatically uninstalling it when WOW64 was disabled.) And besides, all the people who criticized Windows 95 as "not really a 32-bit operating system because it has some parts in 16-bit" would use the same logic to say that 64-bit Windows is "not really a 64-bit operating system." -Raymond
- http://blogs.msdn.com/b/oldnewthing/archive/2012/12/18/10378851.asp...

Reply Score: 3

read the comments
by transputer_guy on Wed 19th Dec 2012 07:04 UTC
transputer_guy
Member since:
2005-07-08

I suspect the game was perfectly well commented by the owner but were stripped out due to small license payment, why would MS need to understand code if they were barely paying for it after all it worked on the current hardware.

It was written in asm, maybe it was actually written in C but MS only was given the asm listing.

From the comments in the blog

The asm code was highly tuned to the FPU pipeline, paired ops and all.

As the x86 evolved with ever new FPU opcodes and then AMD64, the FPU bugs became too difficult to figure out.

Payment for the license was only a few thousand $

MSFT actually hoped that devs would pay them to add their games to the Win95 Plus pack for the exposure, didn't fly so most devs didn't join the Plus pack.

There are various comments about the game using detection algorithms that were very sensitive to FPU round off errors eventually causing it to pass through solids.

Reply Score: 4

RE: read the comments
by henderson101 on Wed 19th Dec 2012 09:54 UTC in reply to "read the comments"
henderson101 Member since:
2006-05-30

If you read the secondary link, Raymond actually fixed it to work nicely on the NT WIN32 strand. It otherwise consumed 100% of the processor and had a ~1000FPS refresh rate!

My guess is that a pinball game wasn't an especially hight priority.

Reply Score: 4

RE[2]: read the comments
by MOS6510 on Wed 19th Dec 2012 12:56 UTC in reply to "RE: read the comments"
MOS6510 Member since:
2011-05-12

My guess is that a pinball game wasn't an especially hight priority.


Unlike the refresh rate!

Reply Score: 2

RE: read the comments
by renox on Thu 20th Dec 2012 10:22 UTC in reply to "read the comments"
renox Member since:
2005-07-06

There are various comments about the game using detection algorithms that were very sensitive to FPU round off errors eventually causing it to pass through solids.


Sigh, and people still look at me as if I was a madman when I say that floating point suck and that we should use interval arithmetic..
http://en.wikipedia.org/wiki/Interval_arithmetic

Reply Score: 3

RE[2]: read the comments
by Alfman on Thu 20th Dec 2012 13:14 UTC in reply to "RE: read the comments"
Alfman Member since:
2011-01-28

renox,

"Sigh, and people still look at me as if I was a madman when I say that floating point suck and that we should use interval arithmetic.."

Very insightful. Beyond rounding issues, it's always bugged me a bit too that the resolution of game coordinates become worse and worse the further a player gets away from the origin. Therefor if your running precise mathematical computations in a game (ie object projections), the results inherently depend on which arbitrary digits the mantissa is representing. Using integral/fixed point arithmetic would offer equal precision at all coordinates.

Reply Score: 2

RE[3]: read the comments
by renox on Thu 20th Dec 2012 15:43 UTC in reply to "RE[2]: read the comments"
renox Member since:
2005-07-06

That's a different issue but you're right also I remember reading game developers advocating fixed point arithmetic for world coordinate.
One can do interval arithmetic with fixed point computation too..

Reply Score: 2

RE[4]: read the comments
by Alfman on Thu 20th Dec 2012 16:26 UTC in reply to "RE[3]: read the comments"
Alfman Member since:
2011-01-28

renox,

Floating point used to be far more accurate than ints when cpu registers were limited to 32bit. Now that we have 64bit registers and SSE's FP mantissa is only 52bits, fixed point integers can give us more accuracy as well.

I wonder if there are any game worlds that are big enough such that this makes an observable difference?

If each object were tracked to millimetre resolution, then SSE's 64bit FP is accurate up to half a light year in any direction. 64bit signed fixed point would cover 970 light years in any direction.

So I guess there's probably not a very compelling reason to switch unless your simulating a large universe.

Nice chart showing breakdown of FP formats.
http://www.monash.edu.au/policy/gpnumacc.htm

Reply Score: 2

RE: read the comments
by Alfman on Thu 20th Dec 2012 15:45 UTC in reply to "read the comments"
Alfman Member since:
2011-01-28

transputer_guy,

"As the x86 evolved with ever new FPU opcodes and then AMD64, the FPU bugs became too difficult to figure out."

"There are various comments about the game using detection algorithms that were very sensitive to FPU round off errors eventually causing it to pass through solids."

Somehow this doesn't seem right, even though it's what the author hinted. And since he didn't find the bug, he might be wrong to point the finger to FP. How does FP rounding make a difference for a game where the ball's position is genuinely a REAL number (unlike currency)? What's it matter if a bit representing 0.000000000000000005% of the full value is a 1 or 0?

AMD64 still has the original 80bit floating point unit & registers used by x86. Some applications have switched to SSE's 64bit FP computation, but it isn't necessary and I am wondering if the bug is happening with both FPU and SSE?


My guess is that there's some timer initialization code that's buggy in the 64bit version which is causing the in-game motion vector factors to jump up such that the ball "moves" from above the paddle to below it in one game step without ever touching it.

Pseudo example:
intervals_per_second=0;
time = time();
while( time()-time < 1s ) {
ProcessGameInterval();
intervals_per_second++
}

This code determines how many steps the game can handle per second. However if the integer type is too small (say 8 or 16bits), then intervals_per_second will wrap. This would cause the game to *think* that the machine's is very slow, and ProcessGameInterval might move the ball by such large steps at each interval such that it completely misses the paddle.

Edited 2012-12-20 15:47 UTC

Reply Score: 2

Apparently my duty
by screamingturnip on Sun 23rd Dec 2012 17:35 UTC
screamingturnip
Member since:
2012-04-05

Microsoft is evil. It killed my mother, ate my sister and stole my moose. I hope that everyone involved in the exploits of Microsoft get stabbed by boats. I hope I lie and tell everyone you were a good wife and I hope you die, I hope we both die....

Wait, got confused with song lyrics in that last bit sorry.
Honestly, searching my own feelings I was a much bigger Microsoft hater back in the DOJ days. Now it just looks like an annoyance to install. I don't mind Aero though. 7 home is on the other partition of this netbook and I visit every once and a while, play a Civ 4 demo and go back home to my Mint 14.

On the note of the blog itself, I love that we live in an age where frigging inane questions like this have honest in depth answers. Think I might peruse bloggy man's backlog.

Reply Score: 1