Sponsored by Dragon Age: Origins
Follow the Dragon Age: Origins development team on Twitter view!
twitter.com/DragonAge - EA presents BioWare's new dark fantasy epic Dragon Age: Origins. '9/10' from Game Informer.
562 Comments
- LoveWidescreen, on 01/02/2009, -2/+1279Ouch.
For anyone who is wondering or just doesn't want to figure it out, Dec. 31 qualified as being greater than day 365 (obviously, because it was day 366) but it got caught where the program says to look at (days > 365). The problem is that there was no code for what to do if the day *equals* 366, only if days is *greater* than 366. So, there was no way to break out of the (days > 365) loop until today (day 367) when the program would reset days to 1, thereby breaking the loop.
Whoops. It's amazing what one bad "if" statement can do. - veriix, on 01/02/2009, -13/+366if day = 366 then [***** you]
- uptwolait, on 01/02/2009, -2/+301Pretty if'd up.
- Melodik, on 01/02/2009, -66/+359The formatting in this code makes me happy. Example:
if (whatever == whateverElse)
{
whatever;
}
else
{
whateverElse;
}
...is so much nicer looking than:
if(whatever == whateverElse){
whatever;
} else {
whateverElse;
} - merlinicorpus, on 01/02/2009, -3/+261Who else thought this was going to be fictional code as a joke?
- spuz, on 01/02/2009, -1/+231Dates programming sucks. And don't even get me started on timezones...
- Rikkochet, on 01/02/2009, -4/+204Goto is a perfectly valid and useful programming construct, especially on a lightweight device where you can't afford a huge call stack. Professors and experts just scream that they're the devil because too many programmers use them and don't comment them or put them into maintainable code.
Seeing a BAD goto in code tells you something about the programmer in general. Seeing a goto in code (period) doesn't tell you anything. - hxc2k, on 01/02/2009, -2/+179Before people go omg ms suck, please take note that this code was not written by MS. It's a driver written by Freescale.
- Pete0430, on 01/02/2009, -32/+184Oh god... I see goto's...
- Tarkaan, on 01/02/2009, -1/+135From what I understand, they do nothing.
- Rantipole, on 01/02/2009, -21/+140I prefer to put the opening brackets on the if line:
if(condition) {
something();
}
else {
somethingElse();
}
I really don't like the look of having a { on its own line, but I also don't like the nasty look of "} else {".
Coding is an art. It's all a matter of style, I guess. - BinaryDelt, on 01/02/2009, -2/+119if day == 366 then [***** you]
fixed that for you. - belcorriko, on 01/02/2009, -15/+130LOOP FAIL
- TheInfamousOne, on 01/02/2009, -4/+118It's called a "feature", it makes you appreciate you music more the next day.
- manjas8, on 01/02/2009, -2/+98MICHAEL
Ok! Ok! I must have, I must have put a decimal point in the wrong place
or something. *****. I always do that. I always mess up some mundane
detail.
PETER
$305,326.13 isn't a mundane detail Michael! - terminatus, on 01/02/2009, -2/+90nice debugging sir :D
- greeniemeani, on 01/02/2009, -23/+105I disagree. Code like that makes me get the goggles out.
- MelvinSchlubman, on 01/02/2009, -18/+93Looks like just the kind of thing that a code review would have caught up-front.
- plainOldFool, on 01/02/2009, -0/+69Dealing with daylightsavings time is also a bitch.
- WayneGoode, on 01/02/2009, -1/+62It's not actually Microsoft code. It is by Freescale Semiconductor. Don't know if this the reason why it escaped.
- TheVirus, on 01/02/2009, -2/+62There's your problem!
/Adam Savage - Shidell, on 01/02/2009, -9/+67Wow, I didn't think we'd get to see real Zune code out in the open. Is the entire source available?
This is pretty un-Microsoft-like. - KibibyteBrain, on 01/02/2009, -2/+59This is why its always best to think of a mission critical driver core as a state machine of the switch/case model. And then make sure all cases are handled, which is easy with the default keyword. Its much easier to check that way than to try to see if your lists of ifs handle all possible cases.
- zhephree, on 01/02/2009, -1/+55if (day==366) {
*****(you);
}
fixed that for you. - DataMonkey, on 01/02/2009, -4/+58A code review for the large WHAT?
- veriix, on 01/02/2009, -0/+53Achievement Unlocked!
- Kestrel, on 01/02/2009, -2/+54Code review... maybe.
Unit test... definitely. - grules, on 01/02/2009, -5/+56Let's get the code review done for the Large Hardon Collider immediately!!!
- Braxo, on 01/02/2009, -8/+56Using goto's isn't all that bad. Just one more tool in the toolbox.
However you will get laughed at when using them. - inactive, on 01/02/2009, -3/+47if (2012 == year)
(
end_of_world = TRUE
)
else
(
end_of_world = FALSE
) - GelfTheElf, on 01/02/2009, -2/+45I think it's a simple error and I'm sure we've all made similar errors in our life. Let he who is without bugs cast the first stone!
and.. it just killed Zunes not actual people! I read once where someone DIED in an MRI machine or something because of a missing semicolon!
And check these super bugs out:
http://news.zdnet.com/2424-9595_22-177729.html
European Satellite:
...According to a piece in the New York Times Magazine, the self-destruction was triggered by software trying to stuff "a 64-bit number into a 16-bit space."
The Mars Climate observer:
What caused the error? A sub-contractor on the NASA program had used imperial units (as used in the U.S.), rather than the NASA-specified metric units (as used in Europe). - mediaphile, on 01/02/2009, -0/+43Both
- imikedaman, on 01/02/2009, -13/+55I can't stand it when the brackets and the else take up three separate lines. I guess I just like everything feeling more compact. I also hate it when there are spaces around the parentheses, like ( x == 5 ), for the same reason.
My old CS teachers used to take off "style" points for it, though. - BXRWXR, on 01/02/2009, -9/+49That.
1,000 times that. - topherker, on 01/02/2009, -3/+43//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
I am assuming everyone accepted the terms of the EULA? - zephc, on 01/02/2009, -16/+54Bluh, Win32 flashbacks. Burn it with Fire!
- EvilJon, on 01/02/2009, -2/+40Did anyone notice right at the top of the code there's a MAXYEAR defined as 2080? That constant is used to check whether the time is valid. I'm not going to waste more time on this than I have, but I think the implication is that your Zune might stop working (for good) in 2081!!!
Hehe ;) - gilbert42989, on 01/02/2009, -3/+41someone is getting chewed out for such a simple mistake.
- NTAuthority, on 01/02/2009, -0/+35Simple:
OAL: OEM Abstraction Layer -- hardware-specific part of WinCE
IoCtl: Input/output control kernel-part, used for device driver communication
Hal: As MS likes to captialize that way, Hardware Abstraction Layer
InitRTC: Initialize Real Time Clock
(Windows NT kernel design also contains a lot of those function names) - captcoilgun, on 01/02/2009, -0/+35Line 246 should be changed to read: "Returns TRUE if successful, otherwise doesn't return." ;-)
I agree that code reviews will catch logic errors like that one. And so would testing. - talonstriker, on 01/02/2009, -0/+34It's very simple in retrospect, but if you didn't know what the bug was, I'm willing to bet that you wouldn't have found it.
- inactive, on 01/02/2009, -0/+33so, does that mean everyones zune was only disabled for 1 day after which the error went away for the next 4 years?
- pixelate, on 01/02/2009, -0/+33Correct. And they've promised to fix the error before 2012!
http://zuneinsider.com/archive/2008/12/31/30gb-zun ... - oboshoe, on 01/02/2009, -0/+32lol
Back in college I still remember the shock of being told by the instructor that if I use one goto in any of my code, that I would fail the entire course.
(at that point I was already a self taught code monkey who made extensive use of gotos) - Darkhacker, on 01/02/2009, -1/+33I'll never figure out what it is about date/time programming that causes developers to reinvent the wheel. I have no idea when the offending code was actually written, but I see programmers writing new date code all the ***** time instead of using an already written and well tested library. If there is one thing that I see reinvented more than any other, it's date/time calculations.
- ScottMitchell, on 01/02/2009, -2/+33Performance issues aside, how is a switch/case with a default any different than if/else if/else if, etc. with a final else? I would purport that the two are isomorphic! (I think that's the first time I've used that word since I completed university.)
- CaptOblivious, on 01/02/2009, -3/+33Calling a half dozen poorly named and undocumented functions out of completely separate files is SO MUCH BETTER than a goto!
- Fryth, on 01/02/2009, -1/+31I don't even see the code. I just see blonde, brunette, redhead.
- duragizer444, on 01/02/2009, -0/+29Thats how they get ya..
Start saving to buy a new one in 2080. - sensor, on 01/02/2009, -1/+30http://en.wikipedia.org/wiki/Indent_style#Allman_s ...
"Advantages of this style are that the indented code is clearly set apart from the containing statement by lines that are almost completely whitespace, improving readability and the ending brace lines up in the same column as the beginning brace, making it easy to find the matching brace"
I totally agree with that. -
Show 51 - 100 of 575 discussions



What is Digg?
Browsing Digg on your phone just got easier with our enhancements to the