realbasic-nug
[Top] [All Lists]

Re: "You're not going to learn how to program in BASIC any more"

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: "You're not going to learn how to program in BASIC any more"
From: Brad Hutchings <brad at componentx dot com>
Date: Fri, 30 Sep 2005 11:22:01 -0700
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <20050930142614 dot C65A0DDD465 at lists dot realsoftware dot com> <433D5E28 dot 1090302 at wanadoo dot fr> <70af859d6b5bbb44e39f618e4646a05a at mac dot com> <D12CC48E-26B5-454F-9882-482ECC9BF037 at haranbanjo dot com> <76d2aeb6e418df81da555049b0f028dc at mac dot com> <F5E9AED0-C024-4F82-B359-45EE0044578E at haranbanjo dot com>
Array notation is nothing but syntactic sugar. It's a base address + an offset into a block of uniformly sized memory blocks. Nothing in the language absolves you of the responsibility to stay in the bounds of what the compiler allocates for the array on the stack, or you explicitly allocate in the heap.

My bet is that Will was a CS major. This is the kind of trivia that makes a good quiz question in a lower division "programming" class. But, as we now have operating systems that keep programmer mistakes with this stuff from hurting the whole system, having a real understanding of what's going on is probably a waste of most developer's time.

-Brad

On Sep 30, 2005, at 10:37 AM, Will Leshner wrote:

Ok, again this is for the benefit of our listeners, but (and this is more a general C thing than anything specific to C++) pointers and arrays are really just two ways to say the same thing in C. In fact, I'd go so far as to say that array notation is just syntactic sugar for pointers. I would expect that most compilers would generate the same code for both.


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>