Giter Site home page Giter Site logo

Comments (3)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 2, 2024
Zero-based numbering is confusing to new programmers, which is why most intro 
languages such as Basic, Lua, Moo, Scratch and Blockly all use one-based 
numbering.

Even programmers sometimes prefer one-based lists.  Think about the last time 
you saw a code editor list the first line as zero.

Blockly quietly converts the one-based lists to zero-based when compiled into 
JavaScript, Dart or Python.

It's a good question, and it's not too late to change this.  But from early 
feedback I think most non-programmers and novice programmers prefer counting 
from one.  Granted, it's irritating for experienced programmers such as us.  
And making it a preference would lead to even more confusion once we have code 
sharing and libraries.

Original comment by [email protected] on 11 Jun 2012 at 4:44

  • Changed state: WontFix

from blockly.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 2, 2024
That makes sense - I'm so used to 0-based indexing that I didn't even consider 
that it might be that. I wouldn't suggest changing it either, my experience is 
that 0-based indexing is only easier if you've had your mind warped in a way 
most non-programmers haven't.

It might be helpful if there was a short "here's a handful of things you'll 
have to keep in mind if you're a programmer" document pointing stuff like this 
out.

Original comment by [email protected] on 11 Jun 2012 at 6:40

from blockly.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 2, 2024
I have no issue with one-based numbering for newbie. But please return a 
readable error. I've figure out an hour why I got 'undefined' when trying to 
get item at 0.

Original comment by neizod on 16 Jun 2012 at 5:14

from blockly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.