You are viewing an obsolete version of the DU website which is no longer supported by the Administrators. Visit The New DU.
Democratic Underground Latest Greatest Lobby Journals Search Options Help Login
Google

Reply #8: Not 32000 votes. I'd bet 32767 [View All]

Printer-friendly format Printer-friendly format
Printer-friendly format Email this thread to a friend
Printer-friendly format Bookmark this thread
This topic is archived.
Home » Discuss » Latest Breaking News Donate to DU
htuttle Donating Member (1000+ posts) Send PM | Profile | Ignore Fri Nov-05-04 11:00 AM
Response to Original message
8. Not 32000 votes. I'd bet 32767
Edited on Fri Nov-05-04 11:03 AM by htuttle
That's the maximum value of a 'short integer' in computer lingo. When you exceed it with a short integer variable, it 'overflows' and turns over kind of like an odometer.

EVEN FIRST YEAR COMPUTER SCIENCE STUDENTS KNOW TO CHECK FOR COUNTER OVERFLOWS!!! ESPECIALLY IF YOU'RE USING SHORT INTEGERS!!

Why the hell even use a short int for a counter? Saving 2 bytes isn't going to help much anywhere.

I give them a D- in this assignment. The only reason it's not an F is because the software at least launched and ran.


I don't know if I can even express to a non-programmer how lame this error is. Imagine if you took your car to a mechanic to get the oil changed, and they forgot to put the filter back on. It's that lame.

...

Or if GM designed a car where you couldn't open the front and back doors at the same time. It's THAT lame.
Printer Friendly | Permalink |  | Top
 

Home » Discuss » Latest Breaking News Donate to DU

Powered by DCForum+ Version 1.1 Copyright 1997-2002 DCScripts.com
Software has been extensively modified by the DU administrators


Important Notices: By participating on this discussion board, visitors agree to abide by the rules outlined on our Rules page. Messages posted on the Democratic Underground Discussion Forums are the opinions of the individuals who post them, and do not necessarily represent the opinions of Democratic Underground, LLC.

Home  |  Discussion Forums  |  Journals |  Store  |  Donate

About DU  |  Contact Us  |  Privacy Policy

Got a message for Democratic Underground? Click here to send us a message.

© 2001 - 2011 Democratic Underground, LLC