Dumb question...

Does anyone know the actual comparative weight of lines of code?
yes i mean the weight of the little electrons and such

i heard someone else say in another thread –

Is this accurate?.. it seems like a bunch over what it should be… just wondering…

Were you guys really that desperate on weight this year? :rolleyes:

If so, when in doubt, more 0’s and fewer 1’s. :stuck_out_tongue:

lol… ya thats a good idea

our weight wasn’t an issue this year, i was just curious and bored

Discover magazine did an article several years ago, called “How much does the internet weigh?”. In the article, they assumed that a zero weighed nothing, and a one weighed however many electrons it took to store that value on a mempry chip. If I remember correctly, all the data on the internet weighed way less than one billionth of an ounce.
OH look, here’s the article!

Forgive any misrepresentations, I didn’t re-read the article, and I may have mis-remembered the facts.

Perhaps getting a bit more technical than is necessary, it’s interesting to note that spaces themselves have no effect on ‘weight’ in compiled code. Whitespace characters [spaces, tabs, newlines (except in certain circumstances/languages)], along with comments, are thrown away by the Lexer, the part of the compiler that is responsible for taking the source code and turning it into a sequence of tokens, which is basically each word or symbol that appears in the source file. (Unless of course you’re actually programming in White Space) Extra lines of code, however, may (in most cases yes, but they may actually get optimized away by the compiler) add ‘weight’ to the final compiled program. In order to control what may be written as 0s or 1s, however, you’ll have to go to a lower level, in assembly code.

But seeing as each electron is 9.109 E−31 kg, you’d probably get more benefit with one pass of a metal file somewhere discrete. :rolleyes:


Ah, but which actually weighs more, a 1 or a 0? If you go with historical precedence (i.e. back to the punchcard days), I believe a “0” was unpunched and a “1” was punched, which means that a 0 weighs more than a 1.

Hmm… interesting point…

I think if we had to have computers requiring punch cards on our robots, we might have bigger weight issues to worry about, though. :rolleyes:

Zeros must weigh more - they’re fatter.

(Hey, I resemble that shape) :stuck_out_tongue:

so hypothetically speaking what would you do if your robot was so close to weight and everything physical was done away with until it was just structurally stable. And the weight of your code mattered:eek:.

Actually I believe 1s are heavier since a one represents a charged capacitor.

read the article that was linked above I’m not THAT geeky :stuck_out_tongue:

Just another thing we can blame programmers for :smiley:

I can’t help myself… A CHARGED CAP WEIGHS THE SAME AS A DISCHARGED CAP!! I’ve heard the same logic used incorrectly to explain that a dead battery weighs less than a fresh battery. CAP’s store PE by separating charge, not storing one type of charge!! Ok, I’ll leave it alone and not return… the teacher has left the room.

I remember enjoying that article immensely when I first read it. If you follow the figures published there, you’ll find that data weighs 6.4 * 10^-31 oz per kilobyte. This means you’ll need about 1.5 * 10^21 terabytes of 1s and 0s to have an ounce of data. Interestingly, this article provides further figures and even suggests that the entire internet weighs about two ounces.

Now, if you consider that the entire universe is made of math, then you can imagine how much data we’re all messing with every day.

But what happens if it’s not actually a capacitor, but a piece of NAND Flash memory using quantum tunnel injection? :cool:

Actually I have no idea what the answer is.

Here’s an interesting concept however: If you pick up enough static from the regolith, can you get enough weight in extra electrons to give you a significant advantage over the competition? That all assumes you’re not actually losing electrons to the floor instead…


If you lose that much weight in electrons, you had better be prepared for one heluva static shock when you pick up the robot again.

wow… i never expected this thread to pick up… but then again here it goes… first teams suprise me everyday…

I calculated the weight of our code which ended up being 2.4164*10 ^ -18 pound according to the above article. And yes I had to do it.

What they should take into account is the weight of all of the storage devices for all of that data!!! Hard drives and such!!! we might come up with a tiny bit of a bigger number!!!:rolleyes:

Both were punched. 12(very top), 11, 0 … 9 (very bottom). If 0 wasn’t punched you couldn’t distinguish between a composite that used 0 and one that did not.

Believe me — on this I’m not


Check it out. I’ve hit virtual wonderland.
A very happy unbirthday to you all.
I’m going to open some bills now and get back in touch with reality now…

The lightest possible dataset being the lace card:

http://upload.wikimedia.org/wikipedia/commons/7/7d/IBM_lace_card.jpg](File:IBM lace card.jpg - Wikipedia)