Zuckerberg To Teach 10 Million Kids 0-Based Counting
theodp writes "'Why do programmers start counting at zero?' wondered Mike Hoye, questioning the conventional programming wisdom. Code.org will soon introduce the practice to a hoped-for audience of 10 million schoolchildren as part of Computer Science Education Week's Hour of Code. In a tutorial created by engineers from Microsoft, Google, Twitter and Facebook that's intended to introduce programming to kids as young as six years old, an otherwise breezy lesson featuring look-ma-no-typing Blockly and characters out of Angry Birds and Plants vs. Zombies, a Mark Zuckerberg video introducing the concept of Repeat Loops includes an out-of-place JavaScript example that shows kids it's as easy as 0-1-2-3 to generate 4 lines of lyrics from Happy Birthday to You by using zero-based numbering with a For-loop and ternary If statement. Accompanying videos by Bill Gates on If Statements and basketball star Chris Bosh on Repeat Until Blocks show the Code.org tutorial is still a work-in-progress. That's no big deal, since CSEdWeek has pushed back the delivery date for final Hour of Code tutorials from its prior little-time-for-testing due date to Dec. 9th, the first day of a five-day period during which teachers are expected to deliver the lessons to 10 million students."
Iterating through offsets beginning with zero is simply not counting. The writer is confused.
Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety.
Can I request an Editor Week?
Do you even lift?
These aren't the 'roids you're looking for.
Why do programmers start counting at zero?
We don't. We start indexing at zero (in some languages), because that's usually the offset of the first useful location in an array (ie, addr + 0).
... the Lua and Matlab developers are shaking their fists at the skies.
Because that's how many girlfriends most of them had.
from the firms giving us the finest in privacy destroying bad code.
This is so cheesy I'm getting queasy. Won't somebody think of the poor, poor children?
Why do programmers start counting at zero?
I expect that this is going to annoy a lot of Fortran "programmers".
Sesame Street: Feist sings 1,2,3,4. Not 0,1,2,3. :-)
It's a "C" thing. Try Pascal or other Wirth family languages instead if you want to start at 1.
much of left-wing thought is a kind of playing with fire by people who don't even know that fire is hot - George Orwell
So, is that (dec) ten million kids or (dec) two million?
Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
10 million kids or 10,000,001 kids?
Careful there, Z -- that might count as a "public performance" of Happy Birthday. I know you're rich, but the payment for and audience of 10 million might be kinda high.
Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
It is an indicator of a shift off the first position.
Numbering items with an index starting from zero isn't counting. It's just numbering.
Teach this first, along with counting continguous elements by index substraction + 1.
Programmers don't count starting at zero. They index items in collections starting at zero, because it makes certain actions more convenient when you're working at a very low level. But when it comes time to count the items, they start at 1 like everyone else.
But hopefully the kids have a lesson for him soon.
1 The RIAA Will Sue
2 Happy Birthday to Marky
3 Our Lawyers'll be Contacting You
Perhaps his time would be better spent getting Facebook to work correctly or maybe its just that his method of counting doesn't work that well.
Teach kids how to spell, write and do math correctly, then make them learn how to build a fire, build a house, grow vegetables.
When the end of the world comes, it's not diseases that's going to kill humanity, it's the lack of basic skills.
Please teach them about RUN-ON SENTENCES first!
"In a tutorial created by engineers from Microsoft, Google, Twitter and Facebook that's intended to introduce programming to kids as young as six years old, an otherwise breezy lesson featuring look-ma-no-typing Blockly and characters out of Angry Birds and Plants vs. Zombies, a Mark Zuckerberg video introducing the concept of Repeat Loops includes an out-of-place JavaScript example that shows kids it's as easy as 0-1-2-3 to generate 4 lines of lyrics from Happy Birthday to You by using zero-based numbering with a For-loop and ternary If statement."
Personally, I am sick and tired of seeing Microwaves that treat zero like it's a counting number. When it reaches zero it's supposed to stop, but instead they often continue for an additional second.
Youtube does the same thing. Advertisements on videos with that little countdown button. It says it delays 5 seconds, but it actually delays 6, because once it reaches zero, it waits for another second before ending.
This is grade school math folks. Zero is NOT a counting number. It's the FIRST (1) combination of a bit pattern.
So for any of you programmers out there that have been using zero in this way... STOP. It's sloppy programming, and I wouldn't hire you.
I'd like to wish Mark Zuckerberg luck in his new teaching career. He'd better start now, it will take him most of his natural life to make a dent in that number.
They don't. C, and its associated siblings, start counting at zero. They do this because there's no [meaningful] distinction between arrays and pointers. Older programming languages such as Fortran, which understand that there is a semantic difference between memory and arrays, and are quite happy to start their numbering at 1.
-JS
Are those YouTube features personally tailored?
Also I'm pretty sure that theodp is breaking the Flickr T&Cs by linking directly to the image.
Counting is an algorithm, like long division or the use of logarithmic tables--in this case an algorithm for assessing the exact numerosity of a set of objects. It consists of reciting a memorized stretch of blank verse ("one, two, three, four, five, ...") while uniquely pairing each foot in the poem with an object in the spotlight of attention, without skipping an object or landing on one twice. Then, when no object remains unnoticed, you announce the last foot you arrived at in the poem as the numerosity of the set.
This is just one of many possible algorithms for ascertaining numerosity. In some societies, people pair up the objects with parts of their body, and I know several computer programmers who count like this: "Zero, one, two three, four. There are five."
--Steven Pinker, The Stuff of Thought, p. 141
The biggest mistake in teaching mathematics is learning to start counting at one. That's fine if the only math ever learned is basic arithmetic; but higher order concepts including fractions, algebra, and number sets beyond whole numbers become much more difficult as a result. Why do we start counting at zero? Because zero is "Origin". When we count, what we are actually doing is this: I have zero. Adding one, I have one. Adding one, I have two. Adding one, I have three. Etc. By using zero as our origin, we can teach arithmetic using the integer set, rather than the whole number set. We can teach that the minus sign just means a change of direction, and that addition and subtraction are actually the same thing. So addition/subtraction is nothing more than repeated counting - a shortcut. Multiplication and division are repeated addition. Fractions are just another way of expressing division. Exponents/roots are repeated multiplication. "If you can count, you can do math. Everything else is a shortcut." Counting from zero allows us to teach euclidean coordinates / geometry as an extension of what students already are familiar with, rather than something new. Why do we start counting at zero? Because zero is "Origin".
All this energy to teach programming but nothing is mentioned about teaching basic science and math - what is truly missing in the US educational system.
And if you think kids will pick up those skills programming, i can assure you it won't happen.
Look, I am happy teaching kids programming, it is a very valuable thing because it teaches many different things all in one subject, but what the hell does an index offset have to do with counting?
0 is the first index of a typical storage location, it isn't because it is useful for counting, it is because it is base10.
Ignoring 0 because it is 0 would be silly, but then you could also argue that using -1 no position would be a bad thing in the case of stuff like "In String" or "Sub String" since it uses an extra character.
If we were to use 0 for nothing in these examples, then negative values could be used for offsets from the right edge, which can be useful in some cases and sometimes faster depending on the operation you are doing.
But, it isn't, because everything else uses 0 as the first index, changing one of them to be like this would be annoying as all hell.
Keeping things standard across all functions is incredibly useful.
Making exceptions is something a shoddy PHP developer would do with that crappy exceptions-based language that it is.
I've never used such an atrocious language in my life, the amount of stupid rules for specific functions is terrible, even worse because seemingly similar functions have opposing behaviours! WHY?!
PHP, the rotting sandwich in your toolbox. You wouldn't hammer a nail with last months sandwich now, would you? Go get a real sandwich, like Perl.
If we never kept standard behaviour between similar features, stuff like PHP comes out of it. You don't want more PHP, do you? DO YOU?!
If you are going to teach idiomatic loops, do it correctly. It's not
but
Note that in the second, idiomatic version your actual number of lines appears.
Note also that the two conventions are strongly related.
4 lines of lyrics from Happy Birthday to You
Others beat me to the copyright jokes.
But seriously, both 0-based and 1-based counting have valid, physical meanings. A 0-based count measures the number of valid elements before this one is processed. This count of preceding elements is useful for indexing in the majority of popular programming languages. A 1-based count, on the other hand, measures the number of valid elements after this one is processed. One often needs to allocate memory for elements in a manner such that the amount of memory used at once matches a 1-based count.
I started reading the article linked to in, "start counting at zero", and stopped halfway through. I feel sorry for anyone who reads that article, but isn't a programmer (hell, even if they are programmers), as it is self-contradictory crap:
From the article:
Itâ(TM)s not about [pointer math] because pointers and structs didnâ(TM)t exist....So I found [the person who originally decided to start array indices at zero] and asked him [why he started array indices at zero].
Then the father of zero-index arrays said:
...if p is a pointer p+1 is a pointer to the next word after the one p points to.
He then goes on to admit that zero-index arrays are the most efficient means of calculating memory addresses, and brushes aside his self-contradictions by saying that the "why" is more important than the "how".
Which means, as should be obvious to everyone, that zero indices are the most natural way to express pointer arithmetic; internally to your language runtime if your language doesn't support pointers, or externally if pointers are programmer-facing.
The author of this article needs to brush up on computer fundamentals before self-publishing his absurd opinion pieces on computer fundamentals. Zero-index arrays are "conventional programming wisdom" because they have always been the easiest way to calculate memory addresses.
Even well into adulthood, people are still confused by, e.g., the difference between "the early 1700s" and "the early 17th century" (which is actually the 1600s). Turns out, whether you like it or not, the first place value of 10^2, 10^3, 10^4, etc. you count through is always the 0th one. It's only in the very specific circumstance of counting the 10^1 place and when all the other 10^x place values are zero that the 0 gets skipped. Why not be consistent?
Besides being more consistent, I also think it is more intuitive (barring the fact that we are culturally inducted into thinking that it isn't). If you were counting *backwards,* say, starting with ten cookies and removing one cookie off a plate each time, it would be perfectly intuitive to you that you should count down to zero cookies, taking the very last cookie off the plate. The zero cookie limit is enforced by physical reality, while the one cookie limit is enforced by your arbitrary decision to interrupt your process of removing cookies and leave one cookie on the plate. Likewise, in the reverse process, you should also start your counting at an empty plate.
When things get complex, multiply by the complex conjugate.
Because you have to start counting SOMEWHERE.
bickerdyke
There is at least one very important case where it is critical to distinguish between counting from 0 or 1. It's counting of "gods".
Christians start at 1.
Atheists start at 0.
Most don't need it and will never use it. Moreover, Zuck and other billionaires who apparently have nothing to do with their money would be far better served by making sure every kid can read at their own grade level up until they graduate from high school.
Also, since most people in the US can only read at the 6th-7th grade level, it is literacy, not the ability to program, that's one of the greatest predictors of success in life and an endeavor that would be far more logical and worthy for them to pour their money into.
We don't start counting at 0. Our compilers do.
Comparing against zero is fast. Yes, even in high level languages like JavaScript if you write your loop in reverse it goes faster because your compare will be against zero instead of some in-memory or register value. Do some assembly level programming. At that level it's blatantly, smacked in the face, obvious.
00.01.02.03.04.05.06.07.08.09
...
...
10.11.12.13.14.15.16.17.18.19
20.21.22.23.24.25.26.27.28.29
30.31.32.33.34.35.36.37.38.39
0000 0001
0010 0011
0100 0101
0110 0111
1000 1001
1010 1011
1100 1101
1110 1111
10: PRINT "Everything old is new again."
20: GOTO 10
Poor programmers and people with poor maths skills frequently imagine themselves better than they are if they've had a dose of formal education.
In code, the FIRST element of an array if at offset ZERO, a fact which causes no end of bugs in much code. I can't count the number of times I've seen programs go wrong when the 'empty set' case occurs, because the programmers fail to understand that 'empty' (a form of zero) IS often a special case, not just another number like 1,2,3 etc.
At Junior school (7-11 years old), counting from zero was introduced as part of a process building to the concept of integer space, including negative numbers. But how many programmers test for zero when handling floating point values, not understanding how WRONG it is to contain precise integer values in floating point variables (and the excuse "but it works for me" only makes the incompetence worse).
There is nothing clever in dumbing down maths, and this includes the claim that counting from zero is 'cleverer' or more correct. Maths teaching has to respect a very simple principle- namely that people split into two categories.
1) Those who simply want dumb maths rules to follow by rote, and want to learn no more rules than are useful in their lives.
2) Those who want to understand mathematical principles to some degree of sophistication (most of us eventually give up at some point, leaving the really esoteric stuff to people who dedicate their lives to maths).
There is NOTHING wrong with all those people (the vast majority) who place themselves, or are placed by inherent mental limitations, in category 1. However, people who have an inclination for category 2 should receive an education at school that gives them maximum opportunity to explore their interest in maths.
HOWEVER, I find that it is category ONE people who over-rate their ability, who dribble on about higher maths understanding being essential for EVERYONE. This falls under the old saying "a little knowledge is a dangerous thing".
Not just programmers!
When a car comes off the assembly line, is the mileage set to 1 mile?
When a stopwatch is reset, is it set to 1 second?
Is the far left edge of a ruler set to 1 inch?
If you empty your bank account, do you have 1 dollar?
I think introducing zero-based counting to older children is a good idea. For younger children, this is a mistake.
"You have ten fingers Zoe."
"No I don't. I have nine. See? 0,1,2,3,4,5,6,7,8,9 -- 9!"
Teaching young children zero-based counting, before they can count is like teaching them the Greek alphabet before they learn their ABCs.
Proverbs 21:19
I've heard of 1 based counting (0,1,2,3,4, etc)
I've heard of 2 based counting (0,2,4,6,8, etc)
I've heard of 5 and 10 based counting (0,5,10,15, etc. or 0,10, 20, 30, etc.)
and so on,
but wouldn't 0 based counting just give you 0,0,0,0,0?
and though BCPL arrays are zero-origin, the language doesn’t support pointer arithmetic, much less data structures
In BCPL the only way of addressing arrays is by pointers. Pointers are fundamental. Variables can contain pointers to data (vectors), procedures, vectors of procedures etc. If you see that the only way of making structures is to use vectors and pointers you see that zero-indexing is fundamental.
> Repeat Loops includes an out-of-place JavaScript example that shows kids it's as
> easy as 0-1-2-3 to generate 4 lines of lyrics fromHappy Birthday to Youbyusing zero
Happy Birthday is copyrighted, so you better get permission or you'll get a good education on numbers with lots of zeroes.
(-1: Post disagrees with my already-settled worldview) is not a valid mod option.
Yeah, yeah, yeah, and testing against zero is usually computationally cheaper in hardware. You're right, but you're wrecking an ancient jest.
Female programmers can only count to nine without taking their shoes off, but male programmers can count to ten by just unzipping.
That chestnut's as traditional as "why do programmers always get Hallowe'en and Christmas mixed up", you know? Have some respect for the history!
I LIKE that Mark. If I were on the fBook, I would click a button 4u.
We often say that immediately after starting to job on the track we are on first lap. Then we reach our second, then our third, and so on, updated each time we cross the starting point. But I hate this and would much rather start with zero. Does anyone else feel the same way? I liked to say to myself, "I've completed no laps," then "I've completed one lap," and so on, instead of "I'm on my first lap," and "I'm on my second lap." Better to count what one has already done instead of what one plans to do.
then make your loop condition be i 4. The = is confusing and unnecessary.
Mark Zuckerburg teaches 6 year olds the difference between null and zero. Good luck with that!
No sane programmers would start counting at 0... Or 1 for that matter.
10 PRINT "HELLO"
20 GOTO 10
Because you have to start counting kids from ZERO.
Don't you guys read your own articles?
If telephones are outlawed, then only outlaws will have telephones.
That's no big deal, since CSEdWeek has pushed back the delivery date for final Hour of Code tutorials from its prior little-time-for-testing due date to Dec. 9th
Software industry, is there nothing you cannot deliver late, not even a simple description of a loop?
"There is more worth loving than we have strength to love." - Brian Jay Stanley
Those who count from 0 and the other 10 types.
Kids naturally start counting at zero. "I have zero breakfast from my parents today, I'll be fed for zero dollars at school." "I'll learn zero about ... today...".
If the lowest counting number you know is one, then you have a real problem. "I don't know how to count how little Mt. Dew I have, I don't know what I'll dew ..."
If 0 is now then new 1, what represents nothing?
...only 9999999 kids get the invitation email?
When you make a video, that is not a public performance. It is a cover recording. Now, if he had released it as audio only, he would only have to purchase a mechanical license for something like $0.07 per copy. Granting mechanical licenses is mandatory for the copyright holder and the price is set by the government. Unfortunately, mandatory licensing does not apply to audio-video sync licenses, which is what you need if you make a video. AV sync licenses must be purchased directly from the copyright holder and he is free to refuse your request or charge any price he wants for it.
In practice, this means that little people like you and me can not get one. It also means that for us there is no legal way to post covers on YouTube. Now, YouTube has agreements with some copyright holders (we don't know which ones), who decided to not prosecute us for doing so in exchange for putting ads next to our videos. This means that you usually get away with it, but occasionally might roll some bad luck, get sued for millions, go bankrupt and starve to death. Kind of a russian roulette.
Mark Zuckerberg is big enough to negotiate a license, but he might do us all a service if he spent that money on lobbying congress to update copyright laws for the digital era. Like, for example, by extending mandatory licensing to all contexts and work types, not just audio covers.
0 AM, otherwise notated as 00:00:00 on a 24-hour clock. So, the first hour is labelled zero, the first minute is labelled zero, and the first second is labelled zero. (Ask me about milliseconds...! ;-)
We starting counting at infinitely many gods. Then we moved on to just many. The Abrahamic religions have moved on to just one. ... and they've almost converged on the correct answer. :-)
> I start counting at zero. "I have zero bottles of Mt. Dew, it is time to go to the store."
In that instance, you're counting down the number of bottles left. And zero is the value at which you *stop* counting.
Also FatPhil on SoylentNews, id 863
The author of exple.tive thinks that it's all about execution, efficiency, which his sources clearly indicate it's not -- but he's so hung up on execution efficiency being the most important thing in his mind that he doesn't even realize what his sources are saying. It's actually all about ease of programming. The logic of offsets is easier to follow when indexing from zero. Full stop. (That said, as others have mentioned, people still count from one.)
Just to enforce counting from 0..9.
Have gnu, will travel.
0 is the first number, so everything should start at 0. When you're born you aren't 1 you're 0, 0 is the logical first place to start for counting.
I think when you throw in a sports star your credibility gets divided by zero.
I am Bennett Haselton! I am Bennett Haselton!
The most cogent explanation of counting I've ever seen.
AC's comment.
Slashdot's we site.
It's thing? No, its thing.
Damn it, I've been doing it wrong all this time. Damn English. Maybe "Ive" been doing it wrong; I don't know any more! Maybe I dont know. Crap.
There was a contest for the smallest program that produces as output its own source code. Count the characters in the winning entry, which follows:
0 is the first number, so everything should start at 0. When you're born you aren't 1 you're 0, 0 is the logical first place to start for counting.
0 may be the first non-negative number, but the first counting number (aka positive number) is 1.
Also, if you happen to be chinese, you are 1 when you are born (which depending on your politics is a reasonable rounding given the fact that 9>12/2 ).
I'm confused. Does this mean we all have one less friend than we thought, or one more?
"The wisdom of the Patriarchs was that they *knew* they were fools." --Master Foo
Counting should be consistent with the number line. The number line starts at zero: http://en.wikipedia.org/wiki/Number_line Why confuse the kids by starting at 1 in Kindergarten? Only to have to teach them zero the next year when you start showing them number lines? I'm teaching my daughter to always start with zero.
^ Probably Sarcasm...
Dijkstra taught us why numbering should start at zero:
www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html
Both types of counting are useful in various circumstances. As a piano teacher, it always bugs me how counting time starts at one (1,2,3,4, 1,2,3,4 etc.). No matter what your opinion for starting with zero or one in a programming context, it is insane to start from one when counting time, but tradition has the final word unfortunately.
Placing down apples on a table, or referring to an element in an array is more arguable, but perhaps the most 'accurate' (though not the most practical) method is to count in pairs: 0..1, 1..2, 2..3 etc. This way you're referring to an apple which isn't a single point in mathematical space, but rather a RANGE of points from 0 to 1. This way half an apple makes sense too.
Why OpalCalc is the best Windows calc
> I start counting at zero. "I have zero bottles of Mt. Dew, it is time to go to the store." In that instance, you're counting down the number of bottles left. And zero is the value at which you *stop* counting.
Or you are counting from a point where you can only count up (.ie. I inherited a back-log of bugs of which zero have been fixed). Zero is the value at which you *start* counting and you stop when the number of fixed bugs equals the total # of bugs in your back-log.
We can dice it anyway we want, counting is counting, independent of reference, or direction.
Is this the nerdfuck who said no one wins chess grandmasters over the age of 30 (except the people who are in their 40s who hold the title currently)?
Fuck his noise.
In that instance, you're counting down the number of bottles left.
I open the fridge door. I start counting UP from zero. If there are no bottles, then I stop at zero.
I am not counting DOWN because there wasn't ONE bottle to have counted down from. I would be counting down if I said "I've just taken one bottle out and now there are zero", but that's still counting, and that's not the situation I spoke of to start with.
Programmers don't count at zero; we know that indexes begin at zero.
It's really that simple.
Much of this confusion come from developers that started with MS products
as opposed to developers who came up the right way from an Unix environment.
Pretty basic stuff...
How to count in Binary, Octal and Hexadecimal.
I never really questioned it. Mainly because I started with Basic, but quickly moved into 6502 assembler on the C64. Really stupid example that creates a 30 element array on the zero page with the set [1, 4, 7, 10, .....]
Array = $00
LDX #$01
LDY #$00
loop:
STX Array,Y
INX
INX
INX
INY
CPY #$1E
BNE loop
If I started my index in the Y register with 1 my first element would have been placed in memory location $01 and the array would have been 29 elements long. Instead I start it with 0 and my array goes in $00 through $1D and consists of 30 elements. It had always been my assumption that 0 indexed arrays were a carry over from this.
There's no reason that a high level language can't use indexes that start with 1. It just feels really strange to me using a language that does.
Post anonymously - For when your opinion embarrasses even you!
Zuckerberg to confuse 9,999,000 kids to get 1000 kids who can correctly count starting with 0.
Yes you too can become a coder and live the magical life...
1. Even your cube is missing now - just stare at your neighbor
2. Agile - replace software engineering with a management wet dream
3. SCRUM - replace software engineering with another management wet dream
4. Get into a bidding war with other nerds and try to do 80 hours of work in 25!
5. Don't build systems just build a demo that makes you look good every two weeks
6. Don't believe the experts: The sooner you start coding the shorter it will take
Anyone with brains knows you can start counting from any basis if you understand what you are doing.
zuckerfucker, gates and jobs were only after one thing - whipping the slaves into a frenzy to get production...
Kids naturally start counting at zero. "I have zero breakfast from my parents today, I'll be fed for zero dollars at school." "I'll learn zero about ... today..."
Why does it feel like there's some kind of comment being made here about the National School Lunch Program?
... in which you can specify whatever you want for your lower and upper indices and the compiler just figures it out for you. C requires the programmer to confuse "counting" and "indexing" and wind up doing them wrong. Zero, rather than meaning "nothing" like it does in the rest of all meaning, means "the first" - which is not counting one. I never expected that after all these years I'd still be programming so close to assembler.